home *** CD-ROM | disk | FTP | other *** search
/ PC World 2005 April / PCWorld_2005-04_cd.bin / akce / web / phpnuke / PHP-Nuke-7.5.exe / html / index.php < prev    next >
PHP Script  |  2004-07-24  |  3KB  |  73 lines

  1. <?php
  2.  
  3. /************************************************************************/
  4. /* PHP-NUKE: Advanced Content Management System                         */
  5. /* ============================================                         */
  6. /*                                                                      */
  7. /* Copyright (c) 2002 by Francisco Burzi                                */
  8. /* http://phpnuke.org                                                   */
  9. /*                                                                      */
  10. /* This program is free software. You can redistribute it and/or modify */
  11. /* it under the terms of the GNU General Public License as published by */
  12. /* the Free Software Foundation; either version 2 of the License.       */
  13. /*                                                                      */
  14. /************************************************************************/
  15. /* Additional security checking code 2003 by chatserv                   */
  16. /* http://www.nukefixes.com -- http://www.nukeresources.com             */
  17. /************************************************************************/
  18.  
  19. require_once("mainfile.php");
  20. $_SERVER['PHP_SELF'] = "modules.php";
  21. $row = $db->sql_fetchrow($db->sql_query("SELECT main_module from ".$prefix."_main"));
  22. $name = $row['main_module'];
  23. $home = 1;
  24.  
  25. if ($httpref==1) {
  26.     $referer = $_SERVER["HTTP_REFERER"];
  27.     $referer = check_html($referer, nohtml);
  28.     if ($referer=="" OR eregi("^unknown", $referer) OR substr("$referer",0,strlen($nukeurl))==$nukeurl OR eregi("^bookmark",$referer)) {
  29.     } else {
  30.     $result = $db->sql_query("INSERT INTO ".$prefix."_referer VALUES (NULL, '$referer')");
  31.     }
  32.     $numrows = $db->sql_numrows($db->sql_query("SELECT * FROM ".$prefix."_referer"));
  33.     if($numrows>=$httprefmax) {
  34.     $result2 = $db->sql_query("DELETE FROM ".$prefix."_referer");
  35.     }
  36. }
  37. if (!isset($mop)) { $mop="modload"; }
  38. if (!isset($mod_file)) { $mod_file="index"; }
  39. $name = trim($name);
  40. $file = trim($file);
  41. $mod_file = trim($mod_file);
  42. $mop = trim($mop);
  43. if (ereg("\.\.",$name) || ereg("\.\.",$file) || ereg("\.\.",$mod_file) || ereg("\.\.",$mop)) {
  44.     echo "You are so cool...";
  45. } else {
  46.     $ThemeSel = get_theme();
  47.     if (file_exists("themes/$ThemeSel/module.php")) {
  48.     include("themes/$ThemeSel/module.php");
  49.     if (is_active("$default_module") AND file_exists("modules/$default_module/".$mod_file.".php")) {
  50.         $name = $default_module;
  51.     }
  52.     }
  53.     if (file_exists("themes/$ThemeSel/modules/$name/".$mod_file.".php")) {
  54.     $modpath = "themes/$ThemeSel/";
  55.     }
  56.     $modpath .= "modules/$name/".$mod_file.".php";
  57.     if (file_exists($modpath)) {
  58.     include($modpath);
  59.     } else {
  60.     $index = 1;
  61.     include("header.php");
  62.     OpenTable();
  63.     if (is_admin($admin)) {
  64.         echo "<center><font class=\"\"><b>"._HOMEPROBLEM."</b></font><br><br>[ <a href=\"admin.php?op=modules\">"._ADDAHOME."</a> ]</center>";
  65.     } else {
  66.         echo "<center>"._HOMEPROBLEMUSER."</center>";
  67.     }
  68.     CloseTable();
  69.     include("footer.php");
  70.     }
  71. }
  72.  
  73. ?>