home *** CD-ROM | disk | FTP | other *** search
/ Internet Magazine 2003 May / INTERNET103.ISO / pc / software / windows / building / php_nuke / html / modules / addon_sample / index.php < prev   
Encoding:
PHP Script  |  2002-09-16  |  1.7 KB  |  70 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 = 1;
  10.  
  11. function one() {
  12.     global $module_name;
  13.     include("header.php");
  14.     OpenTable();
  15.     echo "Addon Sample File (index.php) function \"one\"<br><br>";
  16.     echo "<ul>";
  17.     echo "<li><a href=\"modules.php?name=$module_name&file=index\">Go to index.php</a>";
  18.     echo "</ul>";
  19.     CloseTable();
  20.     include("footer.php");
  21.  
  22. }
  23.  
  24. function two() {
  25.     global $module_name;
  26.     include("header.php");
  27.     OpenTable();
  28.     echo "Addon Sample File (index.php) function \"two\"";
  29.     echo "<ul>";
  30.     echo "<li><a href=\"modules.php?name=$module_name&file=index\">Go to index.php</a>";
  31.     echo "</ul>";
  32.     CloseTable();
  33.     include("footer.php");
  34.  
  35. }
  36.  
  37.  
  38. function AddonSample() {
  39.     global $module_name;
  40.     include("header.php");
  41.     OpenTable();
  42.     echo "Addon Sample File (index.php)<br><br>";
  43.     echo "<ul>";
  44.     echo "<li><a href=\"modules.php?name=$module_name&file=index&func=one\">Function One</a>";
  45.     echo "<li><a href=\"modules.php?name=$module_name&file=index&func=two\">Function Two</a>";
  46.     echo "<li><a href=\"modules.php?name=$module_name&file=f2\">Call to file f2.php</a>";
  47.     echo "</ul>";
  48.     echo "You can now use Administration interface to activate or deactivate any module. As an Admin you can always "
  49.          ."access to your Inactive modules for testing purpouses.";
  50.     CloseTable();
  51.     include("footer.php");
  52. }
  53.  
  54. switch($func) {
  55.  
  56.     default:
  57.     AddonSample();
  58.     break;
  59.     
  60.     case "one":
  61.     one();
  62.     break;
  63.  
  64.     case "two":
  65.     two();
  66.     break;
  67.  
  68. }
  69.  
  70. ?>