Tuesday, August 29. 2006paddling.net Photo of the Week
Cool, my canoeing photo from Emerald Lake in Canada made the paddling.net photo of the week. See more of my pictures from the Canadian Rockies.
A long time ago I got this photo from Lake Jocassee and this one from the Sparkleberry Swamp picked for photos of the week. Sunday, August 27. 2006Drupal: An image module that uses filemanager module
I'm working on a personal project using Drupal. The image module allows you to let users post images to the site. However, it puts all of its files into a single directory, which is a performance concern if you want to have a lot of images on your site. The filemanager module has support for lots of files, but the image module was not written to use it.
So I decided to try my hand at Drupal coding. I started with image.module and overhauled it to work with filemanager.module. Along the way I found that Drupal 4.7 doesn't offer a good way to maintain certain data through the form preview, so I filed a bug. The workaround I came up with, and also used by a prominent Drupal coder, was to use the $_SESSION variable to maintain that data. So anyway, here is the new image.module code. Please feel free to try it and let me know what I should fix. Some notes: the current version 0.1, requires you to use only the original, preview, and thumbnail sizes, and also requires a database table called image_fm. I also could not come up with an elegant way to handle the case of a single user posting multiple images at the same time, sicne the $_SESSION variable used only allows for one per user at a time. This may be easy to fix, but I don't fully understand the Drupal form API yet. Thursday, August 17. 2006PHPBB Fake Members
It's becoming frustrating to be a PHPBB administrator, at least if you want to keep your memberlist clean. Form bots out there create fake users on your site in the hopes that your memberlist will show their spam URL. It's been an ongoing, and losing battle, to keep them out.
Update 2006-08-22: The fake users keep coming. So I came up with a cron job that runs this query once per day. It will remove inactive PHPBB users older than 48 hours. This gives time for the new users to properly activate. DELETE FROM phpbb_users WHERE user_active=0 AND user_id>0 AND FROM_UNIXTIME(user_regdate)<DATE_SUB(NOW(),INTERVAL 2 DAY); The user_id>0 part is to avoid deleting the Anonymous user, which has a user ID of -1 on my installation.
(Page 1 of 1, totaling 3 entries)
|
CategoriesQuicksearchArchivesSyndicate This Blog |