PostNuke

Flexible Content Management System

News

Themes multi-platform standard

Contributed by Being a great friend on Aug 01, 2001 - 07:30 AM

For the geeks : Here a piece of code that could be in any of the core pages. A temporary variable basically reads or collects all the current code, and then calls a function table(), the actual table that will hold and display all the code.






That function table() is defined in a page tables.php that is part of a theme. Meaning everybody that makes a theme can fool around with that tables.php as much as they want without ever having to touch any of the core pages.






An example, just a snippet of random code I copied and pasted to demonstrate the principle :






$htmlsrc .= eregi_replace("_", " ", $sites_array[category_name]);






$htmlsrc .= "  ";






$htmlsrc .= $functions_16 . $sites_array[hits_in] . "";






$htmlsrc .= "  " . $functions_17;






$htmlsrc .= $sites_array[hits_out] . "";






$htmlsrc .= "rnrnrn";












Now we put the code from the core page in the function table() as defined in tables.php






$html .= table("100%","center","",$htmlsrc);












and reset or rather unset the variable












unset($htmlsrc);












As you can see there was some html stuff in the code as well that doesn't show up in the post of course, but that's not really relevant. You probably get the idea.












I've been doing several themes for phplinks with this system (credit for the tables system goes to phpDude) and I have been amazed by the power and flexibility of it.












Not only will it make it a lot easier to make new themes. By getting ALL themeable stuff out of the core pages. Those themes will basically stay compatible with all future upgrades as well. And by just changing stylesheets you can go a long way.












And if we could get the folks at phpwebsite and maybe even phpnuke - after they cooled down probably - on board this would be a tremendous step to break away from the YANWS look of most nuke forks.












Comments ?
1311