Site updates

I just updated ShareYourMusic.com & WorldBeatPlanet.com to Drupal 4.4 final. The update was completely painless. I also changed the appearance of ShareYourMusic since a lot of people complained about the black background.

I also tweaked the default theme at MacMegasite slightly, getting rid of some graphics on the front page to make it load faster and use less bandwidth.

Some PHP fun

Since shareyourmusic.com and worldbeatplanet.com now point to the same host and share the same installation of Drupal, the stand-alone script “feedback.php” on both hosts is the same. Since it isn’t part of Drupal, it didn’t know about the two different sites.

I just added a test (eregi("worldbeatplanet.com",$_SERVER["HTTP_HOST"])) to set some display variables according to the host name, so it will look completely different (and send the feedback to a different address) depending on which hostname it’s run from.

I’m also using a variation of that same script (which I partially ripped off from PHP-Nuke’s feedback module) for the contact form at this site.

Conversion to Drupal completed

I’ve completed my conversion of WorldBeatPlanet from PHP-Nuke to Drupal. I was able to convert most of the content (I’ve saved the reviews but haven’t had a chance to convert them yet). Several people have said they like the new site, and I think it will be a lot more flexible than the old PHP-Nuke site.

Fun with SQL

The Drupal version of WorldBeatPlanet is shaping up very nicely. Rather than using the song & review modules, I’m using a taxonomy to select song lyrics or reviews. I defined a required vocabulary with the terms story, lyrics, and review. To find all items of a specific type, I use the following SQL query:


SELECT n.nid, n.title
FROM node n
LEFT JOIN term_node t ON ( n.nid = t.nid )
LEFT JOIN term_data d ON ( t.tid = d.tid )
WHERE ( d.name = "lyrics" )

Moving to Drupal

Thanks to a suggestion from Kitt at drupal.org, I figured out how to move most of the content from worldbeatplanet’s Nuke database to Drupal. I plan to switch over worldbeatplanet completely in a few days and shut down the Nuke site.

I also plan to merge worldbeatplanet with shareyourmusic.com. Since I can now modify my hosting packages through my reseller account, I will move the worldbeatplanet domain to the same account that now hosts shareyourmusic. I will have separate databases for each, but I hope to be able to share some code & content.

I’ve already created a subdomain static.shareyourmusic.com where I’ve copied the static pages for individual artists. I still need to fix some references, though. I will have static.worldbeatplanet.com pointing to the same site, as well as subdomains for each artist.

Getting disgusted with PHP-Nuke

I’m still finding some remnants of the hack at WorldBeatPlanet. Right now I’m pretty disgusted with PHP-Nuke. It has more security holes than Windows.

I’m considering switching WorldBeatPlanet to Drupal and I’ve even set up a test site here. The only drawback is there doesn’t seem to be any easy way to move over the old content.

PHP-Nuke vs. Drupal

I’m now running two PHP-Nuke based sites and one Drupal site. Both have their good and bad points, so here are my thoughts.

With PHP-Nuke, Francisco Burzi runs the whole show and he usually seems to ignore suggestions. PHP-Nuke is a big, complex package with lots of source files. Modifying Nuke is tricky, but it’s fairly easy to configure and install without any programming.

Drupal is very small and modular. Many developers are involved and the community is very active and open to outside contributions. It’s not as full-featured or stable as Nuke, and it’s a lot more difficult to configure, but it’s a lot more flexible. To really get the most out of it, some programming work is necessary. There are a lot of existing modules to add functionality, and it’s possible to write your own modules.

I probably wouldn’t be able to do a site like ShareYourMusic.com in Nuke, since it doesn’t let you add new object types (such as tunes) and integrate them as thoroughly with the rest of the site’s content. When you add a module to Nuke, it’s pretty much separate from the rest of the site’s functionality. Nuke modules can’t extend other parts of the system or modify the functionality of other modules. Drupal’s object-oriented architecture makes all of that possible.

OOPS!

I just fixed a bug in my drupal tune module so registered users can now actually upload their tunes to shareyourmusic.com.

It turns out that I had the acccess hook declared as: function tune_access(), which is how it was in the original file module, when it should have been: function tune_access($op, $node)

The result of that was only an administrator could upload tunes, not a regular user, even though upload access was allowed.