home *** CD-ROM | disk | FTP | other *** search
/ PC World 2005 April / PCWorld_2005-04_cd.bin / akce / web / unitednuke / unitednuke.exe / html / includes / page_header.php < prev    next >
PHP Script  |  2004-01-10  |  22KB  |  536 lines

  1. <?php
  2. /***************************************************************************
  3.  *                              page_header.php
  4.  *                            -------------------
  5.  *   begin                : Saturday, Feb 13, 2001
  6.  *   copyright            : (C) 2001 The phpBB Group
  7.  *   email                : support@phpbb.com
  8.  *
  9.  *   $Id: page_header.php,v 1.106.2.20 2003/06/10 20:48:19 acydburn Exp $
  10.  *
  11.  *
  12.  ***************************************************************************/
  13. /***************************************************************************
  14. * phpbb2 forums port version 2.0.5 (c) 2003 - Nuke Cops (http://nukecops.com)
  15. *
  16. * Ported by Nuke Cops to phpbb2 standalone 2.0.5 Test
  17. * and debugging completed by the Elite Nukers and site members.
  18. *
  19. * You run this package at your sole risk. Nuke Cops and affiliates cannot
  20. * be held liable if anything goes wrong. You are advised to test this
  21. * package on a development system. Backup everything before implementing
  22. * in a production environment. If something goes wrong, you can always
  23. * backout and restore your backups.
  24. *
  25. * Installing and running this also means you agree to the terms of the AUP
  26. * found at Nuke Cops.
  27. *
  28. * This is version 2.0.5 of the phpbb2 forum port for PHP-Nuke. Work is based
  29. * on Tom Nitzschner's forum port version 2.0.6. Tom's 2.0.6 port was based
  30. * on the phpbb2 standalone version 2.0.3. Our version 2.0.5 from Nuke Cops is
  31. * now reflecting phpbb2 standalone 2.0.5 that fixes some bugs and the
  32. * invalid_session error message.
  33. ***************************************************************************/
  34. /***************************************************************************
  35.  *   This file is part of the phpBB2 port to Nuke 6.0 (c) copyright 2002
  36.  *   by Tom Nitzschner (tom@toms-home.com)
  37.  *   http://bbtonuke.sourceforge.net (or http://www.toms-home.com)
  38.  *
  39.  *   As always, make a backup before messing with anything. All code
  40.  *   release by me is considered sample code only. It may be fully
  41.  *   functual, but you use it at your own risk, if you break it,
  42.  *   you get to fix it too. No waranty is given or implied.
  43.  *
  44.  *   Please post all questions/request about this port on http://bbtonuke.sourceforge.net first,
  45.  *   then on my site. All original header code and copyright messages will be maintained
  46.  *   to give credit where credit is due. If you modify this, the only requirement is
  47.  *   that you also maintain all original copyright messages. All my work is released
  48.  *   under the GNU GENERAL PUBLIC LICENSE. Please see the README for more information.
  49.  *
  50.  ***************************************************************************/
  51. /***************************************************************************
  52.  *
  53.  *   This program is free software; you can redistribute it and/or modify
  54.  *   it under the terms of the GNU General Public License as published by
  55.  *   the Free Software Foundation; either version 2 of the License, or
  56.  *   (at your option) any later version.
  57.  *
  58.  ***************************************************************************/
  59.  
  60. if ( !defined('IN_PHPBB') )
  61. {
  62.    die("Hacking attempt");
  63. }
  64. define('HEADER_INC', TRUE);
  65.  
  66. global $name, $sitename, $is_inline_review, $prefix;
  67.  
  68. $sql = "SELECT custom_title from ".$prefix."_modules where title='$name'";
  69. $result = $db->sql_query($sql);
  70. $row = $db->sql_fetchrow($result);
  71. if ($row[custom_title] == "") {
  72.     $mod_name = ereg_replace("_", " ", $name);
  73. } else {
  74.     $mod_name = $row[custom_title];
  75. }
  76. if (!$is_inline_review & $mod_name != "Private Messages") {
  77.     title("$sitename: $mod_name");
  78. }
  79.     OpenTable();
  80. define('HEADER_INC', TRUE);
  81.  
  82. //
  83. // gzip_compression
  84. //
  85. $do_gzip_compress = FALSE;
  86. if ( $board_config['gzip_compress'] )
  87. {
  88.         $phpver = phpversion();
  89.  
  90.         $useragent = (isset($_SERVER["HTTP_USER_AGENT"]) ) ? $_SERVER["HTTP_USER_AGENT"] : $HTTP_USER_AGENT;
  91.  
  92.         if ( $phpver >= '4.0.4pl1' && ( strstr($useragent,'compatible') || strstr($useragent,'Gecko') ) )
  93.         {
  94.                 if ( extension_loaded('zlib') )
  95.                 {
  96.                         ob_start('ob_gzhandler');
  97.                 }
  98.         }
  99.         else if ( $phpver > '4.0' )
  100.         {
  101.                 if ( strstr($HTTP_SERVER_VARS['HTTP_ACCEPT_ENCODING'], 'gzip') )
  102.                 {
  103.                         if ( extension_loaded('zlib') )
  104.                         {
  105.                                 $do_gzip_compress = TRUE;
  106.                                 ob_start();
  107.                                 ob_implicit_flush(0);
  108.  
  109.                                 header('Content-Encoding: gzip');
  110.                         }
  111.                 }
  112.         }
  113. }
  114.  
  115. //
  116. // Parse and show the overall header.
  117. //
  118. $template->set_filenames(array(
  119.         'overall_header' => ( empty($gen_simple_header) ) ? 'overall_header.tpl' : 'simple_header.tpl')
  120. );
  121.  
  122. //
  123. // Generate logged in/logged out status
  124. //
  125. if ( $userdata['session_logged_in'] )
  126. {
  127.         $u_login_logout = 'modules.php?name=Your_Account&op=logout&redirect=Forums';
  128.         $l_login_logout = $lang['Logout'] . ' [ ' . $userdata['username'] . ' ]';
  129. }
  130. else
  131. {
  132.         $u_login_logout = 'modules.php?name=Your_Account&redirect=index';
  133.         $l_login_logout = $lang['Login'];
  134. }
  135.  
  136. $s_last_visit = ( $userdata['session_logged_in'] ) ? create_date($board_config['default_dateformat'], $userdata['user_lastvisit'], $board_config['board_timezone']) : '';
  137.  
  138. //
  139. // Get basic (usernames + totals) online
  140. // situation
  141. //
  142. $logged_visible_online = 0;
  143. $logged_hidden_online = 0;
  144. $guests_online = 0;
  145. $online_userlist = '';
  146.  
  147. if (defined('SHOW_ONLINE'))
  148. {
  149.  
  150.         $user_forum_sql = ( !empty($forum_id) ) ? "AND s.session_page = " . intval($forum_id) : '';
  151.         $sql = "SELECT u.username, u.user_id, u.user_allow_viewonline, u.user_level, s.session_logged_in, s.session_ip
  152.                 FROM ".USERS_TABLE." u, ".SESSIONS_TABLE." s
  153.                 WHERE u.user_id = s.session_user_id
  154.                         AND s.session_time >= ".( time() - 300 ) . "
  155.                         $user_forum_sql
  156.                 ORDER BY u.username ASC, s.session_ip ASC";
  157.         if( !($result = $db->sql_query($sql)) )
  158.         {
  159.                 message_die(GENERAL_ERROR, 'Could not obtain user/online information', '', __LINE__, __FILE__, $sql);
  160.         }
  161.  
  162.         $userlist_ary = array();
  163.         $userlist_visible = array();
  164.  
  165.         $prev_user_id = 0;
  166.         $prev_user_ip = '';
  167.  
  168.         while( $row = $db->sql_fetchrow($result) )
  169.         {
  170.                 // User is logged in and therefor not a guest
  171.                 if ( $row['session_logged_in'] )
  172.                 {
  173.                         // Skip multiple sessions for one user
  174.                         if ( $row['user_id'] != $prev_user_id )
  175.                         {
  176.                                 $style_color = '';
  177.                                 if ( $row['user_level'] == ADMIN )
  178.                                 {
  179.                                         $row['username'] = '<b>' . $row['username'] . '</b>';
  180.                                         $style_color = 'style="color:#' . $theme['fontcolor3'] . '"';
  181.                                 }
  182.                                 else if ( $row['user_level'] == MOD )
  183.                                 {
  184.                                         $row['username'] = '<b>' . $row['username'] . '</b>';
  185.                                         $style_color = 'style="color:#' . $theme['fontcolor2'] . '"';
  186.                                 }
  187.  
  188.                                 if ( $row['user_allow_viewonline'] )
  189.                                 {
  190.                                         $user_online_link = '<a href="' . append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=" . $row['user_id']) . '"' . $style_color .'>' . $row['username'] . '</a>';
  191.                                         $logged_visible_online++;
  192.                                 }
  193.                                 else
  194.                                 {
  195.                                         $user_online_link = '<a href="' . append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=" . $row['user_id']) . '"' . $style_color .'><i>' . $row['username'] . '</i></a>';
  196.                                         $logged_hidden_online++;
  197.                                 }
  198.  
  199.                                 if ( $row['user_allow_viewonline'] || $userdata['user_level'] == ADMIN )
  200.                                 {
  201.                                         $online_userlist .= ( $online_userlist != '' ) ? ', ' . $user_online_link : $user_online_link;
  202.                                 }
  203.                         }
  204.  
  205.                         $prev_user_id = $row['user_id'];
  206.                 }
  207.                 else
  208.                 {
  209.                         // Skip multiple sessions for one user
  210.                         if ( $row['session_ip'] != $prev_session_ip )
  211.                         {
  212.                                 $guests_online++;
  213.                         }
  214.                 }
  215.  
  216.                 $prev_session_ip = $row['session_ip'];
  217.         }
  218.         $db->sql_freeresult($result);
  219.  
  220.         if ( empty($online_userlist) )
  221.         {
  222.                 $online_userlist = $lang['None'];
  223.         }
  224.         $online_userlist = ( ( isset($forum_id) ) ? $lang['Browsing_forum'] : $lang['Registered_users'] ) . ' ' . $online_userlist;
  225.  
  226.         $total_online_users = $logged_visible_online + $logged_hidden_online + $guests_online;
  227.  
  228.         if ( $total_online_users > $board_config['record_online_users'])
  229.         {
  230.                 $board_config['record_online_users'] = $total_online_users;
  231.                 $board_config['record_online_date'] = time();
  232.  
  233.                 $sql = "UPDATE " . CONFIG_TABLE . "
  234.                         SET config_value = '$total_online_users'
  235.                         WHERE config_name = 'record_online_users'";
  236.                 if ( !$db->sql_query($sql) )
  237.                 {
  238.                         message_die(GENERAL_ERROR, 'Could not update online user record (nr of users)', '', __LINE__, __FILE__, $sql);
  239.                 }
  240.  
  241.                 $sql = "UPDATE " . CONFIG_TABLE . "
  242.                         SET config_value = '" . $board_config['record_online_date'] . "'
  243.                         WHERE config_name = 'record_online_date'";
  244.                 if ( !$db->sql_query($sql) )
  245.                 {
  246.                         message_die(GENERAL_ERROR, 'Could not update online user record (date)', '', __LINE__, __FILE__, $sql);
  247.                 }
  248.         }
  249.  
  250.         if ( $total_online_users == 0 )
  251.         {
  252.                 $l_t_user_s = $lang['Online_users_zero_total'];
  253.         }
  254.         else if ( $total_online_users == 1 )
  255.         {
  256.                 $l_t_user_s = $lang['Online_user_total'];
  257.         }
  258.         else
  259.         {
  260.                 $l_t_user_s = $lang['Online_users_total'];
  261.         }
  262.  
  263.         if ( $logged_visible_online == 0 )
  264.         {
  265.                 $l_r_user_s = $lang['Reg_users_zero_total'];
  266.         }
  267.         else if ( $logged_visible_online == 1 )
  268.         {
  269.                 $l_r_user_s = $lang['Reg_user_total'];
  270.         }
  271.         else
  272.         {
  273.                 $l_r_user_s = $lang['Reg_users_total'];
  274.         }
  275.  
  276.         if ( $logged_hidden_online == 0 )
  277.         {
  278.                 $l_h_user_s = $lang['Hidden_users_zero_total'];
  279.         }
  280.         else if ( $logged_hidden_online == 1 )
  281.         {
  282.                 $l_h_user_s = $lang['Hidden_user_total'];
  283.         }
  284.         else
  285.         {
  286.                 $l_h_user_s = $lang['Hidden_users_total'];
  287.         }
  288.  
  289.         if ( $guests_online == 0 )
  290.         {
  291.                 $l_g_user_s = $lang['Guest_users_zero_total'];
  292.         }
  293.         else if ( $guests_online == 1 )
  294.         {
  295.                 $l_g_user_s = $lang['Guest_user_total'];
  296.         }
  297.         else
  298.         {
  299.                 $l_g_user_s = $lang['Guest_users_total'];
  300.         }
  301.  
  302.         $l_online_users = sprintf($l_t_user_s, $total_online_users);
  303.         $l_online_users .= sprintf($l_r_user_s, $logged_visible_online);
  304.         $l_online_users .= sprintf($l_h_user_s, $logged_hidden_online);
  305.         $l_online_users .= sprintf($l_g_user_s, $guests_online);
  306. }
  307.  
  308. //
  309. // Obtain number of new private messages
  310. // if user is logged in
  311. //
  312. if ( ($userdata['session_logged_in']) && (empty($gen_simple_header)) )
  313. {
  314.         if ( $userdata['user_new_privmsg'] )
  315.         {
  316.                 $l_message_new = ( $userdata['user_new_privmsg'] == 1 ) ? $lang['New_pm'] : $lang['New_pms'];
  317.                 $l_privmsgs_text = sprintf($l_message_new, $userdata['user_new_privmsg']);
  318.  
  319.                 if ( $userdata['user_last_privmsg'] > $userdata['user_lastvisit'] )
  320.                 {
  321.                         $sql = "UPDATE " . USERS_TABLE . "
  322.                                 SET user_last_privmsg = " . $userdata['user_lastvisit'] . "
  323.                                 WHERE user_id = " . $userdata['user_id'];
  324.                         if ( !$db->sql_query($sql) )
  325.                         {
  326.                                 message_die(GENERAL_ERROR, 'Could not update private message new/read time for user', '', __LINE__, __FILE__, $sql);
  327.                         }
  328.  
  329.                         $s_privmsg_new = 1;
  330.                         $icon_pm = $images['pm_new_msg'];
  331.                 }
  332.                 else
  333.                 {
  334.                         $s_privmsg_new = 0;
  335.                         $icon_pm = $images['pm_new_msg'];
  336.                 }
  337.         }
  338.         else
  339.         {
  340.                 $l_privmsgs_text = $lang['No_new_pm'];
  341.  
  342.                 $s_privmsg_new = 0;
  343.                 $icon_pm = $images['pm_no_new_msg'];
  344.         }
  345.  
  346.         if ( $userdata['user_unread_privmsg'] )
  347.         {
  348.                 $l_message_unread = ( $userdata['user_unread_privmsg'] == 1 ) ? $lang['Unread_pm'] : $lang['Unread_pms'];
  349.                 $l_privmsgs_text_unread = sprintf($l_message_unread, $userdata['user_unread_privmsg']);
  350.         }
  351.         else
  352.         {
  353.                 $l_privmsgs_text_unread = $lang['No_unread_pm'];
  354.         }
  355. }
  356. else
  357. {
  358.         $icon_pm = $images['pm_no_new_msg'];
  359.         $l_privmsgs_text = $lang['Login_check_pm'];
  360.         $l_privmsgs_text_unread = '';
  361.         $s_privmsg_new = 0;
  362. }
  363.  
  364. //
  365. // Generate HTML required for Mozilla Navigation bar
  366. //
  367. if (!isset($nav_links))
  368. {
  369.         $nav_links = array();
  370. }
  371.  
  372. $nav_links_html = '';
  373. $nav_link_proto = '<link rel="%s" href="%s" title="%s" />' . "\n";
  374. while( list($nav_item, $nav_array) = @each($nav_links) )
  375. {
  376.         if ( !empty($nav_array['url']) )
  377.         {
  378.                 $nav_links_html .= sprintf($nav_link_proto, $nav_item, append_sid($nav_array['url']), $nav_array['title']);
  379.         }
  380.         else
  381.         {
  382.                 // We have a nested array, used for items like <link rel='chapter'> that can occur more than once.
  383.                 while( list(,$nested_array) = each($nav_array) )
  384.                 {
  385.                         $nav_links_html .= sprintf($nav_link_proto, $nav_item, $nested_array['url'], $nested_array['title']);
  386.                 }
  387.         }
  388. }
  389.  
  390. // Format Timezone. We are unable to use array_pop here, because of PHP3 compatibility
  391. $l_timezone = explode('.', $board_config['board_timezone']);
  392. $l_timezone = (count($l_timezone) > 1 && $l_timezone[count($l_timezone)-1] != 0) ? $lang[sprintf('%.1f', $board_config['board_timezone'])] : $lang[number_format($board_config['board_timezone'])];
  393. //
  394. // The following assigns all _common_ variables that may be used at any point
  395. // in a template.
  396. //
  397. $template->assign_vars(array(
  398.         'SITENAME' => $board_config['sitename'],
  399.         'SITE_DESCRIPTION' => $board_config['site_desc'],
  400.         'PAGE_TITLE' => $page_title,
  401.         'LAST_VISIT_DATE' => sprintf($lang['You_last_visit'], $s_last_visit),
  402.         'CURRENT_TIME' => sprintf($lang['Current_time'], create_date($board_config['default_dateformat'], time(), $board_config['board_timezone'])),
  403.         'TOTAL_USERS_ONLINE' => $l_online_users,
  404.         'LOGGED_IN_USER_LIST' => $online_userlist,
  405.         'RECORD_USERS' => sprintf($lang['Record_online_users'], $board_config['record_online_users'], create_date($board_config['default_dateformat'], $board_config['record_online_date'], $board_config['board_timezone'])),
  406.         'PRIVATE_MESSAGE_INFO' => $l_privmsgs_text,
  407.         'PRIVATE_MESSAGE_INFO_UNREAD' => $l_privmsgs_text_unread,
  408.         'PRIVATE_MESSAGE_NEW_FLAG' => $s_privmsg_new,
  409.  
  410.         'PRIVMSG_IMG' => $icon_pm,
  411.  
  412.         'L_USERNAME' => $lang['Username'],
  413.         'L_PASSWORD' => $lang['Password'],
  414.         'L_LOGIN_LOGOUT' => $l_login_logout,
  415.         'L_LOGIN' => $lang['Login'],
  416.         'L_LOG_ME_IN' => $lang['Log_me_in'],
  417.         'L_AUTO_LOGIN' => $lang['Log_me_in'],
  418.         'L_INDEX' => sprintf($lang['Forum_Index'], $board_config['sitename']),
  419.         'L_REGISTER' => $lang['Register'],
  420.         'L_PROFILE' => $lang['Profile'],
  421.         'L_SEARCH' => $lang['Search'],
  422.         'L_PRIVATEMSGS' => $lang['Private_Messages'],
  423.         'L_WHO_IS_ONLINE' => $lang['Who_is_Online'],
  424.         'L_MEMBERLIST' => $lang['Memberlist'],
  425.         'L_FAQ' => $lang['FAQ'],
  426.         'L_USERGROUPS' => $lang['Usergroups'],
  427.         'L_SEARCH_NEW' => $lang['Search_new'],
  428.         'L_SEARCH_UNANSWERED' => $lang['Search_unanswered'],
  429.         'L_SEARCH_SELF' => $lang['Search_your_posts'],
  430.         'L_WHOSONLINE_ADMIN' => sprintf($lang['Admin_online_color'], '<span style="color:#' . $theme['fontcolor3'] . '">', '</span>'),
  431.         'L_WHOSONLINE_MOD' => sprintf($lang['Mod_online_color'], '<span style="color:#' . $theme['fontcolor2'] . '">', '</span>'),
  432.  
  433.         'U_SEARCH_UNANSWERED' => append_sid('search.'.$phpEx.'?search_id=unanswered'),
  434.         'U_SEARCH_SELF' => append_sid('search.'.$phpEx.'?search_id=egosearch'),
  435.         'U_SEARCH_NEW' => append_sid('search.'.$phpEx.'?search_id=newposts'),
  436.         'U_INDEX' => append_sid('index.'.$phpEx),
  437.         'U_REGISTER' => append_sid('profile.'.$phpEx.'?mode=register'),
  438.         'U_PROFILE' => append_sid('profile.'.$phpEx.'?mode=editprofile'),
  439.         'U_PRIVATEMSGS' => append_sid('privmsg.'.$phpEx.'?folder=inbox'),
  440.         'U_PRIVATEMSGS_POPUP' => append_sid('privmsg.'.$phpEx.'?mode=newpm&popup=1'),
  441.         'U_SEARCH' => append_sid('search.'.$phpEx),
  442.         'U_MEMBERLIST' => append_sid('memberlist.'.$phpEx),
  443.         'U_MODCP' => append_sid('modcp.'.$phpEx),
  444.         'U_FAQ' => append_sid('faq.'.$phpEx),
  445.         'U_VIEWONLINE' => append_sid('viewonline.'.$phpEx),
  446.         'U_LOGIN_LOGOUT' => append_sid($u_login_logout),
  447.         'U_MEMBERSLIST' => append_sid('memberlist.'.$phpEx),
  448.         'U_GROUP_CP' => append_sid('groupcp.'.$phpEx),
  449.  
  450.         'S_CONTENT_DIRECTION' => $lang['DIRECTION'],
  451.         'S_CONTENT_ENCODING' => $lang['ENCODING'],
  452.         'S_CONTENT_DIR_LEFT' => $lang['LEFT'],
  453.         'S_CONTENT_DIR_RIGHT' => $lang['RIGHT'],
  454.         'S_TIMEZONE' => sprintf($lang['All_times'], $l_timezone),
  455.         'S_LOGIN_ACTION' => append_sid('login.'.$phpEx),
  456.  
  457.         'T_HEAD_STYLESHEET' => $theme['head_stylesheet'],
  458.         /*
  459.         'T_BODY_BACKGROUND' => $theme['body_background'],
  460.         'T_BODY_BGCOLOR' => '#'.$theme['body_bgcolor'],
  461.         'T_BODY_TEXT' => '#'.$theme['body_text'],
  462.         'T_BODY_LINK' => '#'.$theme['body_link'],
  463.         'T_BODY_VLINK' => '#'.$theme['body_vlink'],
  464.         'T_BODY_ALINK' => '#'.$theme['body_alink'],
  465.         'T_BODY_HLINK' => '#'.$theme['body_hlink'],
  466.         */
  467.         'T_TR_COLOR1' => '#'.$theme['tr_color1'],
  468.         'T_TR_COLOR2' => '#'.$theme['tr_color2'],
  469.         'T_TR_COLOR3' => '#'.$theme['tr_color3'],
  470.         'T_TR_CLASS1' => $theme['tr_class1'],
  471.         'T_TR_CLASS2' => $theme['tr_class2'],
  472.         'T_TR_CLASS3' => $theme['tr_class3'],
  473.         'T_TH_COLOR1' => '#'.$theme['th_color1'],
  474.         'T_TH_COLOR2' => '#'.$theme['th_color2'],
  475.         'T_TH_COLOR3' => '#'.$theme['th_color3'],
  476.         'T_TH_CLASS1' => $theme['th_class1'],
  477.         'T_TH_CLASS2' => $theme['th_class2'],
  478.         'T_TH_CLASS3' => $theme['th_class3'],
  479.         'T_TD_COLOR1' => '#'.$theme['td_color1'],
  480.         'T_TD_COLOR2' => '#'.$theme['td_color2'],
  481.         'T_TD_COLOR3' => '#'.$theme['td_color3'],
  482.         'T_TD_CLASS1' => $theme['td_class1'],
  483.         'T_TD_CLASS2' => $theme['td_class2'],
  484.         'T_TD_CLASS3' => $theme['td_class3'],
  485.         'T_FONTFACE1' => $theme['fontface1'],
  486.         'T_FONTFACE2' => $theme['fontface2'],
  487.         'T_FONTFACE3' => $theme['fontface3'],
  488.         'T_FONTSIZE1' => $theme['fontsize1'],
  489.         'T_FONTSIZE2' => $theme['fontsize2'],
  490.         'T_FONTSIZE3' => $theme['fontsize3'],
  491.         'T_FONTCOLOR1' => '#'.$theme['fontcolor1'],
  492.         'T_FONTCOLOR2' => '#'.$theme['fontcolor2'],
  493.         'T_FONTCOLOR3' => '#'.$theme['fontcolor3'],
  494.         'T_SPAN_CLASS1' => $theme['span_class1'],
  495.         'T_SPAN_CLASS2' => $theme['span_class2'],
  496.         'T_SPAN_CLASS3' => $theme['span_class3'],
  497.  
  498.         'NAV_LINKS' => $nav_links_html)
  499. );
  500.  
  501. //
  502. // Login box?
  503. //
  504. if ( !$userdata['session_logged_in'] )
  505. {
  506.         $template->assign_block_vars('switch_user_logged_out', array());
  507. }
  508. else
  509. {
  510.         $template->assign_block_vars('switch_user_logged_in', array());
  511.  
  512.         if ( !empty($userdata['user_popup_pm']) )
  513.         {
  514.                 $template->assign_block_vars('switch_enable_pm_popup', array());
  515.         }
  516. }
  517.  
  518. // Add no-cache control for cookies if they are set
  519. //$c_no_cache = (isset($HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_sid']) || isset($HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_data'])) ? 'no-cache="set-cookie", ' : '';
  520.  
  521. // Work around for "current" Apache 2 + PHP module which seems to not
  522. // cope with private cache control setting
  523. if (!empty($_SERVER['SERVER_SOFTWARE']) && strstr($_SERVER['SERVER_SOFTWARE'], 'Apache/2'))
  524. {
  525.         header ('Cache-Control: no-cache, pre-check=0, post-check=0');
  526. }
  527. else
  528. {
  529.         header ('Cache-Control: private, pre-check=0, post-check=0, max-age=0');
  530. }
  531. header ('Expires: 0');
  532. header ('Pragma: no-cache');
  533.  
  534. $template->pparse('overall_header');
  535.  
  536. ?>