Modifying PHP Nuke

I have a confession to make: I am an undisciplined programmer at heart. Unless someone or something provides external motivation to do otherwise, I tend to jump in and start coding a project without any formal plans. This approach usually produces code that is difficult to extend or maintain because one discovers requirements of a project only by bumping into the limitations created by what one has already coded. The end result is a continual state of rewrites.

That makes me somewhat of a hypocrite, because I get annoyed with those who do likewise. That has been the case with PHP-Nuke. I've been modifying PHP-Nuke 4.4.1a (www.phpnuke.org) for use as the publishing system for the VarLinux.org site (www.varlinux.org) and for Petreley.org, which is a project I'm doing in my off hours. PHP-Nuke is a Weblog publishing system written in PHP (www.php4.org) with MySQL (www.mysql.com) as the database back end.

To be fair, the programmers of PHP-Nuke might not have been deliberately disorganised with their approach; they simply may have fallen into some common PHP traps. Although it is entirely possible to use PHP to build a modular Web site, the language tends to discourage modularity because PHP code integrates into HTML.

This is what makes PHP simultaneously irresistible and prone to disorganisation. It is irresistible because you can use PHP to crank out MySQL data and turn it into a page of information more easily than just about any other Web programming system. PHP is prone to disorganisation because the HTML opening formatting tags you create inside a PHP function are often completed by other PHP functions. This means that every time you change the opening formatting tags, you have to find every occurrence where the closing tags must match. The most common format tags that get you into trouble are the table, row, and data tags. If you don't handle these tags properly, many of your page elements will be scattered into places you don't want them.

One way to get around this is to create a function for every combination of opening and closing tags. You can see in the current version of PHP-Nuke that the coders tried to implement this in some cases, but it was probably too late to revamp the whole project without starting over, which is what they did. PHP-Nuke 5.0 is on its way, and it is built almost from scratch.

Anyway, these problems were exactly what I encountered when I began modifying PHP-Nuke themes and PHP-Nuke itself for use with VarLinux.org. There are many sample themes for use with PHP-Nuke, and the ones I chose to modify for use with VarLinux.org were fairly sloppy.

Unfortunately, I checked my work using only the KDE Konqueror browser and Mozilla 0.8, and occasionally Opera for Linux. All of these browsers rendered my site beautifully in spite of the fact that the theme code was riddled with errors. It was only when Netscape users reported messy rendering that I began to look for these errors. I found dozens scattered throughout the themes and the PHP-Nuke code itself. (Granted, I probably introduced many of these errors myself while modifying PHP-Nuke for my needs.) Fortunately, the folks who did PHP-Nuke are releasing a new version soon which probably addresses many of the modularity issues I encountered.

In summary, I recommend taking a good long look at PHP-Nuke, both the old and new versions. Feel free to download my modified version from the VarLinux.org Web site, if only to have a good laugh at the work I've done. I'm also planning on looking at a very promising product called LXP (www.linuxports.com) as an alternative.

I recommend having a look, yourself. Another publishing system worth examining is ez-Publish (developer.ez.no). I had trouble with this software and gave up on it, perhaps too quickly. But it appears to be extremely feature-rich and powerful. I've also found it impossible to get started with CMF-1.0 (cmf.zope.org), the content management system for Zope (www.zope.org). But it looks nice. I can't help but wonder what it would be like to use it. Yet another couple to look at are thatware (www.thatware.org) and squishdot for Zope (www.squishdot.org).

Finally, I highly recommend studying many of the PHP-Nuke themes that are available on the PHP-Nuke Web site. I'm not an HTML guru by any means. I can barely grasp the concept of nested tables after messing with the themes for my site. But I learned an awful lot about how to use tables to create certain visual effects simply by trying to reproduce the effects of the existing themes and then correcting all the mistakes I had made in the process.

Indeed, I'd say that working with PHP-Nuke along with the themes that are available make one of the best tutorials on PHP and HTML formatting I've ever seen.

Join the newsletter!

Or

Sign up to gain exclusive access to email subscriptions, event invitations, competitions, giveaways, and much more.

Membership is free, and your security and privacy remain protected. View our privacy policy before signing up.

Error: Please check your email address.
Keep up with the latest tech news, reviews and previews by subscribing to the Good Gear Guide newsletter.
Show Comments

Brand Post

Most Popular Reviews

Latest Articles

Resources

PCW Evaluation Team

Tom Sellers

MSI P65

This smart laptop was enjoyable to use and great to work on – creating content was super simple.

Lolita Wang

MSI GT76

It really doesn’t get more “gaming laptop” than this.

Jack Jeffries

MSI GS75

As the Maserati or BMW of laptops, it would fit perfectly in the hands of a professional needing firepower under the hood, sophistication and class on the surface, and gaming prowess (sports mode if you will) in between.

Taylor Carr

MSI PS63

The MSI PS63 is an amazing laptop and I would definitely consider buying one in the future.

Christopher Low

Brother RJ-4230B

This small mobile printer is exactly what I need for invoicing and other jobs such as sending fellow tradesman details or step-by-step instructions that I can easily print off from my phone or the Web.

Aysha Strobbe

Microsoft Office 365/HP Spectre x360

Microsoft Office continues to make a student’s life that little bit easier by offering reliable, easy to use, time-saving functionality, while continuing to develop new features that further enhance what is already a formidable collection of applications

Featured Content

Product Launch Showcase

Don’t have an account? Sign up here

Don't have an account? Sign up now

Forgot password?