For some web designs, it is desirable to always use the same theme for a few modules, while letting the user choose his own theme for the rest. Let's say you want to use the NukeNews theme for the News and Sections modules, but let the user's personal theme be applied to the other modules of your site.
The theme is set in the get_theme function of mainfile.php. Thus, all you have to do is declare the $name variable to be global in that function, then check its value before the selected theme is returned (i.e. immediately before the return statement) and, if it is, say "News", or "Sections", to choose the NukeNews theme (see Truly Global Variables):
Of course, there is nothing magic about $name. You could take just any other variable and make the theme selection be dependent on it. You would only have to declare it global in the get_theme() function and in the modules that you would like to se t it.
Prev | Home | Next |
How to prevent users from changing the theme in PHP-Nuke | Up | How to change the font size in PHP-Nuke |
Help us make a better PHP-Nuke HOWTO!Want to contribute to this HOWTO? Have a suggestion or a solution to a problem that was not treated here? Post your comments on my PHP-Nuke Forum! Chris Karakas, Maintainer PHP-Nuke HOWTO |