home *** CD-ROM | disk | FTP | other *** search
/ PC World 2001 March / PCWorld_2001-03_cd.bin / KOMUNIK / progweb / progweb.exe / phpnuke / html / header.php < prev    next >
PHP Script  |  2000-12-05  |  4KB  |  106 lines

  1. <?php
  2.  
  3. ######################################################################
  4. # PHP-NUKE: Web Portal System
  5. # ===========================
  6. #
  7. # Copyright (c) 2000 by Francisco Burzi (fburzi@ncc.org.ve)
  8. # http://phpnuke.org
  9. #
  10. # This modules is to be included in the head for each page
  11. #
  12. # This program is free software. You can redistribute it and/or modify
  13. # it under the terms of the GNU General Public License as published by
  14. # the Free Software Foundation; either version 2 of the License.
  15. ######################################################################
  16.  
  17. ##################################################
  18. # Include some common header for HTML generation #
  19. ##################################################
  20.  
  21. function head() {
  22.     global $index, $hlpfile;
  23.     if (!isset($index)) {
  24.     include("config.php");
  25.     global $artpage, $topic;
  26.     } else {
  27.     global $site_font, $sitename, $artpage, $topic, $banners, $Default_Theme, $uimages;
  28.     }
  29.     global $user, $hr, $theme, $cookie, $bgcolor1, $bgcolor2, $bgcolor3, $textcolor1, $textcolor2;
  30.     echo "<html>\n<head>\n";
  31.     echo "<style type=\"text/css\">\n";
  32.     echo "<!--\n";
  33.     $browser = getenv("HTTP_USER_AGENT");
  34.     if (ereg("MSIE", "$browser")) {
  35.     echo ".textbox { background: transparent; background-color: White; border: 1px solid #000000; color: #000000; font-family: $site_font; font-size: x-small; text-align: left; scrollbar-face-color: #CCCCCC; scrollbar-shadow-color: #FFFFFF; scrollbar-highlight-color: #FFFFFF; scrollbar-3dlight-color: #FFFFFF; scrollbar-darkshadow-color: #FFFFFF; scrollbar-track-color: #FFFFFF; scrollbar-arrow-color: #000000 }\n";
  36.     } else {
  37.     echo ".textbox { background: transparent; background-color: White; color: #000000; font-family: $site_font; font-size: x-small; text-align: left; scrollbar-face-color: #CCCCCC; scrollbar-shadow-color: #FFFFFF; scrollbar-highlight-color: #FFFFFF; scrollbar-3dlight-color: #FFFFFF; scrollbar-darkshadow-color: #FFFFFF; scrollbar-track-color: #FFFFFF; scrollbar-arrow-color: #000000 }\n";
  38.     }
  39.     echo "TD {font-size: 10pt; font-family: $site_font}\n";
  40.     echo "BODY {font-size: 10pt; font-family: $site_font}\n";
  41.     echo "-->\n</style>\n";
  42.     echo "<title>$sitename</title>\n";
  43. //    if ($admin) {
  44.     echo "<script language=\"javascript\">\n";
  45.     echo "<!--\n\n";
  46.     echo "function openwindow(){\n";
  47.     echo "    window.open (\"$hlpfile\",\"Help\",\"toolbar=no,location=no,directories=no,status=no,scrollbars=yes,resizable=no,copyhistory=no,width=600,height=400\");\n";
  48.     echo "}\n\n";
  49.     echo "//-->\n";
  50.     echo "</script>\n";
  51. //    }
  52.     if ($artpage==1) {
  53.     echo "<script language=\"javascript\" src=\"dhtmllib.js\"></script>\n";
  54.     echo "<script language=\"javascript\" src=\"scroller.js\"></script>\n";
  55.     echo "<script language=\"javascript\">\n\n";
  56.     echo "var myScroller1 = new Scroller(0, 0, 180, 42, 1, 0);\n";
  57.     echo "myScroller1.setColors(\"#000000\", \"#FFFFFF\", \"#000000\");\n";
  58.     echo "myScroller1.setFont(\"$site_font\", 1);\n";
  59.     $result=mysql_query("select sid, title from stories where topic=$topic order by sid DESC limit 0,20");
  60.     while(list($sid1, $title1) = mysql_fetch_row($result)) {
  61.         $title1 = ereg_replace("\"", "\\\"", $title1);
  62.         echo "myScroller1.addItem(\"<center><a href=article.php?sid=$sid1>$title1</a></center>\");\n";
  63.     }
  64.     echo "\n";
  65.     echo "function init() {\n\n";
  66.     echo "var img;\n";
  67.     echo "var x, y;\n";
  68.     echo "img = getImage(\"placeholder\");\n";
  69.     echo "x = getImagePageLeft(img);\n";
  70.     echo "y = getImagePageTop(img);\n";
  71.     echo "myScroller1.create();\n";
  72.     echo "myScroller1.hide();\n";
  73.     echo "myScroller1.moveTo(x, y);\n";
  74.     echo "myScroller1.setzIndex(100);\n";
  75.     echo "myScroller1.show();\n\n";
  76.     echo "}\n";
  77.     echo "</script>";
  78.     } else {
  79.     echo "<script language=\"javascript\">\n\n";
  80.     echo "function init() {\n\n";
  81.     echo "}\n";
  82.     echo "</script>\n";
  83.     }
  84.     echo "</head>\n\n";
  85.     if ($banners) {
  86.     include("banners.php");
  87. }
  88.     if(isset($user)) {
  89.         $user2 = base64_decode($user);
  90.         $cookie = explode(":", $user2);
  91.         if($cookie[9]=="") $cookie[9]=$Default_Theme;
  92.         if(isset($theme)) $cookie[9]=$theme;
  93.         // extra logic to override previous with $theme override var
  94.         include("themes/$cookie[9]/theme.php");
  95.         include("themes/$cookie[9]/header.php");
  96.     } else {
  97.         include("themes/$Default_Theme/theme.php");
  98.         include("themes/$Default_Theme/header.php");
  99.     }
  100. }
  101.  
  102.  
  103. head();
  104. include("counter.php");
  105.  
  106. ?>