[ PHPXref.com ] [ Generated: Sun Jul 20 17:32:17 2008 ] [ eNdonesia 8.3 ]
[ Index ]     [ Variables ]     [ Functions ]     [ Classes ]     [ Constants ]     [ Statistics ]

title

Body

[close]

/ -> header.php (source)

   1  <?php
   2  /**

   3   * This file creates the "header" of the web page dependent on the 

   4   * theme being used by the user. If the user is not logged in, the 

   5   * default theme header is used.

   6   */
   7  
   8  include ("config.php");
   9  
  10  /**

  11   * Controls cacheing limits of browsers

  12   */
  13  CacheControl();
  14  
  15  echo "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"DTD/xhtml1-transitional.dtd\">
  16  <html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\">";
  17  
  18  function head()
  19  {
  20  include  ("config.php");
  21  global $menu, $user,  $theme, $cookie, $admintest;
  22  global $mod, $artid, $did, $cid, $id, $topicid, $pustid, $page_id;
  23  
  24      #### Display titletag

  25  
  26      if($mod) {
  27          $res = mysql_query("SELECT about FROM modules WHERE plug_dir='$mod'");
  28          $row = mysql_fetch_assoc($res);
  29          if($row) 
  30          {
  31              $portal = $row["about"];
  32          } else {
  33              $portal = $sitename;
  34          }
  35      } else {
  36          $portal = $sitename;
  37          $titletag = $portal_motto;
  38      }
  39  
  40      if($mod == 'publisher' && $cid)
  41      {
  42          $res = mysql_query("SELECT title FROM mod_publisher_categories WHERE cid='$cid'");
  43          $row = mysql_fetch_assoc($res);
  44          $titletag = $row["title"];
  45      }
  46  
  47      if($mod == 'publisher' && $artid)
  48      {
  49          $res = mysql_query("SELECT title FROM mod_publisher WHERE artid='$artid'");
  50          $row = mysql_fetch_assoc($res);
  51          $titletag = $row["title"];
  52      }
  53  
  54      if($mod == 'diskusi' && $cid)
  55      {
  56          $res = mysql_query("SELECT title FROM mod_diskusi_categories WHERE cid='$cid'");
  57          $row = mysql_fetch_assoc($res);
  58          $titletag = $row["title"];
  59      }
  60  
  61      if($mod == 'diskusi' && $did)
  62      {
  63          $res = mysql_query("SELECT title FROM mod_diskusi WHERE did='$did'");
  64          $row = mysql_fetch_assoc($res);
  65          $titletag = $row["title"];
  66      }
  67  
  68      if($mod == 'katalog' && $cid)
  69      {
  70          $kat = mysql_query("SELECT title FROM mod_katalog_categories WHERE cid='$cid'");
  71          $row = mysql_fetch_assoc($kat);
  72          $titletag = $row["title"];
  73      }
  74  
  75      if($mod == 'iklanbaris' && $cid)
  76      {
  77          $kat = mysql_query("SELECT title FROM mod_iklanbaris_categories WHERE cid='$cid'");
  78          $row = mysql_fetch_assoc($kat);
  79          $titletag = $row["title"];
  80      }
  81  
  82      if($mod == 'userpage' && $page_id)
  83      {
  84          $kat = mysql_query("SELECT menu_text FROM menu WHERE page_id='$page_id'");
  85          $row = mysql_fetch_assoc($kat);
  86          $titletag = $row["menu_text"];
  87      }
  88      ### End display title tag

  89  
  90  
  91      if(isset($user))
  92      {
  93          $user2 = base64_decode($user);
  94          $cookie = explode(":", $user2);
  95  
  96          if($cookie[5]=="") $cookie[5]="$default_theme";
  97          if(isset($theme)) $cookie[5]=$theme;
  98  
  99          // extra logic to override previous with $theme override var

 100  
 101            /**

 102             * theme.php of user theme.

 103             */
 104  
 105          $theme_exists = @fopen("themes/$cookie[5]/theme.php", "r");
 106          if($theme_exists)
 107              include("themes/$cookie[5]/theme.php");
 108          else
 109              include("themes/$default_theme/theme.php");
 110  
 111            /**

 112             * header.php of user theme.

 113             */
 114  
 115          $header_exists = @fopen("themes/$cookie[5]/header.php", "r");
 116          if($theme_exists && $header_exists)
 117              include("themes/$cookie[5]/header.php");
 118          else
 119              include("themes/$default_theme/header.php");
 120  
 121      } else {
 122  
 123          /**

 124          * theme.php of default theme.

 125          */
 126  
 127          include("themes/$default_theme/theme.php");
 128  
 129          /**

 130          * header.php of default theme.

 131          */
 132  
 133          include("themes/$default_theme/header.php");
 134      }
 135  }
 136  
 137  head();
 138  
 139  include ("counter.php");
 140  
 141  ?>


[ Powered by PHPXref - Served by Debian GNU/Linux ]