[ Index ]

PHP Cross Reference of Nuke-Evolution v2.0.5

title

Body

[close]

/ -> header.php (source)

   1  <?php
   2  /*=======================================================================
   3   Nuke-Evolution Basic: Enhanced PHP-Nuke Web Portal System
   4   =======================================================================*/
   5  
   6  /************************************************************************/
   7  /* PHP-NUKE: Advanced Content Management System                         */
   8  /* ============================================                         */
   9  /*                                                                      */
  10  /* Copyright (c) 2002 by Francisco Burzi                                */
  11  /* http://phpnuke.org                                                   */
  12  /*                                                                      */
  13  /* This program is free software. You can redistribute it and/or modify */
  14  /* it under the terms of the GNU General Public License as published by */
  15  /* the Free Software Foundation; either version 2 of the License.       */
  16  /************************************************************************/
  17  
  18  /*****[CHANGES]**********************************************************
  19  -=[Base]=-
  20        NukeSentinel                             v2.5.00      07/11/2006
  21        Nuke Patched                             v3.1.0       06/26/2005
  22        Advanced Security Extension              v1.0.0       12/22/2005
  23  -=[Other]=-
  24        Dynamic Titles                           v1.0.0       06/11/2005
  25  -=[Mod]=-
  26        Collapsing Blocks                        v1.0.0       08/16/2005
  27   ************************************************************************/
  28  
  29  if(!defined('HEADER')) {
  30      define('HEADER', true);
  31  } else {
  32      return;
  33  }
  34  
  35  if (realpath(__FILE__) == realpath($_SERVER['SCRIPT_FILENAME'])) {
  36      exit('Access Denied');
  37  }
  38  
  39  require_once(dirname(__FILE__).'/mainfile.php');
  40  
  41  function head() {
  42      global $sitename, $ab_config, $modheader, $cache;
  43      $ThemeSel = get_theme();
  44      include_once(NUKE_THEMES_DIR.$ThemeSel.'/theme.php');
  45      echo "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">\n";
  46      echo "<html lang=\""._LANGCODE."\" dir=\""._LANG_DIRECTION."\">\n";
  47      echo "<head>\n";
  48  /*****[BEGIN]******************************************
  49   [ Base:    Dynamic Titles                     v1.0.0 ]
  50   ******************************************************/
  51      include_once(NUKE_INCLUDE_DIR.'dynamic_titles.php');
  52  /*****[END]********************************************
  53   [ Base:    Dynamic Titles                     v1.0.0 ]
  54   ******************************************************/
  55      include_once(NUKE_INCLUDE_DIR.'meta.php');
  56      include_once(NUKE_INCLUDE_DIR.'javascript.php');
  57  
  58      if ((($favicon = $cache->load('favicon', 'config')) === false) || empty($favicon)) {
  59          if (file_exists(NUKE_BASE_DIR.'favicon.ico')) {
  60              $favicon = "themes/$ThemeSel/images/favicon.ico";
  61          } else if (file_exists(NUKE_IMAGES_DIR.'favicon.ico')) {
  62              $favicon = "images/favicon.ico";
  63          } else if (file_exists(NUKE_THEMES_DIR.$ThemeSel.'/images/favicon.ico')) {
  64              $favicon = "favicon.ico";
  65          } else {
  66              $favicon = 'none';
  67          }
  68          if ($favicon != 'none') {
  69              echo "<link rel=\"shortcut icon\" href=\"$favicon\" type=\"image/x-icon\">\n";
  70          }
  71          $cache->save('favicon', 'config', $favicon);
  72      } else {
  73          if ($favicon != 'none') {
  74              echo "<link rel=\"shortcut icon\" href=\"$favicon\" type=\"image/x-icon\">\n";
  75          }
  76      }
  77  
  78      // If you use ForumNews Advance, you may want to replace the RSS News with the RSS ForumNews. Just remove the comments below and comment out the RSS News.
  79      //echo "<link rel=\"alternate\" type=\"application/rss+xml\" title=\"RSS $sitename &raquo; ForumNews\" href=\"rss.php?feed=forumnews\">\n";
  80      echo "<link rel=\"alternate\" type=\"application/rss+xml\" title=\"RSS $sitename &raquo; News\" href=\"rss.php?feed=news\">\n";
  81      echo "<link rel=\"alternate\" type=\"application/rss+xml\" title=\"RSS $sitename &raquo; Forums\" href=\"rss.php?feed=forums\">\n";
  82      echo "<link rel=\"alternate\" type=\"application/rss+xml\" title=\"RSS $sitename &raquo; Downloads\" href=\"rss.php?feed=downloads\">\n";
  83      echo "<link rel=\"alternate\" type=\"application/rss+xml\" title=\"RSS $sitename &raquo; Web Links\" href=\"rss.php?feed=weblinks\">\n";
  84  
  85      global $browser;
  86      $style = "<link rel=\"stylesheet\" href=\"themes/$ThemeSel/style/style.css\" type=\"text/css\">\n";
  87      if ($browser == 'ie' || $browser == 'konqueror' || $browser == 'MSIE') {
  88          if (file_exists('themes/'.$ThemeSel.'/style/style_ie.css')) {
  89              $style = "<link rel=\"stylesheet\" href=\"themes/$ThemeSel/style/style_ie.css\" type=\"text/css\">\n";
  90          }
  91      } else if ($browser == 'Mozilla' || $browser == 'Firefox' || $browser == 'Gecko' || $browser == 'Netscape') {
  92          if (file_exists('themes/'.$ThemeSel.'/style/style_moazilla.css')) {
  93              $style = "<link rel=\"stylesheet\" href=\"themes/$ThemeSel/style/style_mozilla.css\" type=\"text/css\">\n";
  94          }
  95      } else if ($browser == 'Opera') {
  96          if (file_exists('themes/'.$ThemeSel.'/style/style_opera.css')) {
  97              $style = "<link rel=\"stylesheet\" href=\"themes/$ThemeSel/style/style_opera.css\" type=\"text/css\">\n";
  98          }
  99      }
 100  
 101      echo $style;
 102  
 103      if(isset($modheader)) {
 104          echo $modheader;
 105      }
 106      if ((($custom_head = $cache->load('custom_head', 'config')) === false) || empty($custom_head)) {
 107          $custom_head = array();
 108          if (file_exists(NUKE_INCLUDE_DIR.'custom_files/custom_head.php')) {
 109              $custom_head[] = 'custom_head';
 110          }
 111          if (file_exists(NUKE_INCLUDE_DIR.'custom_files/custom_header.php')) {
 112              $custom_head[] = 'custom_header';
 113          }
 114          if (!empty($custom_head)) {
 115              foreach ($custom_head as $file) {
 116                  include_once(NUKE_INCLUDE_DIR.'custom_files/'.$file.'.php');
 117              }
 118          }
 119          $cache->save('custom_head', 'config', $custom_head);
 120      } else {
 121          if (!empty($custom_head)) {
 122              foreach ($custom_head as $file) {
 123                  include_once(NUKE_INCLUDE_DIR.'custom_files/'.$file.'.php');
 124              }
 125          }
 126      }
 127      echo "</head>\n";
 128  /*****[BEGIN]******************************************
 129   [ Base:    NukeSentinel                      v2.5.00 ]
 130   ******************************************************/
 131      if($ab_config['site_switch'] == 1) {
 132          echo '<center><img src="images/nukesentinel/disabled.png" alt="'._AB_SITEDISABLED.'" title="'._AB_SITEDISABLED.'" border="0" /></center><br />';
 133      }
 134  /*****[END]********************************************
 135   [ Base:    NukeSentinel                      v2.5.00 ]
 136   ******************************************************/
 137      themeheader();
 138  }
 139  
 140  function online() {
 141      global $prefix, $db, $name, $board_config, $userinfo;
 142      $ip = identify::get_ip();
 143      $url = (defined('ADMIN_FILE')) ? 'index.php' : Fix_Quotes($_SERVER['REQUEST_URI']);
 144      $uname = $ip;
 145      $guest = 1;
 146      $user_agent = identify::identify_agent();
 147      if (is_user()) {
 148          $uname = $userinfo['username'];
 149          $guest = 0;
 150  /*****[BEGIN]******************************************
 151   [ Base:    Advanced Security Extension        v1.0.0 ]
 152   ******************************************************/
 153      } elseif($user_agent['engine'] == 'bot') {
 154          $uname = $user_agent['bot'];
 155          $guest = 3;
 156      }
 157  /*****[END]********************************************
 158   [ Base:    Advanced Security Extension        v1.0.0 ]
 159   ******************************************************/
 160      $custom_title = $name;
 161      $url = str_replace("&amp;", "&", $url);
 162      $past = time()-$board_config['online_time'];
 163      $db->sql_query('DELETE FROM '.$prefix.'_session WHERE time < "'.$past.'"');
 164      $ctime = time();
 165      list($count) = $db->sql_ufetchrow("SELECT COUNT(*) FROM ".$prefix."_session WHERE uname='$uname'");
 166      if ($count >= 1) {
 167         $result = $db->sql_query('UPDATE '.$prefix.'_session SET uname="'.$uname.'", time="'.$ctime.'", host_addr="'.$ip.'", guest="'.$guest.'", module="'.$custom_title.'", url="'.$url.'" WHERE uname="'.$uname.'"');
 168         $db->sql_freeresult($result);
 169      } else {
 170         $db->sql_query('INSERT INTO '.$prefix.'_session (uname, time, starttime, host_addr, guest, module, url) VALUES ("'.$uname.'", "'.$ctime.'", "'.$ctime.'", "'.$ip.'", "'.$guest.'","'.$custom_title.'", "'.$url.'")');
 171      }
 172  }
 173  
 174  online();
 175  head();
 176  
 177  if(!defined('ADMIN_FILE')) {
 178      include_once(NUKE_INCLUDE_DIR.'counter.php');
 179      if(defined('HOME_FILE')) {
 180          include_once(NUKE_INCLUDE_DIR.'messagebox.php');
 181          blocks('Center');
 182  
 183      }
 184  }
 185  
 186  ?>


Generated: Wed Jun 6 11:38:01 2007 Cross-referenced by PHPXref 0.7