Development
Stop comment spam with Akismet and captcha in Drupal
One of the fun things with blogs is the possibility for readers to post comments. Unfortunately spammers post spam comments just like they send spam e-mail. So to keep the possibility for real visitors to post comments we need some type of defence against spammers.
The ratio of spam in comments is about the same as for e-mail. Something like 7 or 8 out of 10 is spam.
In an effort to stop comment spam xdeb.org has used the Captcha module with a simple math captcha.
ImageMagick with Drupal 5 for nicer image scaling
To put images on Drupal sites I mainly use ImageField or my hacked version of the inline module together with ImageCache and Thickbox
Imagecache can scale and crop images on the fly according to the presets you set up, a very nice module. All the small images on this blog is done this way. It will use the image toolkit from the Drupal settings on your site. This will most likely be GD2 toolkit since it comes with almost all installs of PHP and Drupal supports it out of the box.
GD2 works well but I was not satisfied with the quality of the scaled images. I know the Image module does it better with the help of the ImageMagick toolkit but I don’t want to use it for all my image needs.
Spice up your Drupal site search field with a bit of jQuery
Notice the search field here on xdeb.org? If you have JavaScript turned on you get the enhanced version with a nice placeholder/hint that disappears when you click in the field. The search button is hidden also, I assume everyone just hit return to to the search anyway so it just take up space.
If you use Safari, or any other Webkit browser, the search field is even more enhanced. Here how it looks for you who don’t use a Webkit browser.

Aside from looking gorgeous, it adds value in terms of an enhanced user-experience. It works just like any other search field on Mac OS X. If you just want the nice Safari search field, take a look at http://drupal.org/project/safarisearch.
All this is done with JavaScript on the original Drupal search form ensuring graceful degradation. If you turn of JavaScript all that happens is that you get the standard search field and button.
Here follows the code I use to implement this here on xdeb.org.
Sweden Drupal Meetup November 2007
Yesterday I was at the second ever Drupal meetup in Sweden. I could not attend the first one unfortunately.
We where eight that got together last night at the pub Kvarnen in Stockholm. It was really nice to meet other people, in real life, that all new what taxonomies are and why they are so great :-).
Besides getting to know each other we talked about setting up a site to promote Drupal in Swedish. A design draft that looked very promising was presented. Drupal work shops, Drupal BarCamp and a Scandinavian Drupal conference was also on the agenda.
Install Drupal and contributed modules and themes via cvs
The quickest and most efficient way to maintain a Drupal installation is in my opinion to install and update it via cvs. It looks complicated to start with but my experience is that when you get used to it you don’t want to do it any other way.
I will assume you already have cvs installed or otherwise know how to do it on your server. You also need to have shell access and be familiar with the command line. If this is not true you better stop reading :-).
Original article 2006-10-31, new revision 2007-11-16.
A simple related content block based on terms
I recently put up a related content block on this site and here is how I did it.
There are a number of modules, at least four, for this but a simple block PHP snippet suited me best.
This PHP snippet makes sure we are viewing a node. Gets the terms for that node. Search for other nodes with the same terms and displays the five latest it can find as a node title list.
Display a more visibel "Read more" link with Drupal
Drupals “Read more” link is by default displayed together with other links like “Add new comment” at the bottom of the teaser display. Readers not used to blogs and other moderns web sites can easily miss that there is more to read.
Luckily Drupals hook_nodeapi makes its easy to add content to the node display. Here is the function I have just added to this site to display “Read the rest of this posting.” right after the teaser content.

Recent comments
3 days 17 hours ago
5 days 12 hours ago
5 days 13 hours ago
5 days 15 hours ago
5 days 18 hours ago
1 week 7 hours ago
1 week 9 hours ago
1 week 9 hours ago
1 week 1 day ago
1 week 1 day ago