Theme Basics


Themes all live in your site's Themes folder, with one subfolder per theme. The theme's name is determined by its folder name. Only one file is required in a theme, and that's theme.php. It must appear under the theme's folder. The theme's folder can also include additional files, as needed, including graphics, which are often stored in a subfolder named Images.

theme.php isn't an HTML file, usually. Instead, it's a PHP program, or script, that constructs various portions of the PHP-Nuke interface. Every PHP-Nuke page includes theme.php for the selected theme and asks it to create the HTML for any onscreen elements, such as tables, headers, and so forth.

theme.php must provide certain functions because PHP-Nuke calls these functions and expects each theme to provide them:

  • themeheader() draws the top of the page.

  • themefooter() draws the bottom of the page.

  • themeindex() formats the stories on the home page.

  • themearticle() formats individual news stories.

  • themesidebox() formats blocks.

  • OpenTable() draws the first part of a module, including its title bar.

  • CloseTable() finishes a module.

Additionally, CloseTable2() and OpenTable2() functions are required. These draw a table at a specific pixel width rather than at 100 percent, as the original OpenTable() and CloseTable() functions do.

So, to draw a page, PHP-Nuke first calls on themeheader() and then makes several calls to themesidebox() for the left blocks. Calls to OpenTable() and CloseTable() draw the module content, followed by calls to themesidebox() for the right-side blocks. Finally, themefooter() is called to finish the page.



    PHP-Nuke Garage
    PHP-Nuke Garage
    ISBN: 0131855166
    EAN: 2147483647
    Year: 2006
    Pages: 235
    Authors: Don Jones

    flylib.com © 2008-2017.
    If you may any questions please contact us: flylib@qtcs.net