A Shortcut


There's an even easier way, if all you want to do is display static HTML inside a module. Create a new folder with your module's name (such as AboutUs or whatever). Type the following code inside a file named index.php:

 <?php if (!eregi("modules.php", $_SERVER['PHP_SELF'])) {     die ("You can't access this file directly..."); } $module_name = basename(dirname(__FILE__)); $index = 1; function AddonSample() {     global $module_name;     include("header.php");     OpenTable();        include("modules/modulename/myhtml.html");     CloseTable();     include("footer.php"); } switch($func) {     default:     AddonSample();     break; } ?> 

Be sure to fill in the correct information for the boldfaced items: modulename should be the name of your module (the same name as the folder you just created, and be sure to use the same upper- and lowercase letters as you did in the folder name); myhtml.html should be the name of a plain HTML file stored in your new module folder. Copy the new module folder into your site's modules folder, and you'll have an instant static HTML module. You can edit the HTML file whenever you like, and index.php will just pull it in whenever a user visits that module.



    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