home *** CD-ROM | disk | FTP | other *** search
/ Internet Magazine 2003 May / INTERNET103.ISO / pc / software / windows / building / php_nuke / html / modules / addon_sample / f2.php < prev    next >
Encoding:
PHP Script  |  2002-09-16  |  1.3 KB  |  52 lines

  1. <?php
  2.  
  3. if (!eregi("modules.php", $PHP_SELF)) {
  4.     die ("You can't access this file directly...");
  5. }
  6.  
  7. $module_name = basename(dirname(__FILE__));
  8.  
  9. $index = 0;
  10.  
  11. function f2one() {
  12.     global $module_name;
  13.     include("header.php");
  14.     OpenTable();
  15.     echo "Addon Sample File (f2.php) function \"f2one\"<br><br>";
  16.     echo "<ul>";
  17.     echo "<li><a href=\"modules.php?name=$module_name&file=f2&func=f2go\">f2.php Main</a>";
  18.     echo "<li><a href=\"modules.php?name=$module_name&file=index\">Go to index.php</a>";
  19.     echo "</ul>";    
  20.     CloseTable();
  21.     include("footer.php");
  22.  
  23. }
  24.  
  25. function f2go() {
  26.     global $module_name;
  27.     include("header.php");
  28.     OpenTable();
  29.     echo "Addon Sample File (f2.php)<br>";
  30.     echo "<ul>";
  31.     echo "<li><a href=\"modules.php?name=$module_name&file=f2&func=f2one\">Function f2one</a>";
  32.     echo "<li><a href=\"modules.php?name=$module_name&file=index&func=dos\">Go to index.php</a>";
  33.     echo "</ul>";
  34.     echo "As you can see now, this page doesn't show the Right Blocks, this is because at the begining "
  35.          ."of this file we set \$index variable to \"0\"";
  36.     CloseTable();
  37.     include("footer.php");
  38. }
  39.  
  40. switch($func) {
  41.  
  42.     default:
  43.     f2go();
  44.     break;
  45.     
  46.     case "f2one":
  47.     f2one();
  48.     break;
  49.  
  50. }
  51.  
  52. ?>