Featured site: FootNotes migrated to Drupal
This week I migrated the FootNotes website (http://gnomedesktop.org) to Drupal. FootNotes is a news site for the GNOME Desktop project. So far I am pretty happy with it. I've been wanting to do this for months. Especially over the last month when my machine has been getting overloaded, and bombing quite frequently. I had been using a caching system which bought me an extra 1-2 years, but that time was up.
There were already scripts available to migrate the user accounts, stories, and comments......But nothing available to rebuild the comment thread structure. So cut-n-pasted some of the code out of the Drupal comment module and came up with a script to rebuild the thread structure. It took 1.5 hours to traverse through 32000+ commments on a 2.8 p4, but it went pretty smooth.
One of the main weaknesses of PHPNuke is it's comment system. The basic way the comment system functions in PHP-Nuke is pretty much the same system that existed in Thatware which PHP-Nuke was forked from. PHP-Nuke does a SQL for every comment in a story plus and extra query at the bottom of each thread to check for more children. I done many hacks over the years to PHP-Nuke to make things work right or fix security holes. Nothing quite like having someone email you your sql db password.
Over a year ago I was thinking to myself, how could I set things up so that every comment had a numerical value that represented the order in which the comment should appear and how far to indent it? That way comments could be pulled with one single query. But where I got stuck is if a comment gets inserted in the middle of a thread, how do you efficiently renumber all the comments below it to keep everything in the right order. Luckily the drupal devs are smarter than me. What Drupal does is saves a thread field for each comment. So for instance if a comment had a value of 2.5.1, it would be the first baby of the the 5th child of the 2nd top level comment in a story. They have to do a few extra tricks like adding a trailing slash and doing a couple of counting tricks to get the 10th comment not show before the 2nd comment, but it works. This allows drupal to pull all comments out in one single sql query.
So far the load averages are marginally lower, but most importantly the spikes are gone. Drupal is definitely gonna buy me more time on my existing hardware.
On the whole the Drupal is much simpler and easier to use.
I'd I like to give a big round of applause to the Drupal Dev's.......You guys rock hard!