Location: PHPKode > projects > ProNuke. Postnuke To Oracle > postnuke/html/header.php
<?php
// File: $Id: header.php,v 1.47 2001/12/04 01:12:43 gregorrothfuss Exp $ $Name:  $
// ----------------------------------------------------------------------
// POST-NUKE Content Management System
// Copyright (C) 2001 by the Post-Nuke Development Team.
// http://www.postnuke.com/
// ----------------------------------------------------------------------
// Based on:
// PHP-NUKE Web Portal System - http://phpnuke.org/
// Thatware - http://thatware.org/
// ----------------------------------------------------------------------
// LICENSE
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License (GPL)
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// To read the license please visit http://www.gnu.org/copyleft/gpl.html
// ----------------------------------------------------------------------
// Original Author of file: Francisco Burzi
// Purpose of file:
// ----------------------------------------------------------------------

global $PHP_SELF;
if (eregi("header.php", $PHP_SELF)) {
    die ("You can't access this file directly...");
}

##################################################
# Include some common header for HTML generation #
##################################################

$header = 1;

function head($themeOverrideCategory = "", $themeOverrideStory = "") {
    global $index;

    if (!isset($index)) {
        include(WHERE_IS_PERSO."config.php");
    } else {
        global $slogan, $sitename, $banners, $Default_Theme, $userimg, $nukeurl, $Version_Num;
    }
    global
        $artpage,
        $topic,
        $hlpfile,
        $user,
        $hr,
        $theme,
        $cookie,
        $bgcolor1,
        $bgcolor2,
        $bgcolor3,
        $bgcolor4,
        $bgcolor5,
        $textcolor1,
        $textcolor2,
        $textcolor3,
        $textcolor4,
        $forumpage,
        $thename,
        $postnuke_theme,
        $pntheme,
        $themename,
        $themeimages,
        $additional_header
    ;
        $cWhereIsPerso = WHERE_IS_PERSO;
        if ( !(empty($cWhereIsPerso)) )
                { include("modules/NS-Multisites/head.inc.php"); }
        else
                {

    if (is_user($user))
    {
        $user2 = base64_decode($user);
        $cookie = explode(':', $user2);
        if ($cookie[9]=='')
        {
            $cookie[9]=$Default_Theme;
        }
        if (isset ($theme))
        {
            $cookie[9]=$theme;
        }
        if (!$file=@opendir("themes/$cookie[9]"))
        {
            $ThemeSel = $Default_Theme;
        } else {
            $ThemeSel = $cookie[9];
        }
    } else {
        $ThemeSel = $Default_Theme;
    }
    // override the theme per category or story
    // precedence is story over category override
    if (($themeOverrideCategory != '') && (file_exists("themes/$themeOverrideCategory"))) {
        $ThemeSel = $themeOverrideCategory;
    }
    if (($themeOverrideStory != '') && (file_exists("themes/$themeOverrideStory"))) {
        $ThemeSel = $themeOverrideStory;
    }

    // added by sgk on Oct. 20, 2001
    // This allows automatic fallback to Default_Theme and "PostNuke"
    // when a user choise of theme (saved in cookie) disapears.
    if (!file_exists("themes/$ThemeSel/theme.php")) {
        global $Default_Theme;
        $ThemeSel = $Default_Theme;
        if (!file_exists("themes/$ThemeSel/theme.php"))
            $ThemeSel = "PostNuke";
        // This requires the theme "PostNuke" always exists.
        // Future version may seek for available themes by opening the
        // theme directory.
    }

    include "themes/$ThemeSel/theme.php";
    // support for older themes, non-PostNuke themes and older code in general
    // new theme
    if (isset ($pntheme))
    {
        $bgcolor1 = $pntheme['table_background1'];
        $bgcolor2 = $pntheme['table_background2'];
        $bgcolor3 = $pntheme['table_background3'];
        $bgcolor4 = $pntheme['table_header'];
        $textcolor1 = $pntheme['table_background1_text'];
        $textcolor2 = $pntheme['table_header_text'];
    } else { // old theme
        $pntheme['background_color'] = $bgcolor1;
        $pntheme['text_color'] = $textcolor2;
        $pntheme['table_background1'] = $bgcolor1;
        $pntheme['table_background1_text'] = $textcolor2;
        $pntheme['table_background2'] = $bgcolor3;
        $pntheme['table_background2_text'] = $textcolor2;
        $pntheme['table_border'] = $bgcolor2;
        $pntheme['table_header'] = $bgcolor4;
        $pntheme['table_header_text'] = $textcolor1;
    }

/* modif sebastien multi sites */
        }
/* fin modif sebastien multi sites */

    include(WHERE_IS_PERSO."config.php");
    echo "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">\n";
    echo "<html>\n<head>\n";

    if (defined("_CHARSET") && _CHARSET != "") {
        echo "<META HTTP-EQUIV=\"Content-Type\" ".
            "CONTENT=\"text/html; charset="._CHARSET."\">\n";
    }

    if ($artpage==1) {
    /* article page output */
        global $info, $hometext;
        echo "<title>$info[title] :: $sitename :: $slogan</title>\n";
        if ($dyn_keywords==1) {
           $htmlless = check_html($info[maintext], $strip ='nohtml');
           $symbolLess = trim(ereg_replace('("|\?|!|:|\.|\(|\)|;|\\\\)+', ' ', $htmlless));
           $keywords = ereg_replace('( |'.CHR(10).'|'.CHR(13).')+', ',', $symbolLess);
           $metatags = ereg_replace(",+", ",",$keywords);
           echo "<META HTTP-EQUIV=\"Keywords\" CONTENT=\"$metatags\">\n";
        } else {
           echo "<META NAME=\"KEYWORDS\" CONTENT=\"$metakeywords\">\n";
        }
    } else {
    /* all other page output */
        echo "<title>$sitename :: $slogan</title>\n";
        echo "<META NAME=\"KEYWORDS\" CONTENT=\"$metakeywords\">\n";
    }
    echo "<META NAME=\"DESCRIPTION\" CONTENT=\"$slogan\">\n";
    echo "<META NAME=\"ROBOTS\" CONTENT=\"INDEX,FOLLOW\">\n";
    echo "<META NAME=\"resource-type\" CONTENT=\"document\">\n";
    echo "<META HTTP-EQUIV=\"expires\" CONTENT=\"0\">\n";
    echo "<META NAME=\"AUTHOR\" CONTENT=\"$sitename\">\n";
    echo "<META NAME=\"COPYRIGHT\" CONTENT=\"Copyright (c) 2001 by $sitename\">\n";
    echo "<META NAME=\"revisit-after\" content=\"1 days\">\n";
    echo "<META NAME=\"distribution\" content=\"Global\">\n";
    echo "<META NAME=\"GENERATOR\" CONTENT=\"Post-Nuke $Version_Num - http://postnuke.com\">\n\n\n";
    echo "<META NAME=\"rating\" content=\"General\">\n";
    global $themesarein;
    echo "<LINK REL=\"StyleSheet\" HREF=\"".$themesarein."themes/$ThemeSel/style/styleNN.css\" TYPE=\"text/css\">\n\n\n";
    echo "<style type=\"text/css\">";
    echo "@import url(\"".$themesarein."themes/$ThemeSel/style/style.css\"); ";

    echo "</style>";

    echo "<SCRIPT type=\"text/javascript\" SRC=\"javascript/showimages.php\"></SCRIPT>\n\n";
    if ($forumpage == 1)
    {
      echo "<SCRIPT type=\"text/javascript\" SRC=\"javascript/bbcode.php\"></SCRIPT>\n\n";
    }
    echo "<SCRIPT type=\"text/javascript\" SRC=\"javascript/openwindow.php?hlpfile=$hlpfile\"></SCRIPT>\n\n";

    if (isset($additional_header)) {
        echo @implode("\n", $additional_header);
    }

    themeheader();
}

// if you want to do overrides, set the global vars $themeOverrideCategory
// and/or $themeOverrideStory before including header.php
//      global variables - argh!
global $themeOverrideCategory, $themeOverrideStory;
head($themeOverrideCategory, $themeOverrideStory);
?>
Return current item: ProNuke. Postnuke To Oracle