Fout in XML pagina??? Nog maar een keer proberen
Geplaatst: 20 dec 2004, 14:54
Op een ander forum van mij krijg ik deze foutmelding:
De XML-pagina kan niet worden weergegeven
Kan XML-invoer niet lezen met opmaakmodel XSL. Herstel de fout en klik vervolgens op de knop Vernieuwen of probeer het later opnieuw.
--------------------------------------------------------------------------------
Een XML-document mag maximaal één element van het hoogste niveau bevatten. Fout bij het verwerken van bron http://www.xpownersforum.co.uk/phpBB2/portal.php. Regel 2, positie 2
<b>Warning</b>: ob_start(): output handler 'ob_gzhandler' conflicts with 'zlib output compression' in <b>/home/xpowners/public_html/phpBB2/includes/page_header.php</b> on line <b>50</b><br />
-^
Dit is de code van portal.php
Code:
<?php
/***************************************************************************
* portal.php
* -------------------
* begin : Tuesday, August 13, 2002
* copyright : (C) 2002 Smartor
* email : smartor_xp@hotmail.com
*
* $Id: portal.php,v 2.1.7 2003/01/30, 17:05:58 Smartor Exp $
*
***************************************************************************/
/***************************************************************************
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
***************************************************************************/
/***************************************************************************
*
* Some code in this file I borrowed from the original index.php, Welcome
* Avatar MOD and others...
*
***************************************************************************/
//
// Set configuration for ezPortal
//
// Welcome Text: note that we are in PHP file, so use \' instead of ' and use \\ instead of \ (HTML enabled)
$CFG['welcome_text'] = 'Welcome to <b>My Community</b><br /><br />Thanks for using ezPortal,<br /><br />Have a good time! ^_^';
// Number of news on portal
//$CFG['number_of_news'] = '5';
// Length of news
//$CFG['news_length'] = '200';
// News Forum ID: separate by comma for multi-forums, eg. '1,2,5'
//$CFG['news_forum'] = '1';
// Poll Forum ID: separate by comma for multi-forums, eg. '3,8,14'
//$CFG['poll_forum'] = '1';
//
// END configuration
// --------------------------------------------------------
define('IN_PHPBB', true);
$phpbb_root_path = './';
include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.'.$phpEx);
include($phpbb_root_path . 'fetchposts.'.$phpEx);
//
// Start session management
//
$userdata = session_pagestart($user_ip, PAGE_INDEX);
init_userprefs($userdata);
//
// End session management
//
//
// If you don't use these stats on your index you may want to consider
// removing them
//
$total_posts = get_db_stat('postcount');
$total_users = get_db_stat('usercount');
$total_topics = get_db_stat('topiccount');
$newest_userdata = get_db_stat('newestuser');
$newest_user = $newest_userdata['username'];
$newest_uid = $newest_userdata['user_id'];
if( $total_posts == 0 )
{
$l_total_post_s = $lang['Posted_articles_zero_total'];
}
else if( $total_posts == 1 )
{
$l_total_post_s = $lang['Posted_article_total'];
}
else
{
$l_total_post_s = $lang['Posted_articles_total'];
}
if( $total_users == 0 )
{
$l_total_user_s = $lang['Registered_users_zero_total'];
}
else if( $total_users == 1 )
{
$l_total_user_s = $lang['Registered_user_total'];
}
else
{
$l_total_user_s = $lang['Registered_users_total'];
}
// Read Portal Configuration from DB
define('PORTAL_TABLE', $table_prefix.'portal');
$CFG = array();
$sql = "SELECT * FROM " . PORTAL_TABLE;
if( !($result = $db->sql_query($sql)) )
{
message_die(CRITICAL_ERROR, "Could not query config information", "", __LINE__, __FILE__, $sql);
}
while ( $row = $db->sql_fetchrow($result) )
{
$CFG[$row['portal_name']] = $row['portal_value'];
}
if( $userdata['session_logged_in'] )
{
$sql = "SELECT COUNT(post_id) as total
FROM " . POSTS_TABLE . "
WHERE post_time >= " . $userdata['user_lastvisit'];
$result = $db->sql_query($sql);
if( $result )
{
$row = $db->sql_fetchrow($result);
$lang['Search_new'] = $lang['Search_new'] . " (" . $row['total'] . ")";
}
}
//
// Start output of page
//
define('SHOW_ONLINE', true);
$page_title = $lang['Home'];
include($phpbb_root_path . 'includes/page_header.'.$phpEx);
$template->set_filenames(array(
'body' => 'portal_body.tpl')
);
// Newest Nickpages Mod
$sql = "SELECT a.user_id, a.username, b.name, b.created FROM ".USERS_TABLE." a, ".NICKPAGE_TABLE." b WHERE b.uid=a.user_id ORDER BY b.created DESC LIMIT 6";
if (!$result = $db->sql_query($sql))
{
message_die(GENERAL_ERROR, 'Could not query Nickpage information', '', __LINE__, __FILE__, $sql);
}
$nickpage_list = $db->sql_fetchrowset($result);
for($i = 0; $i < count($nickpage_list); $i++)
{
$username = $nickpage_list[$i]['username'];
$userdate = $nickpage_list[$i]['created'];
if(strlen($username) > 17) { // Limit title length to avoid wrap
$username = strip_tags($username, '<a><i><b><ul><li>');
$username = substr($username,0,15);
$username .= "...";
}
$row_color = ( !($i % 2) ) ? $theme['td_color1'] : $theme['td_color2'];
$row_class = ( !($i % 2) ) ? $theme['td_class1'] : $theme['td_class2'];
$template->assign_block_vars('nickpagemod', array(
"ROW_COLOR" => "#" . $row_color,
"ROW_CLASS" => $row_class,
'NAME' => '<a href="' . append_sid("nickpage.php?user=$username") . '">' . $username . '</a>',
'LSEEN_TIME' => date("m.d.y", $nickpage_list[$i]['created']),
)
);
}
//
// Avatar On Index MOD
//
$avatar_img = '';
if ( $userdata['user_avatar_type'] && $userdata['user_allowavatar'] )
{
switch( $userdata['user_avatar_type'] )
{
case USER_AVATAR_UPLOAD:
$avatar_img = ( $board_config['allow_avatar_upload'] ) ? '<img src="' . $board_config['avatar_path'] . '/' . $userdata['user_avatar'] . '" alt="" border="0" />' : '';
break;
case USER_AVATAR_REMOTE:
$avatar_img = ( $board_config['allow_avatar_remote'] ) ? '<img src="' . $userdata['user_avatar'] . '" alt="" border="0" />' : '';
break;
case USER_AVATAR_GALLERY:
$avatar_img = ( $board_config['allow_avatar_local'] ) ? '<img src="' . $board_config['avatar_gallery_path'] . '/' . $userdata['user_avatar'] . '" alt="" border="0" />' : '';
break;
}
}
// Check For Anonymous User
if ($userdata['user_id'] != '-1')
{
$name_link = '<a href="' . append_sid("profile.$phpEx?mode=editprofile&" . $userdata['user_id']) . '">' . $userdata['username'] . '</a>';
}
else
{
$name_link = $lang['Guest'];
}
//
// END: Avatar On Index MOD
//
$template->assign_vars(array(
'WELCOME_TEXT' => $CFG['welcome_text'],
'TOTAL_POSTS' => sprintf($l_total_post_s, $total_posts),
'TOTAL_USERS' => sprintf($l_total_user_s, $total_users),
'TOTAL_TOPICS' => sprintf($lang['total_topics'], $total_topics),
'NEWEST_USER' => sprintf($lang['Newest_user'], '<a href="' . append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=$newest_uid") . '">', $newest_user, '</a>'),
'L_FORUM' => $lang['Forum'],
'L_BOARD_NAVIGATION' => $lang['Board_navigation'],
'L_STATISTICS' => $lang['Statistics'],
'L_ANNOUNCEMENT' => $lang['Post_Announcement'],
'L_POSTED' => $lang['Posted'],
'L_COMMENTS' => $lang['Comments'],
'L_VIEW_COMMENTS' => $lang['View_comments'],
'L_POST_COMMENT' => $lang['Post_your_comment'],
'L_SEND_PASSWORD' => $lang['Forgotten_password'],
'U_SEND_PASSWORD' => append_sid("profile.$phpEx?mode=sendpassword"),
'L_REGISTER_NEW_ACCOUNT' => sprintf($lang['Register_new_account'], '<a href="' . append_sid("profile.$phpEx?mode=register") . '">', '</a>'),
'L_REMEMBER_ME' => $lang['Remember_me'],
'L_VIEW_COMPLETE_LIST' => $lang['View_complete_list'],
'L_POLL' => $lang['Poll'],
'L_VOTE_BUTTON' => $lang['Vote'],
'L_WHOSBIRTHDAY_WEEK' => ($board_config['birthday_check_day']>1) ? sprintf((($birthday_week_list) ? $lang['Birthday_week'].$birthday_week_list : $lang['Nobirthday_week']), $board_config['birthday_check_day']) : '',
'L_WHOSBIRTHDAY_TODAY' => ($board_config['birthday_check_day']) ? ($birthday_today_list) ? $lang['Birthday_today'].$birthday_today_list : $lang['Nobirthday_today'] : '',
'L_NEWEST_NICKPAGES' => $lang['Newest_Nickpages'],
// Welcome Avatar
'L_NAME_WELCOME' => $lang['Welcome'],
'U_NAME_LINK' => $name_link,
'AVATAR_IMG' => $avatar_img)
);
//
// Fetch Posts from Announcements Forum
//
if(!isset($HTTP_GET_VARS['article']))
{
$template->assign_block_vars('welcome_text', array());
$fetchposts = phpbb_fetch_posts($CFG['news_forum'], $CFG['number_of_news'], $CFG['news_length']);
for ($i = 0; $i < count($fetchposts); $i++)
{
if( $fetchposts[$i]['striped'] == 1 )
{
$open_bracket = '[ ';
$close_bracket = ' ]';
$read_full = $lang['Read_Full'];
}
else
{
$open_bracket = '';
$close_bracket = '';
$read_full = '';
}
$template->assign_block_vars('fetchpost_row', array(
'TITLE' => $fetchposts[$i]['topic_title'],
'POSTER' => $fetchposts[$i]['username'],
'TIME' => $fetchposts[$i]['topic_time'],
'TEXT' => $fetchposts[$i]['post_text'],
'REPLIES' => $fetchposts[$i]['topic_replies'],
'U_VIEW_COMMENTS' => append_sid('viewtopic.' . $phpEx . '?t=' . $fetchposts[$i]['topic_id']),
'U_POST_COMMENT' => append_sid('posting.' . $phpEx . '?mode=reply&t=' . $fetchposts[$i]['topic_id']),
'U_READ_FULL' => append_sid('portal.' . $phpEx . '?article=' . $i),
'L_READ_FULL' => $read_full,
'OPEN' => $open_bracket,
'CLOSE' => $close_bracket)
);
}
}
else
{
$fetchposts = phpbb_fetch_posts($CFG['news_forum'], $CFG['number_of_news'], 0);
$i = intval($HTTP_GET_VARS['article']);
$template->assign_block_vars('fetchpost_row', array(
'TITLE' => $fetchposts[$i]['topic_title'],
'POSTER' => $fetchposts[$i]['username'],
'TIME' => $fetchposts[$i]['topic_time'],
'TEXT' => $fetchposts[$i]['post_text'],
'REPLIES' => $fetchposts[$i]['topic_replies'],
'U_VIEW_COMMENTS' => append_sid('viewtopic.' . $phpEx . '?t=' . $fetchposts[$i]['topic_id']),
'U_POST_COMMENT' => append_sid('posting.' . $phpEx . '?mode=reply&t=' . $fetchposts[$i]['topic_id'])
)
);
}
//
// END: Fetch Announcements
//
//
// Fetch Poll
//
$fetchpoll = phpbb_fetch_poll($CFG['poll_forum']);
if (!empty($fetchpoll))
{
$template->assign_vars(array(
'S_POLL_QUESTION' => $fetchpoll['vote_text'],
'S_POLL_ACTION' => append_sid('posting.'.$phpEx.'?'.POST_TOPIC_URL.'='.$fetchpoll['topic_id']),
'S_TOPIC_ID' => $fetchpoll['topic_id'],
'L_SUBMIT_VOTE' => $lang['Submit_vote'],
'L_LOGIN_TO_VOTE' => $lang['Login_to_vote']
)
);
for ($i = 0; $i < count($fetchpoll['options']); $i++)
{
$template->assign_block_vars('poll_option_row', array(
'OPTION_ID' => $fetchpoll['options'][$i]['vote_option_id'],
'OPTION_TEXT' => $fetchpoll['options'][$i]['vote_option_text'],
'VOTE_RESULT' => $fetchpoll['options'][$i]['vote_result'],
)
);
}
}
else
{
$template->assign_vars(array(
'S_POLL_QUESTION' => $lang['No_poll'],
'DISABLED' => 'disabled="disabled"'
)
);
}
//
// Generate the page
//
include($phpbb_root_path . 'mods/netclectic/mini_cal/mini_cal.'.$phpEx);
$template->pparse('body');
include($phpbb_root_path . 'includes/page_tail.'.$phpEx);
?>
En dit de code van includes/page_header.php
Quote:
<?php
//-- mod : calendar --------------------------------------------------------------------------------
//-- mod : categories hierarchy --------------------------------------------------------------------
/***************************************************************************
* page_header.php
* -------------------
* begin : Saturday, Feb 13, 2001
* copyright : (C) 2001 The phpBB Group
* email : support@phpbb.com
*
* $Id: page_header.php,v 1.106.2.20 2003/06/10 20:48:19 acydburn Exp $
*
*
***************************************************************************/
/***************************************************************************
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
***************************************************************************/
if ( !defined('IN_PHPBB') )
{
die("Hacking attempt");
}
define('HEADER_INC', TRUE);
//-- mod : profile cp ------------------------------------------------------------------------------
//-- add
include_once($phpbb_root_path . 'profilcp/functions_profile.' . $phpEx);
//-- fin mod : profile cp --------------------------------------------------------------------------
//
// gzip_compression
//
$do_gzip_compress = FALSE;
if ( $board_config['gzip_compress'] )
{
$phpver = phpversion();
$useragent = (isset($_SERVER["HTTP_USER_AGENT"]) ) ? $_SERVER["HTTP_USER_AGENT"] : $HTTP_USER_AGENT;
if ( $phpver >= '4.0.4pl1' && ( strstr($useragent,'compatible') || strstr($useragent,'Gecko') ) )
{
if ( extension_loaded('zlib') )
{
ob_start('ob_gzhandler');
}
}
else if ( $phpver > '4.0' )
{
if ( strstr($HTTP_SERVER_VARS['HTTP_ACCEPT_ENCODING'], 'gzip') )
{
if ( extension_loaded('zlib') )
{
$do_gzip_compress = TRUE;
ob_start();
ob_implicit_flush(0);
header('Content-Encoding: gzip');
}
}
}
}
//
// PARSE DATEFORMAT TO GET TIME FORMAT // TODAY AT MOD
//
$time_reg = '([gh][[:punct:][:space:]]{1,2}[[:punct:][:space:]]{0,2}[a]?[[:punct:][:space:]]{0,2}?)';
eregi($time_reg, $board_config['default_dateformat'], $regs);
$board_config['default_timeformat'] = $regs[1];
unset($time_reg);
unset($regs);
$name = $userdata['username'];
//
// GET THE TIME TODAY AND YESTERDAY
//
$today_ary = explode('|', create_date('m|d|Y', time(),$board_config['board_timezone']));
$board_config['time_today'] = gmmktime(0 - $board_config['board_timezone'] - $board_config['dstime'],0,0,$today_ary[0],$today_ary[1],$today_ary[2]);
$board_config['time_yesterday'] = $board_config['time_today'] - 86400;
unset($today_ary);
//
// Parse and show the overall header.
//
$template->set_filenames(array(
'overall_header' => ( empty($gen_simple_header) ) ? 'overall_header.tpl' : 'simple_header.tpl')
);
//
// Generate logged in/logged out status
//
if ( $userdata['session_logged_in'] )
{
$u_login_logout = 'login.'.$phpEx.'?logout=true&sid=' . $userdata['session_id'];
$l_login_logout = $lang['Logout'] . ' [ ' . $userdata['username'] . ' ]';
}
else
{
$u_login_logout = 'login.'.$phpEx;
$l_login_logout = $lang['Login'];
}
$s_last_visit = ( $userdata['session_logged_in'] ) ? create_date($board_config['default_dateformat'], $userdata['user_lastvisit'], $board_config['board_timezone']) : '';
if ( !$userdata['user_level']==MOD )
{
$template->assign_block_vars('switch_user_is_not_moderator', array());
} else
{
$template->assign_block_vars('switch_user_is_moderator', array());
}
if ( !$userdata['user_level']==ADMIN )
{
$template->assign_block_vars('switch_user_is_not_admin', array());
} else
{
$template->assign_block_vars('switch_user_is_admin', array());
}
//
// Get basic (usernames + totals) online
// situation
//
$logged_visible_online = 0;
$logged_hidden_online = 0;
$guests_online = 0;
$online_userlist = '';
$online_userlist_l = '';
if (defined('SHOW_ONLINE'))
{
$user_forum_sql = ( !empty($forum_id) ) ? "AND s.session_page = " . intval($forum_id) : '';
//-- mod : profile cp ------------------------------------------------------------------------------
//-- delete
// $sql = "SELECT u.username, u.user_id, u.user_allow_viewonline, u.user_level, s.session_logged_in, s.session_ip
// FROM ".USERS_TABLE." u, ".SESSIONS_TABLE." s
// WHERE u.user_id = s.session_user_id
// AND s.session_time >= ".( time() - 300 ) . "
// $user_forum_sql
// ORDER BY u.username ASC, s.session_ip ASC";
//-- add
$sql = "SELECT u.*, s.session_logged_in, s.session_time, s.session_page, s.session_ip
FROM ".USERS_TABLE." u, ".SESSIONS_TABLE." s
WHERE u.user_id = s.session_user_id
AND s.session_time >= ".( time() - 300 ) . "
$user_forum_sql
ORDER BY u.username ASC, s.session_ip ASC";
//-- fin mod : profile cp --------------------------------------------------------------------------
if( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not obtain user/online information', '', __LINE__, __FILE__, $sql);
}
$userlist_ary = array();
$userlist_visible = array();
$prev_user_id = 0;
$prev_user_ip = '';
//-- mod : profile cp ------------------------------------------------------------------------------
//-- delete
// while( $row = $db->sql_fetchrow($result) )
// {
// // User is logged in and therefor not a guest
// if ( $row['session_logged_in'] )
// {
// // Skip multiple sessions for one user
// if ( $row['user_id'] != $prev_user_id )
// {
// $style_color = '';
// if ( $row['user_level'] == ADMIN )
// {
// $row['username'] = '<b>' . $row['username'] . '</b>';
// $style_color = 'style="color:#' . $theme['fontcolor3'] . '"';
// }
// else if ( $row['user_level'] == MOD )
// {
// $row['username'] = '<b>' . $row['username'] . '</b>';
// $style_color = 'style="color:#' . $theme['fontcolor2'] . '"';
// }
//
// if ( $row['user_allow_viewonline'] )
// {
// $user_online_link = '<a href="' . append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=" . $row['user_id']) . '"' . $style_color .'>' . $row['username'] . '</a>';
// $logged_visible_online++;
// }
// else
// {
// $user_online_link = '<a href="' . append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=" . $row['user_id']) . '"' . $style_color .'><i>' . $row['username'] . '</i></a>';
// $logged_hidden_online++;
// }
//
// if ( $row['user_allow_viewonline'] || $userdata['user_level'] == ADMIN )
// {
// $online_userlist .= ( $online_userlist != '' ) ? ', ' . $user_online_link : $user_online_link;
// }
// }
//
// $prev_user_id = $row['user_id'];
// }
// else
// {
// // Skip multiple sessions for one user
// if ( $row['session_ip'] != $prev_session_ip )
// {
// $guests_online++;
// }
// }
//
// $prev_session_ip = $row['session_ip'];
// }
// $db->sql_freeresult($result);
//-- add
$connected = array();
$user_ids = array();
while ($row = $db->sql_fetchrow($result) )
{
// User is logged in and therefor not a guest
if ( $row['session_logged_in'] )
{
if ( !in_array($row['user_id'], $user_ids) )
{
$row['style'] = ' class="' . get_user_level_class($row['user_level'], 'gen', $row) . '"';
$connected[] = $row;
$user_ids[] = $row['user_id'];
}
}
else
{
// Skip multiple sessions for one user
if ( $row['session_ip'] != $prev_session_ip )
{
$row['style'] = '';
$connected[] = $row;
}
}
$prev_session_ip = $row['session_ip'];
}
$db->sql_freeresult($result);
// read buddy list
$buddys = array();
if (count($user_ids) > 0)
{
$s_user_ids = implode(', ', $user_ids);
// get base info
$sql = "SELECT * FROM " . BUDDYS_TABLE . " WHERE user_id=" . $userdata['user_id'] . " and buddy_id in ($s_user_ids)";
if ( !($result = $db->sql_query($sql)) ) message_die(GENERAL_ERROR, "Could not obtain buddys information.", '', __LINE__, __FILE__, $sql);
while ( $row = $db->sql_fetchrow($result) )
{
$buddys[ $row['buddy_id'] ]['buddy_ignore'] = $row['buddy_ignore'];
$buddys[ $row['buddy_id'] ]['buddy_my_friend'] = !$row['buddy_ignore'];
$buddys[ $row['buddy_id'] ]['buddy_friend'] = false;
$buddys[ $row['buddy_id'] ]['buddy_visible'] = false;
}
// check if in the topic author's friend list and "always visible" status he granted
$sql = "SELECT * FROM " . BUDDYS_TABLE . " WHERE buddy_id=" . $userdata['user_id'] . " and user_id in ($s_user_ids)";
if ( !($result = $db->sql_query($sql)) ) message_die(GENERAL_ERROR, "Could not obtain buddys information.", '', __LINE__, __FILE__, $sql);
while ( $row = $db->sql_fetchrow($result) )
{
if ( !isset($buddys[ $row['user_id'] ]) ) $buddys[ $row['user_id'] ]['buddy_ignore'] = false;
if ( !isset($buddys[ $row['user_id'] ]) ) $buddys[ $row['user_id'] ]['buddy_my_friend'] = false;
$buddys[ $row['user_id'] ]['buddy_friend'] = !$row['buddy_ignore'];
$buddys[ $row['user_id'] ]['buddy_visible'] = $row['buddy_visible'];
}
$db->sql_freeresult($result);
}
// get visible/not visible status
$user_id = $userdata['user_id'];
$user_level = $userdata['user_level'];
$is_admin = is_admin($userdata);
for ($i=0; $i < count($connected); $i++)
{
$view_user_id = $connected[$i]['user_id'];
$view_is_admin = is_admin($connected[$i]);
$view_online_set = $connected[$i]['user_allow_viewonline'];
$view_ignore = ($is_admin || $view_is_admin || ($view_user_id == $user_id)) ? false : $buddys[$view_user_id]['buddy_ignore'];
$view_friend = $buddys[$view_user_id]['buddy_friend'];
$view_visible = ($is_admin || ($view_user_id == $user_id)) ? YES : $buddys[$view_user_id]['buddy_visible'];
// online/offline/hidden icon
if ($view_user_id == ANONYMOUS)
{
$status = 'guest';
}
else if ($view_ignore)
{
$status = 'offline';
}
else
{
switch ($view_online_set)
{
case NO:
$status = ($view_visible) ? 'hidden' : 'offline';
break;
case YES:
$status = 'online';
break;
case FRIEND_ONLY:
$status = ($view_friend || $view_visible) ? 'hidden' : 'offline';
break;
default:
$status = '???';
}
}
// set the status
switch ($status)
{
case 'guest':
$guests_online++;
break;
case 'offline':
$logged_hidden_online++;
break;
case 'online':
$logged_visible_online++;
break;
case 'hidden':
$connected[$i]['username'] = '<i>' . $connected[$i]['username'] . '</i>';
$logged_hidden_online++;
break;
default:
}
$connected[$i]['status'] = $status;
// add the user to the online list
if ( ($status == 'online') || ($status == 'hidden') )
{
$online_userlist .= ( $online_userlist != '' ) ? ', ' : '';
$online_userlist .= '<a href="' . append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=" . $connected[$i]['user_id'] ) . '"' . $connected[$i]['style'] . '>' . $connected[$i]['username'] . '</a>';
}
}
//-- fin mod : profile cp --------------------------------------------------------------------------
if ( empty($online_userlist) )
{
$online_userlist = $lang['None'];
}
if (($plus_config['index_layout'] == 'index_body.tpl'))
{
$online_userlist = ( ( isset($forum_id) ) ? $lang['Browsing_forum'] : $lang['Registered_users'] ) . ' ' . $online_userlist;
}
else
{
$online_userlist = ( ( isset($forum_id) ) ? $lang['Browsing_forum'] : $lang['Registered_users2'] ) . ' ' . $online_userlist;
}
$total_online_users = $logged_visible_online + $logged_hidden_online + $guests_online;
if ( $total_online_users > $board_config['record_online_users'])
{
$board_config['record_online_users'] = $total_online_users;
$board_config['record_online_date'] = time();
$sql = "UPDATE " . CONFIG_TABLE . "
SET config_value = '$total_online_users'
WHERE config_name = 'record_online_users'";
if ( !$db->sql_query($sql) )
{
message_die(GENERAL_ERROR, 'Could not update online user record (nr of users)', '', __LINE__, __FILE__, $sql);
}
$sql = "UPDATE " . CONFIG_TABLE . "
SET config_value = '" . $board_config['record_online_date'] . "'
WHERE config_name = 'record_online_date'";
if ( !$db->sql_query($sql) )
{
message_die(GENERAL_ERROR, 'Could not update online user record (date)', '', __LINE__, __FILE__, $sql);
}
}
if ( $total_online_users == 0 )
{
$l_t_user_s = $lang['Online_users_zero_total'];
}
else if ( $total_online_users == 1 )
{
$l_t_user_s = $lang['Online_user_total'];
}
else
{
$l_t_user_s = $lang['Online_users_total'];
}
if ( $logged_visible_online == 0 )
{
$l_r_user_s = $lang['Reg_users_zero_total'];
}
else if ( $logged_visible_online == 1 )
{
$l_r_user_s = $lang['Reg_user_total'];
}
else
{
$l_r_user_s = $lang['Reg_users_total'];
}
if ( $logged_hidden_online == 0 )
{
$l_h_user_s = $lang['Hidden_users_zero_total'];
}
else if ( $logged_hidden_online == 1 )
{
$l_h_user_s = $lang['Hidden_user_total'];
}
else
{
$l_h_user_s = $lang['Hidden_users_total'];
}
if ( $guests_online == 0 )
{
$l_g_user_s = $lang['Guest_users_zero_total'];
}
else if ( $guests_online == 1 )
{
$l_g_user_s = $lang['Guest_user_total'];
}
else
{
$l_g_user_s = $lang['Guest_users_total'];
}
$l_online_users = sprintf($l_t_user_s, $total_online_users);
$l_online_users .= sprintf($l_r_user_s, $logged_visible_online);
$l_online_users .= sprintf($l_h_user_s, $logged_hidden_online);
$l_online_users .= sprintf($l_g_user_s, $guests_online);
if ( $total_online_users == 0 )
{
$l_t_user_s_l = $lang['Online_users_zero_total_l'];
}
else if ( $total_online_users == 1 )
{
$l_t_user_s_l = $lang['Online_user_total_l'];
}
else
{
$l_t_user_s_l = $lang['Online_users_total_l'];
}
if ( $logged_visible_online == 0 )
{
$l_r_user_s_l = $lang['Reg_users_zero_total_l'];
}
else if ( $logged_visible_online == 1 )
{
$l_r_user_s_l = $lang['Reg_user_total_l'];
}
else
{
$l_r_user_s_l = $lang['Reg_users_total_l'];
}
if ( $logged_hidden_online == 0 )
{
$l_h_user_s_l = $lang['Hidden_users_zero_total_l'];
}
else if ( $logged_hidden_online == 1 )
{
$l_h_user_s_l = $lang['Hidden_user_total_l'];
}
else
{
$l_h_user_s_l = $lang['Hidden_users_total_l'];
}
if ( $guests_online == 0 )
{
$l_g_user_s_l = $lang['Guest_users_zero_total_l'];
}
else if ( $guests_online == 1 )
{
$l_g_user_s_l = $lang['Guest_user_total_l'];
}
else
{
$l_g_user_s_l = $lang['Guest_users_total_l'];
}
$l_online_users_l = sprintf($l_t_user_s_l, $total_online_users);
$l_online_users_l .= sprintf($l_r_user_s_l, $logged_visible_online);
$l_online_users_l .= sprintf($l_h_user_s_l, $logged_hidden_online);
$l_online_users_l .= sprintf($l_g_user_s_l, $guests_online);
}
//
// Obtain number of new private messages
// if user is logged in
//
if ( ($userdata['session_logged_in']) && (empty($gen_simple_header)) )
{
if ( $userdata['user_new_privmsg'] )
{
$l_message_new = ( $userdata['user_new_privmsg'] == 1 ) ? $lang['New_pm'] : $lang['New_pms'];
$l_privmsgs_text = sprintf($l_message_new, $userdata['user_new_privmsg']);
if ( $userdata['user_last_privmsg'] > $userdata['user_lastvisit'] )
{
$sql = "UPDATE " . USERS_TABLE . "
SET user_last_privmsg = " . $userdata['user_lastvisit'] . "
WHERE user_id = " . $userdata['user_id'];
if ( !$db->sql_query($sql) )
{
message_die(GENERAL_ERROR, 'Could not update private message new/read time for user', '', __LINE__, __FILE__, $sql);
}
$s_privmsg_new = 1;
$icon_pm = $images['pm_new_msg'];
}
else
{
$s_privmsg_new = 0;
$icon_pm = $images['pm_new_msg'];
}
}
else
{
$l_privmsgs_text = $lang['No_new_pm'];
$s_privmsg_new = 0;
$icon_pm = $images['pm_no_new_msg'];
}
if ( $userdata['user_unread_privmsg'] )
{
$l_message_unread = ( $userdata['user_unread_privmsg'] == 1 ) ? $lang['Unread_pm'] : $lang['Unread_pms'];
$l_privmsgs_text_unread = sprintf($l_message_unread, $userdata['user_unread_privmsg']);
}
else
{
$l_privmsgs_text_unread = $lang['No_unread_pm'];
}
}
else
{
$icon_pm = $images['pm_no_new_msg'];
$l_privmsgs_text = $lang['Login_check_pm'];
$l_privmsgs_text_unread = '';
$s_privmsg_new = 0;
}
//
// Generate HTML required for Mozilla Navigation bar
//
if (!isset($nav_links))
{
$nav_links = array();
}
$nav_links_html = '';
$nav_link_proto = '<link rel="%s" href="%s" title="%s" />' . "\n";
while( list($nav_item, $nav_array) = @each($nav_links) )
{
if ( !empty($nav_array['url']) )
{
$nav_links_html .= sprintf($nav_link_proto, $nav_item, append_sid($nav_array['url']), $nav_array['title']);
}
else
{
// We have a nested array, used for items like <link rel='chapter'> that can occur more than once.
while( list(,$nested_array) = each($nav_array) )
{
$nav_links_html .= sprintf($nav_link_proto, $nav_item, $nested_array['url'], $nested_array['title']);
}
}
}
// Format Timezone. We are unable to use array_pop here, because of PHP3 compatibility
$l_timezone = explode('.', $board_config['board_timezone']);
$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'])];
$time_now=time();
$hour_now=create_date('Hi',$time_now,$board_config['board_timezone']);
$date_now=create_date('Ymd',$time_now,$board_config['board_timezone']);
$week_now=create_date('w',$time_now,$board_config['board_timezone']);
$sql_level= ($userdata['user_id']==ANONYMOUS) ? ANONYMOUS : (($userdata['user_level']==ADMIN) ? MOD : (($userdata['user_level']==MOD) ? ADMIN : $userdata['user_level']));
$sql = "SELECT DISTINCT banner_id, banner_name, banner_spot, banner_description, banner_forum FROM ".BANNERS_TABLE ."
WHERE banner_active
AND IF(banner_level_type,IF(banner_level_type=1,'".$sql_level."'<=banner_level,IF(banner_level_type=2,'".$sql_level."'>=banner_level,'".$sql_level."'<>banner_level)),banner_level='".$sql_level."')
AND (banner_timetype='0'
OR (( $hour_now BETWEEN time_begin AND time_end) AND ((banner_timetype='2'
OR (( $week_now BETWEEN date_begin AND date_end) AND banner_timetype='4')
OR (( $date_now BETWEEN date_begin AND date_end) AND banner_timetype='6')
)))) ORDER BY banner_spot,SUBSTRING(RAND(),6,2)*banner_weigth";
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, "Couldn't get banners data", "", __LINE__, __FILE__, $sql);
}
$banners = array();
$i=0;
while ($banners[$i] = $db->sql_fetchrow($result))
{
$banner_spot=$banners[$i]['banner_spot'];
if ($banner_spot<>$last_spot AND ($banners[$i]['banner_forum']==$forum_id || !$banners[$i]['banner_forum']))
{
$template->assign_var('BANNER_'.$banner_spot.'_IMG', '<a href="'.append_sid('redirect.'.$phpEx.'?banner_id='.$banners[$i]['banner_id']).'" target="_blank"><img src="'.$banners[$i]['banner_name'].'" border="0" alt="'.$banners[$i]['banner_description'].'" title="'.$banners[$i]['banner_description'].'"></a>');
$banner_show_list.= ', '.$banners[$i]['banner_id'];
}
$last_spot = ($banners[$i]['banner_forum']==$forum_id || !$banners[$i]['banner_forum']) ? $banner_spot : $last_spot;
$i++;
}
//
// The following assigns all _common_ variables that may be used at any point
// in a template.
//
$template->assign_vars(array(
'SITENAME' => $board_config['sitename'],
'SITE_DESCRIPTION' => $board_config['site_desc'],
'PAGE_TITLE' => $page_title,
'LAST_VISIT_DATE' => sprintf($lang['You_last_visit'], $s_last_visit),
'CURRENT_TIME' => sprintf($lang['Current_time'], create_date($board_config['default_dateformat'], time(), $board_config['board_timezone'])),
'TOTAL_USERS_ONLINE' => $l_online_users,
'TOTAL_USERS_ONLINE_L' => $l_online_users_l,
'LOGGED_IN_USER_LIST' => $online_userlist,
'LOGGED_IN_USER_LIST_L' => $online_userlist,
'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'])),
'PRIVATE_MESSAGE_INFO' => $l_privmsgs_text,
'PRIVATE_MESSAGE_INFO_UNREAD' => $l_privmsgs_text_unread,
'PRIVATE_MESSAGE_NEW_FLAG' => $s_privmsg_new,
'PRIVMSG_IMG' => $icon_pm,
'L_USERNAME' => $lang['Username'],
'L_PASSWORD' => $lang['Password'],
'L_LOGIN_LOGOUT' => $l_login_logout,
'L_LOGIN' => $lang['Login'],
'L_LOG_ME_IN' => $lang['Log_me_in'],
'L_AUTO_LOGIN' => $lang['Log_me_in'],
'L_INDEX' => sprintf($lang['Forum_Index'], $board_config['sitename']),
'L_REGISTER' => $lang['Register'],
'L_PROFILE' => $lang['Profile'],
'L_SEARCH' => $lang['Search'],
'L_PRIVATEMSGS' => $lang['Private_Messages'],
'L_WHO_IS_ONLINE' => $lang['Who_is_Online'],
'L_MEMBERLIST' => $lang['Memberlist'],
'L_FAQ' => $lang['FAQ'],
'L_USERGROUPS' => $lang['Usergroups'],
'L_SEARCH_NEW' => $lang['Search_new'],
'L_SEARCH_UNANSWERED' => $lang['Search_unanswered'],
'L_SEARCH_SELF' => $lang['Search_your_posts'],
//-- mod : profile cp ------------------------------------------------------------------------------
//-- delete
// 'L_WHOSONLINE_ADMIN' => sprintf($lang['Admin_online_color'], '<span style="color:#' . $theme['fontcolor3'] . '">', '</span>'),
// 'L_WHOSONLINE_MOD' => sprintf($lang['Mod_online_color'], '<span style="color:#' . $theme['fontcolor2'] . '">', '</span>'),
//-- add
'L_WHOSONLINE_ADMIN' => sprintf($lang['Admin_online_color'], '<span class="' . get_user_level_class(ADMIN) . '">', '</span>'),
'L_WHOSONLINE_SUPER_MOD' => sprintf($lang['Super_Mod_online_color'], '<span class="' . get_user_level_class(LESS_ADMIN) . '">', '</span>'),
'L_WHOSONLINE_MOD' => sprintf($lang['Mod_online_color'], '<span class="' . get_user_level_class(MOD) . '">', '</span>'),
//-- fin mod : profile cp --------------------------------------------------------------------------
'L_MODS' => $lang['Mods'],
'L_STATISTICS' => $lang['Statistics'],
'L_ALBUM' => $lang['Album'],
'L_LINKS' => $lang['Links'],
'L_LIVE_STATISTICS' => $lang['Live_Statistics'],
'L_BIRTHDAYS' => $lang['Birthday'],
'L_ONLINE_TODAY' => $lang['Online_Today'],
'L_WELCOME' => $lang['Welcome'],
'L_MEMBERS' => $lang['Members'],
'L_LAST_MEMBER' => $lang['Last_Member'],
'L_OVERALL_MEMBER' => $lang['Overall_Member'],
'L_ONLINE_USERS' => $lang['Online_Users'],
'L_ONLINE_NOW' => $lang['Online_Now'],
'U_SEARCH_UNANSWERED' => append_sid('search.'.$phpEx.'?search_id=unanswered'),
'U_RECENT' => append_sid("recent.$phpEx"),
'L_RECENT' => $lang['link'],
'U_SEARCH_SELF' => append_sid('search.'.$phpEx.'?search_id=egosearch'),
'U_SEARCH_NEW' => append_sid('search.'.$phpEx.'?search_id=newposts'),
'U_INDEX' => append_sid('index.'.$phpEx),
'U_REGISTER' => append_sid('profile.'.$phpEx.'?mode=register'),
'U_PROFILE' => append_sid('profile.'.$phpEx.'?mode=editprofile'),
'U_PRIVATEMSGS' => append_sid('privmsg.'.$phpEx.'?folder=inbox'),
'U_PRIVATEMSGS_POPUP' => append_sid('privmsg.'.$phpEx.'?mode=newpm'),
'U_SEARCH' => append_sid('search.'.$phpEx),
'U_MEMBERLIST' => append_sid('memberlist.'.$phpEx),
'U_MODCP' => append_sid('modcp.'.$phpEx),
'U_FAQ' => append_sid('faq.'.$phpEx),
'U_VIEWONLINE' => append_sid('viewonline.'.$phpEx),
'U_LOGIN_LOGOUT' => append_sid($u_login_logout),
'U_GROUP_CP' => append_sid('groupcp.'.$phpEx),
'U_MODS' => append_sid('mods.'.$phpEx),
'U_PORTAL' => append_sid('portal.'.$phpEx),
'U_STATISTICS' => append_sid('statistics.'.$phpEx),
'U_ALBUM' => append_sid('album.'.$phpEx),
'U_LINKS' => append_sid('links.'.$phpEx),
'L_HOME' => $lang['Home'],
'PLUS_VERSION' => $plus_config['plus_version'],
'USERNAME' => $name,
'L_Nickpagelist' => $lang['Nickpagelist'],
'U_Nickpagelist' => append_sid('nickpage_list.'.$phpEx),
'I_RANKS' => '<img src="' . $images['Ranks'] . '" width="12" height="13" border="0" alt="' . $lang['Ranks'] . '" hspace="3" />',
'U_RANKS' => append_sid("ranks.$phpEx"),
'L_RANKS' => $lang['Ranks'],
'U_STAFF' => append_sid('staff.'.$phpEx),
'L_STAFF' => $lang['Staff'],
'S_CONTENT_DIRECTION' => $lang['DIRECTION'],
'S_CONTENT_ENCODING' => $lang['ENCODING'],
'S_CONTENT_DIR_LEFT' => $lang['LEFT'],
'S_CONTENT_DIR_RIGHT' => $lang['RIGHT'],
'S_TIMEZONE' => sprintf($lang['All_times'], $l_timezone),
'S_LOGIN_ACTION' => append_sid('login.'.$phpEx),
'T_HEAD_STYLESHEET' => $theme['head_stylesheet'],
'T_BODY_BACKGROUND' => $theme['body_background'],
'T_BODY_BGCOLOR' => '#'.$theme['body_bgcolor'],
'T_BODY_TEXT' => '#'.$theme['body_text'],
'T_BODY_LINK' => '#'.$theme['body_link'],
'T_BODY_VLINK' => '#'.$theme['body_vlink'],
'T_BODY_ALINK' => '#'.$theme['body_alink'],
'T_BODY_HLINK' => '#'.$theme['body_hlink'],
'T_TR_COLOR1' => '#'.$theme['tr_color1'],
'T_TR_COLOR2' => '#'.$theme['tr_color2'],
'T_TR_COLOR3' => '#'.$theme['tr_color3'],
'T_TR_CLASS1' => $theme['tr_class1'],
'T_TR_CLASS2' => $theme['tr_class2'],
'T_TR_CLASS3' => $theme['tr_class3'],
'T_TH_COLOR1' => '#'.$theme['th_color1'],
'T_TH_COLOR2' => '#'.$theme['th_color2'],
'T_TH_COLOR3' => '#'.$theme['th_color3'],
'T_TH_CLASS1' => $theme['th_class1'],
'T_TH_CLASS2' => $theme['th_class2'],
'T_TH_CLASS3' => $theme['th_class3'],
'T_TD_COLOR1' => '#'.$theme['td_color1'],
'T_TD_COLOR2' => '#'.$theme['td_color2'],
'T_TD_COLOR3' => '#'.$theme['td_color3'],
'T_TD_CLASS1' => $theme['td_class1'],
'T_TD_CLASS2' => $theme['td_class2'],
'T_TD_CLASS3' => $theme['td_class3'],
'T_FONTFACE1' => $theme['fontface1'],
'T_FONTFACE2' => $theme['fontface2'],
'T_FONTFACE3' => $theme['fontface3'],
'T_FONTSIZE1' => $theme['fontsize1'],
'T_FONTSIZE2' => $theme['fontsize2'],
'T_FONTSIZE3' => $theme['fontsize3'],
'T_FONTCOLOR1' => '#'.$theme['fontcolor1'],
'T_FONTCOLOR2' => '#'.$theme['fontcolor2'],
'T_FONTCOLOR3' => '#'.$theme['fontcolor3'],
'T_SPAN_CLASS1' => $theme['span_class1'],
'T_SPAN_CLASS2' => $theme['span_class2'],
'T_SPAN_CLASS3' => $theme['span_class3'],
'NAV_LINKS' => $nav_links_html)
);
//
// Login box?
//
if ( !$userdata['session_logged_in'] )
{
$template->assign_block_vars('switch_user_logged_out', array());
}
else
{
$template->assign_block_vars('switch_user_logged_in', array());
if ( !empty($userdata['user_popup_pm']) )
{
$template->assign_block_vars('switch_enable_pm_popup', array());
}
}
// Add no-cache control for cookies if they are set
//$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", ' : '';
// Work around for "current" Apache 2 + PHP module which seems to not
// cope with private cache control setting
if (!empty($_SERVER['SERVER_SOFTWARE']) && strstr($_SERVER['SERVER_SOFTWARE'], 'Apache/2'))
{
header ('Cache-Control: no-cache, pre-check=0, post-check=0');
}
else
{
header ('Cache-Control: private, pre-check=0, post-check=0, max-age=0');
}
header ('Expires: 0');
header ('Pragma: no-cache');
//-- mod : categories hierarchy --------------------------------------------------------------------
//-- add
include_once($phpbb_root_path . 'includes/mods_settings/mod_categories_hierarchy.' . $phpEx);
// get the nav sentence
$nav_key = '';
if (isset($HTTP_POST_VARS[POST_CAT_URL]) || isset($HTTP_GET_VARS[POST_CAT_URL]))
{
$nav_key = POST_CAT_URL . ((isset($HTTP_POST_VARS[POST_CAT_URL])) ? intval($HTTP_POST_VARS[POST_CAT_URL]) : intval($HTTP_GET_VARS[POST_CAT_URL]));
}
if (isset($HTTP_POST_VARS[POST_FORUM_URL]) || isset($HTTP_GET_VARS[POST_FORUM_URL]))
{
$nav_key = POST_FORUM_URL . ((isset($HTTP_POST_VARS[POST_FORUM_URL])) ? intval($HTTP_POST_VARS[POST_FORUM_URL]) : intval($HTTP_GET_VARS[POST_FORUM_URL]));
}
if (isset($HTTP_POST_VARS[POST_TOPIC_URL]) || isset($HTTP_GET_VARS[POST_TOPIC_URL]))
{
$nav_key = POST_TOPIC_URL . ((isset($HTTP_POST_VARS[POST_TOPIC_URL])) ? intval($HTTP_POST_VARS[POST_TOPIC_URL]) : intval($HTTP_GET_VARS[POST_TOPIC_URL]));
}
if (isset($HTTP_POST_VARS[POST_POST_URL]) || isset($HTTP_GET_VARS[POST_POST_URL]))
{
$nav_key = POST_POST_URL . ((isset($HTTP_POST_VARS[POST_POST_URL])) ? intval($HTTP_POST_VARS[POST_POST_URL]) : intval($HTTP_GET_VARS[POST_POST_URL]));
}
if ( empty($nav_key) && (isset($HTTP_POST_VARS['selected_id']) || isset($HTTP_GET_VARS['selected_id'])) )
{
$nav_key = isset($HTTP_GET_VARS['selected_id']) ? $HTTP_GET_VARS['selected_id'] : $HTTP_POST_VARS['selected_id'];
}
if (empty($nav_key)) $nav_key = 'Root';
$nav_cat_desc = make_cat_nav_tree($nav_key, $nav_pgm);
if ($nav_cat_desc != '') $nav_cat_desc = $nav_separator . $nav_cat_desc;
// send to template
$template->assign_vars(array(
'SPACER' => $images['spacer'],
'NAV_SEPARATOR' => $nav_separator,
'NAV_CAT_DESC' => $nav_cat_desc,
)
);
//-- fin mod : categories hierarchy ----------------------------------------------------------------
//-- mod : profile cp ------------------------------------------------------------------------------
//-- add
if ( $userdata['session_logged_in'] )
{
if (empty($gen_simple_header))
{
$today_year = date('Y', time());
$today_month = date('m', time());
$today_day = date('d', time());
$today = mktime( 0, 0, 1, $today_month, $today_day, $today_year );
$birthday_year = $today_year;
$birthday_month = intval(substr($userdata['user_birthday'], 4, 2));
$birthday_day = intval(substr($userdata['user_birthday'], 6, 2 ));
$birthday = mktime( 0, 0, 1, $birthday_month, $birthday_day, $birthday_year );
$last_year = date('Y', $userdata['user_last_birthday']);
$last_month = date('m', $userdata['user_last_birthday']);
$last_day = date('d', $userdata['user_last_birthday']);
$last = (intval($userdata['user_last_birthday']) > 0 ) ? mktime( 0, 0, 1, $last_month, $last_day, $last_year ) : 0;
// one week limit
if ( ($last < $birthday) && ($today >= $birthday) && ($today <= ($birthday + 3600*24*7)) )
{
$userdata['user_last_birthday'] = time();
$sql = "UPDATE " . USERS_TABLE . " SET user_last_birthday = " . $userdata['user_last_birthday'];
if ( !($result = $db->sql_query($sql)) ) message_die(GENERAL_ERROR, 'Could not update user information', '', __LINE__, __FILE__, $sql);
$template->assign_block_vars('birthday_popup', array(
'U_BIRTHDAY_POPUP' => append_sid('profile_birthday.'.$phpEx),
)
);
}
}
}
// create config values : summer time
if (!isset($board_config['summer_time']) )
{
$board_config['summer_time'] = '0';
$sqlw = "INSERT INTO " . CONFIG_TABLE . " (config_name,config_value) VALUES('summer_time','0')";
if ( !($resultw = $db->sql_query($sqlw)) ) message_die(GENERAL_ERROR, 'Could not add key summer_time in config table', '', __LINE__, __FILE__, $sql);
}
// create config values : robotic register
if (!isset($board_config['robotic_register']) )
{
$board_config['robotic_register'] = '1';
$sqlw = "INSERT INTO " . CONFIG_TABLE . " (config_name,config_value) VALUES('robotic_register','1')";
if ( !($resultw = $db->sql_query($sqlw)) ) message_die(GENERAL_ERROR, 'Could not add key robotic_register in config table', '', __LINE__, __FILE__, $sql);
}
// forum rules
if (!isset($board_config['forum_rules']) )
{
$board_config['forum_rules'] = '';
$sqlw = "INSERT INTO " . CONFIG_TABLE . " (config_name,config_value) VALUES('forum_rules','')";
if ( !($resultw = $db->sql_query($sqlw)) ) message_die(GENERAL_ERROR, 'Could not add key forum_rules in config table', '', __LINE__, __FILE__, $sql);
}
// birthday today list
function get_birthday_list( $time )
{
global $db, $phpbb_root_path, $phpEx, $userdata, $admin_level, $level_prior;
$res = '';
// no guest here, sorry
if ($userdata['user_id'] == ANONYMOUS) return $res;
include_once($phpbb_root_path . 'profilcp/functions_profile.'.$phpEx);
$today = date("md", $time);
$user_id = $userdata['user_id'];
$sql = "SELECT u.*,
(CASE WHEN i.buddy_ignore = 1 THEN 1 ELSE 0 END) as user_ignore,
(CASE WHEN b.buddy_ignore = 0 THEN 1 ELSE 0 END) as user_friend,
(CASE WHEN b.buddy_visible = 1 THEN 1 ELSE 0 END) as user_visible
FROM ((" . USERS_TABLE . " as u
LEFT JOIN " . BUDDYS_TABLE . " as b ON b.user_id=u.user_id AND b.buddy_id=$user_id)
LEFT JOIN " . BUDDYS_TABLE . " as i ON i.user_id=$user_id AND i.buddy_id=u.user_id)
WHERE u.user_id <> " . ANONYMOUS . " and u.user_birthday <> 0 and u.user_birthday <> '' and RIGHT(u.user_birthday, 4) = $today
ORDER BY username";
if ( !($result = $db->sql_query($sql)) ) message_die(GENERAL_ERROR, 'Could not read user table to get birthday today info', '', __LINE__, __FILE__, $sql);
while ($row = $db->sql_fetchrow($result))
{
// get user relational status
$ignore = $row['user_ignore'];
$friend = $row['user_friend'];
$always_visible = $row['user_visible'];
// get the status of each info
$real_display = ( !$ignore && $userdata['user_allow_real'] && $row['user_allow_real'] && ( ($row['user_viewreal'] == YES) || ( ($row['user_viewreal'] == FRIEND_ONLY) && $friend ) ) );
// take care of admin status
if ( is_admin($userdata) || ($row['user_id'] == $userdata['user_id']) ) $real_display = true;
if ($real_display)
{
$txtclass = get_user_level_class($row['user_level'], 'genmed', $row);
if ($row['user_allow_viewonline'] != YES) $row['username'] = '<i>' . $row['username'] . '</i>';
$temp_url = append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=" . $row['user_id']);
$row['username'] = '<a href="' . $temp_url . '" class="' . $txtclass . '">' . $row['username'] . '</a>';
// add to the user list
$res .= ( $res != '' ) ? ', ' : '';
$res .= $row['username'];
}
}
return $res;
}
// send happy birthday list
if (defined('SHOW_ONLINE') && $userdata['session_logged_in'])
{
$birthday_fellows = get_birthday_list(time());
if ($birthday_fellows != '') $template->assign_block_vars('switch_happy_birthday', array());
$template->assign_vars(array(
'HAPPY_BIRTHDAY_IMG' => $images['Happy_birthday'],
'L_HAPPY_BIRTHDAY' => $lang['Happy_birthday'],
'HAPPY_BIRTHDAY_FELLOWS' => $birthday_fellows,
)
);
}
//-- fin mod : profile cp --------------------------------------------------------------------------
//-- mod : calendar --------------------------------------------------------------------------------
//-- add
//-- enh : better init (all the same for all mods)
include_once($phpbb_root_path . 'includes/mods_settings/mod_calendar.' . $phpEx);
if (!defined('IN_CALENDAR'))
{
if ( intval($board_config['calendar_header_cells']) > 0 )
{
include_once($phpbb_root_path . './includes/functions_calendar.' . $phpEx);
display_calendar('CALENDAR_BOX', intval($board_config['calendar_header_cells']));
}
}
$template->assign_vars(array(
'L_CALENDAR' => $lang['Calendar'],
'I_CALENDAR' => $images['menu_calendar'],
'U_CALENDAR' => append_sid("./calendar.$phpEx"),
)
);
//-- fin mod : calendar ----------------------------------------------------------------------------
//-- mod : split topic type ------------------------------------------------------------------------
//-- add
// split global announce
$switch_split_global_announce = isset($lang['Post_global_announcement']);
if ( isset($lang['Post_global_announcement']) && !isset( $board_config['split_global_announce'] ) )
{
$sqlw = "INSERT INTO ".CONFIG_TABLE." (config_name,config_value) VALUES('split_global_announce','" . $switch_split_global_announce . "')";
if ( !($resultw = $db->sql_query($sqlw)) ) message_die(GENERAL_ERROR, 'Could not add key split_annonce in config table', '', __LINE__, __FILE__, $sql);
$board_config['split_global_announce'] = $switch_split_global_announce;
}
if ( isset($lang['Post_global_announcement']) )
{
$switch_split_global_announce = intval($board_config['split_global_announce']);
}
// split standard announce
$switch_split_announce = true;
if ( !isset( $board_config['split_announce'] ) )
{
$sqlw = "INSERT INTO ".CONFIG_TABLE." (config_name,config_value) VALUES('split_announce','" . $switch_split_announce . "')";
if ( !($resultw = $db->sql_query($sqlw)) ) message_die(GENERAL_ERROR, 'Could not add key split_annonce in config table', '', __LINE__, __FILE__, $sql);
$board_config['split_announce'] = $switch_split_announce;
}
$switch_split_announce = intval($board_config['split_announce']);
// split sticky
$switch_split_sticky = true;
if ( !isset( $board_config['split_sticky'] ) )
{
$sqlw = "INSERT INTO ".CONFIG_TABLE." (config_name,config_value) VALUES('split_sticky','" . $switch_split_sticky . "')";
if ( !($resultw = $db->sql_query($sqlw)) ) message_die(GENERAL_ERROR, 'Could not add key split_sticky in config table', '', __LINE__, __FILE__, $sql);
$board_config['split_sticky'] = $switch_split_sticky;
}
$switch_split_sticky = intval($board_config['split_sticky']);
// split in box
$split_topic_split = false;
if ( !isset($board_config['split_topic_split']) )
{
$sqlw = "INSERT INTO ".CONFIG_TABLE." (config_name,config_value) VALUES('split_topic_split','" . $split_topic_split . "')";
if ( !($resultw = $db->sql_query($sqlw)) ) message_die(GENERAL_ERROR, 'Could not add key split_topic_split in config table', '', __LINE__, __FILE__, $sql);
$board_config['split_topic_split'] = $split_topic_split;
}
$split_topic_split = intval($board_config['split_topic_split']);
//-- fin mod : split topic type --------------------------------------------------------------------
if ( $userdata['session_logged_in'] )
{
//Nickpage vorhanden?
$sql = "SELECT COUNT(uid) AS zaehle FROM ".NICKPAGE_TABLE." WHERE uid='".$userdata['user_id']."'";
if( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Konnte Querrie nicht ausführen!', '', __LINE__, __FILE__, $sql);
}
$row = $db->sql_fetchrow($result);
//Konfiguration (ab wieviel posts...)
$sql = "SELECT anzahl_posts FROM ".NICKPAGECONFIG_TABLE;
if( !($result2 = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Konnte Querrie nicht ausführen!', '', __LINE__, __FILE__, $sql);
}
$row2 = $db->sql_fetchrow($result2);
if($row['zaehle'] == "1" OR $row2['anzahl_posts'] <= $userdata['user_posts'])
{
$template->assign_block_vars('Shownickpagebutton',array(
'U_NICKPAGE' => append_sid('nickpage.'.$phpEx.'?admin='.$userdata['username']),
));
}
}
include_once($phpbb_root_path . 'includes/mods_settings/mod_post_icons.' . $phpEx);
$template->pparse('overall_header');
?>
Ik weet het, het is heel veel ineens, maar ik zou bij God niet weten wat ik hiermee aanmoet.
Een van jullie misschien?
De XML-pagina kan niet worden weergegeven
Kan XML-invoer niet lezen met opmaakmodel XSL. Herstel de fout en klik vervolgens op de knop Vernieuwen of probeer het later opnieuw.
--------------------------------------------------------------------------------
Een XML-document mag maximaal één element van het hoogste niveau bevatten. Fout bij het verwerken van bron http://www.xpownersforum.co.uk/phpBB2/portal.php. Regel 2, positie 2
<b>Warning</b>: ob_start(): output handler 'ob_gzhandler' conflicts with 'zlib output compression' in <b>/home/xpowners/public_html/phpBB2/includes/page_header.php</b> on line <b>50</b><br />
-^
Dit is de code van portal.php
Code:
<?php
/***************************************************************************
* portal.php
* -------------------
* begin : Tuesday, August 13, 2002
* copyright : (C) 2002 Smartor
* email : smartor_xp@hotmail.com
*
* $Id: portal.php,v 2.1.7 2003/01/30, 17:05:58 Smartor Exp $
*
***************************************************************************/
/***************************************************************************
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
***************************************************************************/
/***************************************************************************
*
* Some code in this file I borrowed from the original index.php, Welcome
* Avatar MOD and others...
*
***************************************************************************/
//
// Set configuration for ezPortal
//
// Welcome Text: note that we are in PHP file, so use \' instead of ' and use \\ instead of \ (HTML enabled)
$CFG['welcome_text'] = 'Welcome to <b>My Community</b><br /><br />Thanks for using ezPortal,<br /><br />Have a good time! ^_^';
// Number of news on portal
//$CFG['number_of_news'] = '5';
// Length of news
//$CFG['news_length'] = '200';
// News Forum ID: separate by comma for multi-forums, eg. '1,2,5'
//$CFG['news_forum'] = '1';
// Poll Forum ID: separate by comma for multi-forums, eg. '3,8,14'
//$CFG['poll_forum'] = '1';
//
// END configuration
// --------------------------------------------------------
define('IN_PHPBB', true);
$phpbb_root_path = './';
include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.'.$phpEx);
include($phpbb_root_path . 'fetchposts.'.$phpEx);
//
// Start session management
//
$userdata = session_pagestart($user_ip, PAGE_INDEX);
init_userprefs($userdata);
//
// End session management
//
//
// If you don't use these stats on your index you may want to consider
// removing them
//
$total_posts = get_db_stat('postcount');
$total_users = get_db_stat('usercount');
$total_topics = get_db_stat('topiccount');
$newest_userdata = get_db_stat('newestuser');
$newest_user = $newest_userdata['username'];
$newest_uid = $newest_userdata['user_id'];
if( $total_posts == 0 )
{
$l_total_post_s = $lang['Posted_articles_zero_total'];
}
else if( $total_posts == 1 )
{
$l_total_post_s = $lang['Posted_article_total'];
}
else
{
$l_total_post_s = $lang['Posted_articles_total'];
}
if( $total_users == 0 )
{
$l_total_user_s = $lang['Registered_users_zero_total'];
}
else if( $total_users == 1 )
{
$l_total_user_s = $lang['Registered_user_total'];
}
else
{
$l_total_user_s = $lang['Registered_users_total'];
}
// Read Portal Configuration from DB
define('PORTAL_TABLE', $table_prefix.'portal');
$CFG = array();
$sql = "SELECT * FROM " . PORTAL_TABLE;
if( !($result = $db->sql_query($sql)) )
{
message_die(CRITICAL_ERROR, "Could not query config information", "", __LINE__, __FILE__, $sql);
}
while ( $row = $db->sql_fetchrow($result) )
{
$CFG[$row['portal_name']] = $row['portal_value'];
}
if( $userdata['session_logged_in'] )
{
$sql = "SELECT COUNT(post_id) as total
FROM " . POSTS_TABLE . "
WHERE post_time >= " . $userdata['user_lastvisit'];
$result = $db->sql_query($sql);
if( $result )
{
$row = $db->sql_fetchrow($result);
$lang['Search_new'] = $lang['Search_new'] . " (" . $row['total'] . ")";
}
}
//
// Start output of page
//
define('SHOW_ONLINE', true);
$page_title = $lang['Home'];
include($phpbb_root_path . 'includes/page_header.'.$phpEx);
$template->set_filenames(array(
'body' => 'portal_body.tpl')
);
// Newest Nickpages Mod
$sql = "SELECT a.user_id, a.username, b.name, b.created FROM ".USERS_TABLE." a, ".NICKPAGE_TABLE." b WHERE b.uid=a.user_id ORDER BY b.created DESC LIMIT 6";
if (!$result = $db->sql_query($sql))
{
message_die(GENERAL_ERROR, 'Could not query Nickpage information', '', __LINE__, __FILE__, $sql);
}
$nickpage_list = $db->sql_fetchrowset($result);
for($i = 0; $i < count($nickpage_list); $i++)
{
$username = $nickpage_list[$i]['username'];
$userdate = $nickpage_list[$i]['created'];
if(strlen($username) > 17) { // Limit title length to avoid wrap
$username = strip_tags($username, '<a><i><b><ul><li>');
$username = substr($username,0,15);
$username .= "...";
}
$row_color = ( !($i % 2) ) ? $theme['td_color1'] : $theme['td_color2'];
$row_class = ( !($i % 2) ) ? $theme['td_class1'] : $theme['td_class2'];
$template->assign_block_vars('nickpagemod', array(
"ROW_COLOR" => "#" . $row_color,
"ROW_CLASS" => $row_class,
'NAME' => '<a href="' . append_sid("nickpage.php?user=$username") . '">' . $username . '</a>',
'LSEEN_TIME' => date("m.d.y", $nickpage_list[$i]['created']),
)
);
}
//
// Avatar On Index MOD
//
$avatar_img = '';
if ( $userdata['user_avatar_type'] && $userdata['user_allowavatar'] )
{
switch( $userdata['user_avatar_type'] )
{
case USER_AVATAR_UPLOAD:
$avatar_img = ( $board_config['allow_avatar_upload'] ) ? '<img src="' . $board_config['avatar_path'] . '/' . $userdata['user_avatar'] . '" alt="" border="0" />' : '';
break;
case USER_AVATAR_REMOTE:
$avatar_img = ( $board_config['allow_avatar_remote'] ) ? '<img src="' . $userdata['user_avatar'] . '" alt="" border="0" />' : '';
break;
case USER_AVATAR_GALLERY:
$avatar_img = ( $board_config['allow_avatar_local'] ) ? '<img src="' . $board_config['avatar_gallery_path'] . '/' . $userdata['user_avatar'] . '" alt="" border="0" />' : '';
break;
}
}
// Check For Anonymous User
if ($userdata['user_id'] != '-1')
{
$name_link = '<a href="' . append_sid("profile.$phpEx?mode=editprofile&" . $userdata['user_id']) . '">' . $userdata['username'] . '</a>';
}
else
{
$name_link = $lang['Guest'];
}
//
// END: Avatar On Index MOD
//
$template->assign_vars(array(
'WELCOME_TEXT' => $CFG['welcome_text'],
'TOTAL_POSTS' => sprintf($l_total_post_s, $total_posts),
'TOTAL_USERS' => sprintf($l_total_user_s, $total_users),
'TOTAL_TOPICS' => sprintf($lang['total_topics'], $total_topics),
'NEWEST_USER' => sprintf($lang['Newest_user'], '<a href="' . append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=$newest_uid") . '">', $newest_user, '</a>'),
'L_FORUM' => $lang['Forum'],
'L_BOARD_NAVIGATION' => $lang['Board_navigation'],
'L_STATISTICS' => $lang['Statistics'],
'L_ANNOUNCEMENT' => $lang['Post_Announcement'],
'L_POSTED' => $lang['Posted'],
'L_COMMENTS' => $lang['Comments'],
'L_VIEW_COMMENTS' => $lang['View_comments'],
'L_POST_COMMENT' => $lang['Post_your_comment'],
'L_SEND_PASSWORD' => $lang['Forgotten_password'],
'U_SEND_PASSWORD' => append_sid("profile.$phpEx?mode=sendpassword"),
'L_REGISTER_NEW_ACCOUNT' => sprintf($lang['Register_new_account'], '<a href="' . append_sid("profile.$phpEx?mode=register") . '">', '</a>'),
'L_REMEMBER_ME' => $lang['Remember_me'],
'L_VIEW_COMPLETE_LIST' => $lang['View_complete_list'],
'L_POLL' => $lang['Poll'],
'L_VOTE_BUTTON' => $lang['Vote'],
'L_WHOSBIRTHDAY_WEEK' => ($board_config['birthday_check_day']>1) ? sprintf((($birthday_week_list) ? $lang['Birthday_week'].$birthday_week_list : $lang['Nobirthday_week']), $board_config['birthday_check_day']) : '',
'L_WHOSBIRTHDAY_TODAY' => ($board_config['birthday_check_day']) ? ($birthday_today_list) ? $lang['Birthday_today'].$birthday_today_list : $lang['Nobirthday_today'] : '',
'L_NEWEST_NICKPAGES' => $lang['Newest_Nickpages'],
// Welcome Avatar
'L_NAME_WELCOME' => $lang['Welcome'],
'U_NAME_LINK' => $name_link,
'AVATAR_IMG' => $avatar_img)
);
//
// Fetch Posts from Announcements Forum
//
if(!isset($HTTP_GET_VARS['article']))
{
$template->assign_block_vars('welcome_text', array());
$fetchposts = phpbb_fetch_posts($CFG['news_forum'], $CFG['number_of_news'], $CFG['news_length']);
for ($i = 0; $i < count($fetchposts); $i++)
{
if( $fetchposts[$i]['striped'] == 1 )
{
$open_bracket = '[ ';
$close_bracket = ' ]';
$read_full = $lang['Read_Full'];
}
else
{
$open_bracket = '';
$close_bracket = '';
$read_full = '';
}
$template->assign_block_vars('fetchpost_row', array(
'TITLE' => $fetchposts[$i]['topic_title'],
'POSTER' => $fetchposts[$i]['username'],
'TIME' => $fetchposts[$i]['topic_time'],
'TEXT' => $fetchposts[$i]['post_text'],
'REPLIES' => $fetchposts[$i]['topic_replies'],
'U_VIEW_COMMENTS' => append_sid('viewtopic.' . $phpEx . '?t=' . $fetchposts[$i]['topic_id']),
'U_POST_COMMENT' => append_sid('posting.' . $phpEx . '?mode=reply&t=' . $fetchposts[$i]['topic_id']),
'U_READ_FULL' => append_sid('portal.' . $phpEx . '?article=' . $i),
'L_READ_FULL' => $read_full,
'OPEN' => $open_bracket,
'CLOSE' => $close_bracket)
);
}
}
else
{
$fetchposts = phpbb_fetch_posts($CFG['news_forum'], $CFG['number_of_news'], 0);
$i = intval($HTTP_GET_VARS['article']);
$template->assign_block_vars('fetchpost_row', array(
'TITLE' => $fetchposts[$i]['topic_title'],
'POSTER' => $fetchposts[$i]['username'],
'TIME' => $fetchposts[$i]['topic_time'],
'TEXT' => $fetchposts[$i]['post_text'],
'REPLIES' => $fetchposts[$i]['topic_replies'],
'U_VIEW_COMMENTS' => append_sid('viewtopic.' . $phpEx . '?t=' . $fetchposts[$i]['topic_id']),
'U_POST_COMMENT' => append_sid('posting.' . $phpEx . '?mode=reply&t=' . $fetchposts[$i]['topic_id'])
)
);
}
//
// END: Fetch Announcements
//
//
// Fetch Poll
//
$fetchpoll = phpbb_fetch_poll($CFG['poll_forum']);
if (!empty($fetchpoll))
{
$template->assign_vars(array(
'S_POLL_QUESTION' => $fetchpoll['vote_text'],
'S_POLL_ACTION' => append_sid('posting.'.$phpEx.'?'.POST_TOPIC_URL.'='.$fetchpoll['topic_id']),
'S_TOPIC_ID' => $fetchpoll['topic_id'],
'L_SUBMIT_VOTE' => $lang['Submit_vote'],
'L_LOGIN_TO_VOTE' => $lang['Login_to_vote']
)
);
for ($i = 0; $i < count($fetchpoll['options']); $i++)
{
$template->assign_block_vars('poll_option_row', array(
'OPTION_ID' => $fetchpoll['options'][$i]['vote_option_id'],
'OPTION_TEXT' => $fetchpoll['options'][$i]['vote_option_text'],
'VOTE_RESULT' => $fetchpoll['options'][$i]['vote_result'],
)
);
}
}
else
{
$template->assign_vars(array(
'S_POLL_QUESTION' => $lang['No_poll'],
'DISABLED' => 'disabled="disabled"'
)
);
}
//
// Generate the page
//
include($phpbb_root_path . 'mods/netclectic/mini_cal/mini_cal.'.$phpEx);
$template->pparse('body');
include($phpbb_root_path . 'includes/page_tail.'.$phpEx);
?>
En dit de code van includes/page_header.php
Quote:
<?php
//-- mod : calendar --------------------------------------------------------------------------------
//-- mod : categories hierarchy --------------------------------------------------------------------
/***************************************************************************
* page_header.php
* -------------------
* begin : Saturday, Feb 13, 2001
* copyright : (C) 2001 The phpBB Group
* email : support@phpbb.com
*
* $Id: page_header.php,v 1.106.2.20 2003/06/10 20:48:19 acydburn Exp $
*
*
***************************************************************************/
/***************************************************************************
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
***************************************************************************/
if ( !defined('IN_PHPBB') )
{
die("Hacking attempt");
}
define('HEADER_INC', TRUE);
//-- mod : profile cp ------------------------------------------------------------------------------
//-- add
include_once($phpbb_root_path . 'profilcp/functions_profile.' . $phpEx);
//-- fin mod : profile cp --------------------------------------------------------------------------
//
// gzip_compression
//
$do_gzip_compress = FALSE;
if ( $board_config['gzip_compress'] )
{
$phpver = phpversion();
$useragent = (isset($_SERVER["HTTP_USER_AGENT"]) ) ? $_SERVER["HTTP_USER_AGENT"] : $HTTP_USER_AGENT;
if ( $phpver >= '4.0.4pl1' && ( strstr($useragent,'compatible') || strstr($useragent,'Gecko') ) )
{
if ( extension_loaded('zlib') )
{
ob_start('ob_gzhandler');
}
}
else if ( $phpver > '4.0' )
{
if ( strstr($HTTP_SERVER_VARS['HTTP_ACCEPT_ENCODING'], 'gzip') )
{
if ( extension_loaded('zlib') )
{
$do_gzip_compress = TRUE;
ob_start();
ob_implicit_flush(0);
header('Content-Encoding: gzip');
}
}
}
}
//
// PARSE DATEFORMAT TO GET TIME FORMAT // TODAY AT MOD
//
$time_reg = '([gh][[:punct:][:space:]]{1,2}[[:punct:][:space:]]{0,2}[a]?[[:punct:][:space:]]{0,2}?)';
eregi($time_reg, $board_config['default_dateformat'], $regs);
$board_config['default_timeformat'] = $regs[1];
unset($time_reg);
unset($regs);
$name = $userdata['username'];
//
// GET THE TIME TODAY AND YESTERDAY
//
$today_ary = explode('|', create_date('m|d|Y', time(),$board_config['board_timezone']));
$board_config['time_today'] = gmmktime(0 - $board_config['board_timezone'] - $board_config['dstime'],0,0,$today_ary[0],$today_ary[1],$today_ary[2]);
$board_config['time_yesterday'] = $board_config['time_today'] - 86400;
unset($today_ary);
//
// Parse and show the overall header.
//
$template->set_filenames(array(
'overall_header' => ( empty($gen_simple_header) ) ? 'overall_header.tpl' : 'simple_header.tpl')
);
//
// Generate logged in/logged out status
//
if ( $userdata['session_logged_in'] )
{
$u_login_logout = 'login.'.$phpEx.'?logout=true&sid=' . $userdata['session_id'];
$l_login_logout = $lang['Logout'] . ' [ ' . $userdata['username'] . ' ]';
}
else
{
$u_login_logout = 'login.'.$phpEx;
$l_login_logout = $lang['Login'];
}
$s_last_visit = ( $userdata['session_logged_in'] ) ? create_date($board_config['default_dateformat'], $userdata['user_lastvisit'], $board_config['board_timezone']) : '';
if ( !$userdata['user_level']==MOD )
{
$template->assign_block_vars('switch_user_is_not_moderator', array());
} else
{
$template->assign_block_vars('switch_user_is_moderator', array());
}
if ( !$userdata['user_level']==ADMIN )
{
$template->assign_block_vars('switch_user_is_not_admin', array());
} else
{
$template->assign_block_vars('switch_user_is_admin', array());
}
//
// Get basic (usernames + totals) online
// situation
//
$logged_visible_online = 0;
$logged_hidden_online = 0;
$guests_online = 0;
$online_userlist = '';
$online_userlist_l = '';
if (defined('SHOW_ONLINE'))
{
$user_forum_sql = ( !empty($forum_id) ) ? "AND s.session_page = " . intval($forum_id) : '';
//-- mod : profile cp ------------------------------------------------------------------------------
//-- delete
// $sql = "SELECT u.username, u.user_id, u.user_allow_viewonline, u.user_level, s.session_logged_in, s.session_ip
// FROM ".USERS_TABLE." u, ".SESSIONS_TABLE." s
// WHERE u.user_id = s.session_user_id
// AND s.session_time >= ".( time() - 300 ) . "
// $user_forum_sql
// ORDER BY u.username ASC, s.session_ip ASC";
//-- add
$sql = "SELECT u.*, s.session_logged_in, s.session_time, s.session_page, s.session_ip
FROM ".USERS_TABLE." u, ".SESSIONS_TABLE." s
WHERE u.user_id = s.session_user_id
AND s.session_time >= ".( time() - 300 ) . "
$user_forum_sql
ORDER BY u.username ASC, s.session_ip ASC";
//-- fin mod : profile cp --------------------------------------------------------------------------
if( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not obtain user/online information', '', __LINE__, __FILE__, $sql);
}
$userlist_ary = array();
$userlist_visible = array();
$prev_user_id = 0;
$prev_user_ip = '';
//-- mod : profile cp ------------------------------------------------------------------------------
//-- delete
// while( $row = $db->sql_fetchrow($result) )
// {
// // User is logged in and therefor not a guest
// if ( $row['session_logged_in'] )
// {
// // Skip multiple sessions for one user
// if ( $row['user_id'] != $prev_user_id )
// {
// $style_color = '';
// if ( $row['user_level'] == ADMIN )
// {
// $row['username'] = '<b>' . $row['username'] . '</b>';
// $style_color = 'style="color:#' . $theme['fontcolor3'] . '"';
// }
// else if ( $row['user_level'] == MOD )
// {
// $row['username'] = '<b>' . $row['username'] . '</b>';
// $style_color = 'style="color:#' . $theme['fontcolor2'] . '"';
// }
//
// if ( $row['user_allow_viewonline'] )
// {
// $user_online_link = '<a href="' . append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=" . $row['user_id']) . '"' . $style_color .'>' . $row['username'] . '</a>';
// $logged_visible_online++;
// }
// else
// {
// $user_online_link = '<a href="' . append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=" . $row['user_id']) . '"' . $style_color .'><i>' . $row['username'] . '</i></a>';
// $logged_hidden_online++;
// }
//
// if ( $row['user_allow_viewonline'] || $userdata['user_level'] == ADMIN )
// {
// $online_userlist .= ( $online_userlist != '' ) ? ', ' . $user_online_link : $user_online_link;
// }
// }
//
// $prev_user_id = $row['user_id'];
// }
// else
// {
// // Skip multiple sessions for one user
// if ( $row['session_ip'] != $prev_session_ip )
// {
// $guests_online++;
// }
// }
//
// $prev_session_ip = $row['session_ip'];
// }
// $db->sql_freeresult($result);
//-- add
$connected = array();
$user_ids = array();
while ($row = $db->sql_fetchrow($result) )
{
// User is logged in and therefor not a guest
if ( $row['session_logged_in'] )
{
if ( !in_array($row['user_id'], $user_ids) )
{
$row['style'] = ' class="' . get_user_level_class($row['user_level'], 'gen', $row) . '"';
$connected[] = $row;
$user_ids[] = $row['user_id'];
}
}
else
{
// Skip multiple sessions for one user
if ( $row['session_ip'] != $prev_session_ip )
{
$row['style'] = '';
$connected[] = $row;
}
}
$prev_session_ip = $row['session_ip'];
}
$db->sql_freeresult($result);
// read buddy list
$buddys = array();
if (count($user_ids) > 0)
{
$s_user_ids = implode(', ', $user_ids);
// get base info
$sql = "SELECT * FROM " . BUDDYS_TABLE . " WHERE user_id=" . $userdata['user_id'] . " and buddy_id in ($s_user_ids)";
if ( !($result = $db->sql_query($sql)) ) message_die(GENERAL_ERROR, "Could not obtain buddys information.", '', __LINE__, __FILE__, $sql);
while ( $row = $db->sql_fetchrow($result) )
{
$buddys[ $row['buddy_id'] ]['buddy_ignore'] = $row['buddy_ignore'];
$buddys[ $row['buddy_id'] ]['buddy_my_friend'] = !$row['buddy_ignore'];
$buddys[ $row['buddy_id'] ]['buddy_friend'] = false;
$buddys[ $row['buddy_id'] ]['buddy_visible'] = false;
}
// check if in the topic author's friend list and "always visible" status he granted
$sql = "SELECT * FROM " . BUDDYS_TABLE . " WHERE buddy_id=" . $userdata['user_id'] . " and user_id in ($s_user_ids)";
if ( !($result = $db->sql_query($sql)) ) message_die(GENERAL_ERROR, "Could not obtain buddys information.", '', __LINE__, __FILE__, $sql);
while ( $row = $db->sql_fetchrow($result) )
{
if ( !isset($buddys[ $row['user_id'] ]) ) $buddys[ $row['user_id'] ]['buddy_ignore'] = false;
if ( !isset($buddys[ $row['user_id'] ]) ) $buddys[ $row['user_id'] ]['buddy_my_friend'] = false;
$buddys[ $row['user_id'] ]['buddy_friend'] = !$row['buddy_ignore'];
$buddys[ $row['user_id'] ]['buddy_visible'] = $row['buddy_visible'];
}
$db->sql_freeresult($result);
}
// get visible/not visible status
$user_id = $userdata['user_id'];
$user_level = $userdata['user_level'];
$is_admin = is_admin($userdata);
for ($i=0; $i < count($connected); $i++)
{
$view_user_id = $connected[$i]['user_id'];
$view_is_admin = is_admin($connected[$i]);
$view_online_set = $connected[$i]['user_allow_viewonline'];
$view_ignore = ($is_admin || $view_is_admin || ($view_user_id == $user_id)) ? false : $buddys[$view_user_id]['buddy_ignore'];
$view_friend = $buddys[$view_user_id]['buddy_friend'];
$view_visible = ($is_admin || ($view_user_id == $user_id)) ? YES : $buddys[$view_user_id]['buddy_visible'];
// online/offline/hidden icon
if ($view_user_id == ANONYMOUS)
{
$status = 'guest';
}
else if ($view_ignore)
{
$status = 'offline';
}
else
{
switch ($view_online_set)
{
case NO:
$status = ($view_visible) ? 'hidden' : 'offline';
break;
case YES:
$status = 'online';
break;
case FRIEND_ONLY:
$status = ($view_friend || $view_visible) ? 'hidden' : 'offline';
break;
default:
$status = '???';
}
}
// set the status
switch ($status)
{
case 'guest':
$guests_online++;
break;
case 'offline':
$logged_hidden_online++;
break;
case 'online':
$logged_visible_online++;
break;
case 'hidden':
$connected[$i]['username'] = '<i>' . $connected[$i]['username'] . '</i>';
$logged_hidden_online++;
break;
default:
}
$connected[$i]['status'] = $status;
// add the user to the online list
if ( ($status == 'online') || ($status == 'hidden') )
{
$online_userlist .= ( $online_userlist != '' ) ? ', ' : '';
$online_userlist .= '<a href="' . append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=" . $connected[$i]['user_id'] ) . '"' . $connected[$i]['style'] . '>' . $connected[$i]['username'] . '</a>';
}
}
//-- fin mod : profile cp --------------------------------------------------------------------------
if ( empty($online_userlist) )
{
$online_userlist = $lang['None'];
}
if (($plus_config['index_layout'] == 'index_body.tpl'))
{
$online_userlist = ( ( isset($forum_id) ) ? $lang['Browsing_forum'] : $lang['Registered_users'] ) . ' ' . $online_userlist;
}
else
{
$online_userlist = ( ( isset($forum_id) ) ? $lang['Browsing_forum'] : $lang['Registered_users2'] ) . ' ' . $online_userlist;
}
$total_online_users = $logged_visible_online + $logged_hidden_online + $guests_online;
if ( $total_online_users > $board_config['record_online_users'])
{
$board_config['record_online_users'] = $total_online_users;
$board_config['record_online_date'] = time();
$sql = "UPDATE " . CONFIG_TABLE . "
SET config_value = '$total_online_users'
WHERE config_name = 'record_online_users'";
if ( !$db->sql_query($sql) )
{
message_die(GENERAL_ERROR, 'Could not update online user record (nr of users)', '', __LINE__, __FILE__, $sql);
}
$sql = "UPDATE " . CONFIG_TABLE . "
SET config_value = '" . $board_config['record_online_date'] . "'
WHERE config_name = 'record_online_date'";
if ( !$db->sql_query($sql) )
{
message_die(GENERAL_ERROR, 'Could not update online user record (date)', '', __LINE__, __FILE__, $sql);
}
}
if ( $total_online_users == 0 )
{
$l_t_user_s = $lang['Online_users_zero_total'];
}
else if ( $total_online_users == 1 )
{
$l_t_user_s = $lang['Online_user_total'];
}
else
{
$l_t_user_s = $lang['Online_users_total'];
}
if ( $logged_visible_online == 0 )
{
$l_r_user_s = $lang['Reg_users_zero_total'];
}
else if ( $logged_visible_online == 1 )
{
$l_r_user_s = $lang['Reg_user_total'];
}
else
{
$l_r_user_s = $lang['Reg_users_total'];
}
if ( $logged_hidden_online == 0 )
{
$l_h_user_s = $lang['Hidden_users_zero_total'];
}
else if ( $logged_hidden_online == 1 )
{
$l_h_user_s = $lang['Hidden_user_total'];
}
else
{
$l_h_user_s = $lang['Hidden_users_total'];
}
if ( $guests_online == 0 )
{
$l_g_user_s = $lang['Guest_users_zero_total'];
}
else if ( $guests_online == 1 )
{
$l_g_user_s = $lang['Guest_user_total'];
}
else
{
$l_g_user_s = $lang['Guest_users_total'];
}
$l_online_users = sprintf($l_t_user_s, $total_online_users);
$l_online_users .= sprintf($l_r_user_s, $logged_visible_online);
$l_online_users .= sprintf($l_h_user_s, $logged_hidden_online);
$l_online_users .= sprintf($l_g_user_s, $guests_online);
if ( $total_online_users == 0 )
{
$l_t_user_s_l = $lang['Online_users_zero_total_l'];
}
else if ( $total_online_users == 1 )
{
$l_t_user_s_l = $lang['Online_user_total_l'];
}
else
{
$l_t_user_s_l = $lang['Online_users_total_l'];
}
if ( $logged_visible_online == 0 )
{
$l_r_user_s_l = $lang['Reg_users_zero_total_l'];
}
else if ( $logged_visible_online == 1 )
{
$l_r_user_s_l = $lang['Reg_user_total_l'];
}
else
{
$l_r_user_s_l = $lang['Reg_users_total_l'];
}
if ( $logged_hidden_online == 0 )
{
$l_h_user_s_l = $lang['Hidden_users_zero_total_l'];
}
else if ( $logged_hidden_online == 1 )
{
$l_h_user_s_l = $lang['Hidden_user_total_l'];
}
else
{
$l_h_user_s_l = $lang['Hidden_users_total_l'];
}
if ( $guests_online == 0 )
{
$l_g_user_s_l = $lang['Guest_users_zero_total_l'];
}
else if ( $guests_online == 1 )
{
$l_g_user_s_l = $lang['Guest_user_total_l'];
}
else
{
$l_g_user_s_l = $lang['Guest_users_total_l'];
}
$l_online_users_l = sprintf($l_t_user_s_l, $total_online_users);
$l_online_users_l .= sprintf($l_r_user_s_l, $logged_visible_online);
$l_online_users_l .= sprintf($l_h_user_s_l, $logged_hidden_online);
$l_online_users_l .= sprintf($l_g_user_s_l, $guests_online);
}
//
// Obtain number of new private messages
// if user is logged in
//
if ( ($userdata['session_logged_in']) && (empty($gen_simple_header)) )
{
if ( $userdata['user_new_privmsg'] )
{
$l_message_new = ( $userdata['user_new_privmsg'] == 1 ) ? $lang['New_pm'] : $lang['New_pms'];
$l_privmsgs_text = sprintf($l_message_new, $userdata['user_new_privmsg']);
if ( $userdata['user_last_privmsg'] > $userdata['user_lastvisit'] )
{
$sql = "UPDATE " . USERS_TABLE . "
SET user_last_privmsg = " . $userdata['user_lastvisit'] . "
WHERE user_id = " . $userdata['user_id'];
if ( !$db->sql_query($sql) )
{
message_die(GENERAL_ERROR, 'Could not update private message new/read time for user', '', __LINE__, __FILE__, $sql);
}
$s_privmsg_new = 1;
$icon_pm = $images['pm_new_msg'];
}
else
{
$s_privmsg_new = 0;
$icon_pm = $images['pm_new_msg'];
}
}
else
{
$l_privmsgs_text = $lang['No_new_pm'];
$s_privmsg_new = 0;
$icon_pm = $images['pm_no_new_msg'];
}
if ( $userdata['user_unread_privmsg'] )
{
$l_message_unread = ( $userdata['user_unread_privmsg'] == 1 ) ? $lang['Unread_pm'] : $lang['Unread_pms'];
$l_privmsgs_text_unread = sprintf($l_message_unread, $userdata['user_unread_privmsg']);
}
else
{
$l_privmsgs_text_unread = $lang['No_unread_pm'];
}
}
else
{
$icon_pm = $images['pm_no_new_msg'];
$l_privmsgs_text = $lang['Login_check_pm'];
$l_privmsgs_text_unread = '';
$s_privmsg_new = 0;
}
//
// Generate HTML required for Mozilla Navigation bar
//
if (!isset($nav_links))
{
$nav_links = array();
}
$nav_links_html = '';
$nav_link_proto = '<link rel="%s" href="%s" title="%s" />' . "\n";
while( list($nav_item, $nav_array) = @each($nav_links) )
{
if ( !empty($nav_array['url']) )
{
$nav_links_html .= sprintf($nav_link_proto, $nav_item, append_sid($nav_array['url']), $nav_array['title']);
}
else
{
// We have a nested array, used for items like <link rel='chapter'> that can occur more than once.
while( list(,$nested_array) = each($nav_array) )
{
$nav_links_html .= sprintf($nav_link_proto, $nav_item, $nested_array['url'], $nested_array['title']);
}
}
}
// Format Timezone. We are unable to use array_pop here, because of PHP3 compatibility
$l_timezone = explode('.', $board_config['board_timezone']);
$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'])];
$time_now=time();
$hour_now=create_date('Hi',$time_now,$board_config['board_timezone']);
$date_now=create_date('Ymd',$time_now,$board_config['board_timezone']);
$week_now=create_date('w',$time_now,$board_config['board_timezone']);
$sql_level= ($userdata['user_id']==ANONYMOUS) ? ANONYMOUS : (($userdata['user_level']==ADMIN) ? MOD : (($userdata['user_level']==MOD) ? ADMIN : $userdata['user_level']));
$sql = "SELECT DISTINCT banner_id, banner_name, banner_spot, banner_description, banner_forum FROM ".BANNERS_TABLE ."
WHERE banner_active
AND IF(banner_level_type,IF(banner_level_type=1,'".$sql_level."'<=banner_level,IF(banner_level_type=2,'".$sql_level."'>=banner_level,'".$sql_level."'<>banner_level)),banner_level='".$sql_level."')
AND (banner_timetype='0'
OR (( $hour_now BETWEEN time_begin AND time_end) AND ((banner_timetype='2'
OR (( $week_now BETWEEN date_begin AND date_end) AND banner_timetype='4')
OR (( $date_now BETWEEN date_begin AND date_end) AND banner_timetype='6')
)))) ORDER BY banner_spot,SUBSTRING(RAND(),6,2)*banner_weigth";
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, "Couldn't get banners data", "", __LINE__, __FILE__, $sql);
}
$banners = array();
$i=0;
while ($banners[$i] = $db->sql_fetchrow($result))
{
$banner_spot=$banners[$i]['banner_spot'];
if ($banner_spot<>$last_spot AND ($banners[$i]['banner_forum']==$forum_id || !$banners[$i]['banner_forum']))
{
$template->assign_var('BANNER_'.$banner_spot.'_IMG', '<a href="'.append_sid('redirect.'.$phpEx.'?banner_id='.$banners[$i]['banner_id']).'" target="_blank"><img src="'.$banners[$i]['banner_name'].'" border="0" alt="'.$banners[$i]['banner_description'].'" title="'.$banners[$i]['banner_description'].'"></a>');
$banner_show_list.= ', '.$banners[$i]['banner_id'];
}
$last_spot = ($banners[$i]['banner_forum']==$forum_id || !$banners[$i]['banner_forum']) ? $banner_spot : $last_spot;
$i++;
}
//
// The following assigns all _common_ variables that may be used at any point
// in a template.
//
$template->assign_vars(array(
'SITENAME' => $board_config['sitename'],
'SITE_DESCRIPTION' => $board_config['site_desc'],
'PAGE_TITLE' => $page_title,
'LAST_VISIT_DATE' => sprintf($lang['You_last_visit'], $s_last_visit),
'CURRENT_TIME' => sprintf($lang['Current_time'], create_date($board_config['default_dateformat'], time(), $board_config['board_timezone'])),
'TOTAL_USERS_ONLINE' => $l_online_users,
'TOTAL_USERS_ONLINE_L' => $l_online_users_l,
'LOGGED_IN_USER_LIST' => $online_userlist,
'LOGGED_IN_USER_LIST_L' => $online_userlist,
'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'])),
'PRIVATE_MESSAGE_INFO' => $l_privmsgs_text,
'PRIVATE_MESSAGE_INFO_UNREAD' => $l_privmsgs_text_unread,
'PRIVATE_MESSAGE_NEW_FLAG' => $s_privmsg_new,
'PRIVMSG_IMG' => $icon_pm,
'L_USERNAME' => $lang['Username'],
'L_PASSWORD' => $lang['Password'],
'L_LOGIN_LOGOUT' => $l_login_logout,
'L_LOGIN' => $lang['Login'],
'L_LOG_ME_IN' => $lang['Log_me_in'],
'L_AUTO_LOGIN' => $lang['Log_me_in'],
'L_INDEX' => sprintf($lang['Forum_Index'], $board_config['sitename']),
'L_REGISTER' => $lang['Register'],
'L_PROFILE' => $lang['Profile'],
'L_SEARCH' => $lang['Search'],
'L_PRIVATEMSGS' => $lang['Private_Messages'],
'L_WHO_IS_ONLINE' => $lang['Who_is_Online'],
'L_MEMBERLIST' => $lang['Memberlist'],
'L_FAQ' => $lang['FAQ'],
'L_USERGROUPS' => $lang['Usergroups'],
'L_SEARCH_NEW' => $lang['Search_new'],
'L_SEARCH_UNANSWERED' => $lang['Search_unanswered'],
'L_SEARCH_SELF' => $lang['Search_your_posts'],
//-- mod : profile cp ------------------------------------------------------------------------------
//-- delete
// 'L_WHOSONLINE_ADMIN' => sprintf($lang['Admin_online_color'], '<span style="color:#' . $theme['fontcolor3'] . '">', '</span>'),
// 'L_WHOSONLINE_MOD' => sprintf($lang['Mod_online_color'], '<span style="color:#' . $theme['fontcolor2'] . '">', '</span>'),
//-- add
'L_WHOSONLINE_ADMIN' => sprintf($lang['Admin_online_color'], '<span class="' . get_user_level_class(ADMIN) . '">', '</span>'),
'L_WHOSONLINE_SUPER_MOD' => sprintf($lang['Super_Mod_online_color'], '<span class="' . get_user_level_class(LESS_ADMIN) . '">', '</span>'),
'L_WHOSONLINE_MOD' => sprintf($lang['Mod_online_color'], '<span class="' . get_user_level_class(MOD) . '">', '</span>'),
//-- fin mod : profile cp --------------------------------------------------------------------------
'L_MODS' => $lang['Mods'],
'L_STATISTICS' => $lang['Statistics'],
'L_ALBUM' => $lang['Album'],
'L_LINKS' => $lang['Links'],
'L_LIVE_STATISTICS' => $lang['Live_Statistics'],
'L_BIRTHDAYS' => $lang['Birthday'],
'L_ONLINE_TODAY' => $lang['Online_Today'],
'L_WELCOME' => $lang['Welcome'],
'L_MEMBERS' => $lang['Members'],
'L_LAST_MEMBER' => $lang['Last_Member'],
'L_OVERALL_MEMBER' => $lang['Overall_Member'],
'L_ONLINE_USERS' => $lang['Online_Users'],
'L_ONLINE_NOW' => $lang['Online_Now'],
'U_SEARCH_UNANSWERED' => append_sid('search.'.$phpEx.'?search_id=unanswered'),
'U_RECENT' => append_sid("recent.$phpEx"),
'L_RECENT' => $lang['link'],
'U_SEARCH_SELF' => append_sid('search.'.$phpEx.'?search_id=egosearch'),
'U_SEARCH_NEW' => append_sid('search.'.$phpEx.'?search_id=newposts'),
'U_INDEX' => append_sid('index.'.$phpEx),
'U_REGISTER' => append_sid('profile.'.$phpEx.'?mode=register'),
'U_PROFILE' => append_sid('profile.'.$phpEx.'?mode=editprofile'),
'U_PRIVATEMSGS' => append_sid('privmsg.'.$phpEx.'?folder=inbox'),
'U_PRIVATEMSGS_POPUP' => append_sid('privmsg.'.$phpEx.'?mode=newpm'),
'U_SEARCH' => append_sid('search.'.$phpEx),
'U_MEMBERLIST' => append_sid('memberlist.'.$phpEx),
'U_MODCP' => append_sid('modcp.'.$phpEx),
'U_FAQ' => append_sid('faq.'.$phpEx),
'U_VIEWONLINE' => append_sid('viewonline.'.$phpEx),
'U_LOGIN_LOGOUT' => append_sid($u_login_logout),
'U_GROUP_CP' => append_sid('groupcp.'.$phpEx),
'U_MODS' => append_sid('mods.'.$phpEx),
'U_PORTAL' => append_sid('portal.'.$phpEx),
'U_STATISTICS' => append_sid('statistics.'.$phpEx),
'U_ALBUM' => append_sid('album.'.$phpEx),
'U_LINKS' => append_sid('links.'.$phpEx),
'L_HOME' => $lang['Home'],
'PLUS_VERSION' => $plus_config['plus_version'],
'USERNAME' => $name,
'L_Nickpagelist' => $lang['Nickpagelist'],
'U_Nickpagelist' => append_sid('nickpage_list.'.$phpEx),
'I_RANKS' => '<img src="' . $images['Ranks'] . '" width="12" height="13" border="0" alt="' . $lang['Ranks'] . '" hspace="3" />',
'U_RANKS' => append_sid("ranks.$phpEx"),
'L_RANKS' => $lang['Ranks'],
'U_STAFF' => append_sid('staff.'.$phpEx),
'L_STAFF' => $lang['Staff'],
'S_CONTENT_DIRECTION' => $lang['DIRECTION'],
'S_CONTENT_ENCODING' => $lang['ENCODING'],
'S_CONTENT_DIR_LEFT' => $lang['LEFT'],
'S_CONTENT_DIR_RIGHT' => $lang['RIGHT'],
'S_TIMEZONE' => sprintf($lang['All_times'], $l_timezone),
'S_LOGIN_ACTION' => append_sid('login.'.$phpEx),
'T_HEAD_STYLESHEET' => $theme['head_stylesheet'],
'T_BODY_BACKGROUND' => $theme['body_background'],
'T_BODY_BGCOLOR' => '#'.$theme['body_bgcolor'],
'T_BODY_TEXT' => '#'.$theme['body_text'],
'T_BODY_LINK' => '#'.$theme['body_link'],
'T_BODY_VLINK' => '#'.$theme['body_vlink'],
'T_BODY_ALINK' => '#'.$theme['body_alink'],
'T_BODY_HLINK' => '#'.$theme['body_hlink'],
'T_TR_COLOR1' => '#'.$theme['tr_color1'],
'T_TR_COLOR2' => '#'.$theme['tr_color2'],
'T_TR_COLOR3' => '#'.$theme['tr_color3'],
'T_TR_CLASS1' => $theme['tr_class1'],
'T_TR_CLASS2' => $theme['tr_class2'],
'T_TR_CLASS3' => $theme['tr_class3'],
'T_TH_COLOR1' => '#'.$theme['th_color1'],
'T_TH_COLOR2' => '#'.$theme['th_color2'],
'T_TH_COLOR3' => '#'.$theme['th_color3'],
'T_TH_CLASS1' => $theme['th_class1'],
'T_TH_CLASS2' => $theme['th_class2'],
'T_TH_CLASS3' => $theme['th_class3'],
'T_TD_COLOR1' => '#'.$theme['td_color1'],
'T_TD_COLOR2' => '#'.$theme['td_color2'],
'T_TD_COLOR3' => '#'.$theme['td_color3'],
'T_TD_CLASS1' => $theme['td_class1'],
'T_TD_CLASS2' => $theme['td_class2'],
'T_TD_CLASS3' => $theme['td_class3'],
'T_FONTFACE1' => $theme['fontface1'],
'T_FONTFACE2' => $theme['fontface2'],
'T_FONTFACE3' => $theme['fontface3'],
'T_FONTSIZE1' => $theme['fontsize1'],
'T_FONTSIZE2' => $theme['fontsize2'],
'T_FONTSIZE3' => $theme['fontsize3'],
'T_FONTCOLOR1' => '#'.$theme['fontcolor1'],
'T_FONTCOLOR2' => '#'.$theme['fontcolor2'],
'T_FONTCOLOR3' => '#'.$theme['fontcolor3'],
'T_SPAN_CLASS1' => $theme['span_class1'],
'T_SPAN_CLASS2' => $theme['span_class2'],
'T_SPAN_CLASS3' => $theme['span_class3'],
'NAV_LINKS' => $nav_links_html)
);
//
// Login box?
//
if ( !$userdata['session_logged_in'] )
{
$template->assign_block_vars('switch_user_logged_out', array());
}
else
{
$template->assign_block_vars('switch_user_logged_in', array());
if ( !empty($userdata['user_popup_pm']) )
{
$template->assign_block_vars('switch_enable_pm_popup', array());
}
}
// Add no-cache control for cookies if they are set
//$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", ' : '';
// Work around for "current" Apache 2 + PHP module which seems to not
// cope with private cache control setting
if (!empty($_SERVER['SERVER_SOFTWARE']) && strstr($_SERVER['SERVER_SOFTWARE'], 'Apache/2'))
{
header ('Cache-Control: no-cache, pre-check=0, post-check=0');
}
else
{
header ('Cache-Control: private, pre-check=0, post-check=0, max-age=0');
}
header ('Expires: 0');
header ('Pragma: no-cache');
//-- mod : categories hierarchy --------------------------------------------------------------------
//-- add
include_once($phpbb_root_path . 'includes/mods_settings/mod_categories_hierarchy.' . $phpEx);
// get the nav sentence
$nav_key = '';
if (isset($HTTP_POST_VARS[POST_CAT_URL]) || isset($HTTP_GET_VARS[POST_CAT_URL]))
{
$nav_key = POST_CAT_URL . ((isset($HTTP_POST_VARS[POST_CAT_URL])) ? intval($HTTP_POST_VARS[POST_CAT_URL]) : intval($HTTP_GET_VARS[POST_CAT_URL]));
}
if (isset($HTTP_POST_VARS[POST_FORUM_URL]) || isset($HTTP_GET_VARS[POST_FORUM_URL]))
{
$nav_key = POST_FORUM_URL . ((isset($HTTP_POST_VARS[POST_FORUM_URL])) ? intval($HTTP_POST_VARS[POST_FORUM_URL]) : intval($HTTP_GET_VARS[POST_FORUM_URL]));
}
if (isset($HTTP_POST_VARS[POST_TOPIC_URL]) || isset($HTTP_GET_VARS[POST_TOPIC_URL]))
{
$nav_key = POST_TOPIC_URL . ((isset($HTTP_POST_VARS[POST_TOPIC_URL])) ? intval($HTTP_POST_VARS[POST_TOPIC_URL]) : intval($HTTP_GET_VARS[POST_TOPIC_URL]));
}
if (isset($HTTP_POST_VARS[POST_POST_URL]) || isset($HTTP_GET_VARS[POST_POST_URL]))
{
$nav_key = POST_POST_URL . ((isset($HTTP_POST_VARS[POST_POST_URL])) ? intval($HTTP_POST_VARS[POST_POST_URL]) : intval($HTTP_GET_VARS[POST_POST_URL]));
}
if ( empty($nav_key) && (isset($HTTP_POST_VARS['selected_id']) || isset($HTTP_GET_VARS['selected_id'])) )
{
$nav_key = isset($HTTP_GET_VARS['selected_id']) ? $HTTP_GET_VARS['selected_id'] : $HTTP_POST_VARS['selected_id'];
}
if (empty($nav_key)) $nav_key = 'Root';
$nav_cat_desc = make_cat_nav_tree($nav_key, $nav_pgm);
if ($nav_cat_desc != '') $nav_cat_desc = $nav_separator . $nav_cat_desc;
// send to template
$template->assign_vars(array(
'SPACER' => $images['spacer'],
'NAV_SEPARATOR' => $nav_separator,
'NAV_CAT_DESC' => $nav_cat_desc,
)
);
//-- fin mod : categories hierarchy ----------------------------------------------------------------
//-- mod : profile cp ------------------------------------------------------------------------------
//-- add
if ( $userdata['session_logged_in'] )
{
if (empty($gen_simple_header))
{
$today_year = date('Y', time());
$today_month = date('m', time());
$today_day = date('d', time());
$today = mktime( 0, 0, 1, $today_month, $today_day, $today_year );
$birthday_year = $today_year;
$birthday_month = intval(substr($userdata['user_birthday'], 4, 2));
$birthday_day = intval(substr($userdata['user_birthday'], 6, 2 ));
$birthday = mktime( 0, 0, 1, $birthday_month, $birthday_day, $birthday_year );
$last_year = date('Y', $userdata['user_last_birthday']);
$last_month = date('m', $userdata['user_last_birthday']);
$last_day = date('d', $userdata['user_last_birthday']);
$last = (intval($userdata['user_last_birthday']) > 0 ) ? mktime( 0, 0, 1, $last_month, $last_day, $last_year ) : 0;
// one week limit
if ( ($last < $birthday) && ($today >= $birthday) && ($today <= ($birthday + 3600*24*7)) )
{
$userdata['user_last_birthday'] = time();
$sql = "UPDATE " . USERS_TABLE . " SET user_last_birthday = " . $userdata['user_last_birthday'];
if ( !($result = $db->sql_query($sql)) ) message_die(GENERAL_ERROR, 'Could not update user information', '', __LINE__, __FILE__, $sql);
$template->assign_block_vars('birthday_popup', array(
'U_BIRTHDAY_POPUP' => append_sid('profile_birthday.'.$phpEx),
)
);
}
}
}
// create config values : summer time
if (!isset($board_config['summer_time']) )
{
$board_config['summer_time'] = '0';
$sqlw = "INSERT INTO " . CONFIG_TABLE . " (config_name,config_value) VALUES('summer_time','0')";
if ( !($resultw = $db->sql_query($sqlw)) ) message_die(GENERAL_ERROR, 'Could not add key summer_time in config table', '', __LINE__, __FILE__, $sql);
}
// create config values : robotic register
if (!isset($board_config['robotic_register']) )
{
$board_config['robotic_register'] = '1';
$sqlw = "INSERT INTO " . CONFIG_TABLE . " (config_name,config_value) VALUES('robotic_register','1')";
if ( !($resultw = $db->sql_query($sqlw)) ) message_die(GENERAL_ERROR, 'Could not add key robotic_register in config table', '', __LINE__, __FILE__, $sql);
}
// forum rules
if (!isset($board_config['forum_rules']) )
{
$board_config['forum_rules'] = '';
$sqlw = "INSERT INTO " . CONFIG_TABLE . " (config_name,config_value) VALUES('forum_rules','')";
if ( !($resultw = $db->sql_query($sqlw)) ) message_die(GENERAL_ERROR, 'Could not add key forum_rules in config table', '', __LINE__, __FILE__, $sql);
}
// birthday today list
function get_birthday_list( $time )
{
global $db, $phpbb_root_path, $phpEx, $userdata, $admin_level, $level_prior;
$res = '';
// no guest here, sorry
if ($userdata['user_id'] == ANONYMOUS) return $res;
include_once($phpbb_root_path . 'profilcp/functions_profile.'.$phpEx);
$today = date("md", $time);
$user_id = $userdata['user_id'];
$sql = "SELECT u.*,
(CASE WHEN i.buddy_ignore = 1 THEN 1 ELSE 0 END) as user_ignore,
(CASE WHEN b.buddy_ignore = 0 THEN 1 ELSE 0 END) as user_friend,
(CASE WHEN b.buddy_visible = 1 THEN 1 ELSE 0 END) as user_visible
FROM ((" . USERS_TABLE . " as u
LEFT JOIN " . BUDDYS_TABLE . " as b ON b.user_id=u.user_id AND b.buddy_id=$user_id)
LEFT JOIN " . BUDDYS_TABLE . " as i ON i.user_id=$user_id AND i.buddy_id=u.user_id)
WHERE u.user_id <> " . ANONYMOUS . " and u.user_birthday <> 0 and u.user_birthday <> '' and RIGHT(u.user_birthday, 4) = $today
ORDER BY username";
if ( !($result = $db->sql_query($sql)) ) message_die(GENERAL_ERROR, 'Could not read user table to get birthday today info', '', __LINE__, __FILE__, $sql);
while ($row = $db->sql_fetchrow($result))
{
// get user relational status
$ignore = $row['user_ignore'];
$friend = $row['user_friend'];
$always_visible = $row['user_visible'];
// get the status of each info
$real_display = ( !$ignore && $userdata['user_allow_real'] && $row['user_allow_real'] && ( ($row['user_viewreal'] == YES) || ( ($row['user_viewreal'] == FRIEND_ONLY) && $friend ) ) );
// take care of admin status
if ( is_admin($userdata) || ($row['user_id'] == $userdata['user_id']) ) $real_display = true;
if ($real_display)
{
$txtclass = get_user_level_class($row['user_level'], 'genmed', $row);
if ($row['user_allow_viewonline'] != YES) $row['username'] = '<i>' . $row['username'] . '</i>';
$temp_url = append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=" . $row['user_id']);
$row['username'] = '<a href="' . $temp_url . '" class="' . $txtclass . '">' . $row['username'] . '</a>';
// add to the user list
$res .= ( $res != '' ) ? ', ' : '';
$res .= $row['username'];
}
}
return $res;
}
// send happy birthday list
if (defined('SHOW_ONLINE') && $userdata['session_logged_in'])
{
$birthday_fellows = get_birthday_list(time());
if ($birthday_fellows != '') $template->assign_block_vars('switch_happy_birthday', array());
$template->assign_vars(array(
'HAPPY_BIRTHDAY_IMG' => $images['Happy_birthday'],
'L_HAPPY_BIRTHDAY' => $lang['Happy_birthday'],
'HAPPY_BIRTHDAY_FELLOWS' => $birthday_fellows,
)
);
}
//-- fin mod : profile cp --------------------------------------------------------------------------
//-- mod : calendar --------------------------------------------------------------------------------
//-- add
//-- enh : better init (all the same for all mods)
include_once($phpbb_root_path . 'includes/mods_settings/mod_calendar.' . $phpEx);
if (!defined('IN_CALENDAR'))
{
if ( intval($board_config['calendar_header_cells']) > 0 )
{
include_once($phpbb_root_path . './includes/functions_calendar.' . $phpEx);
display_calendar('CALENDAR_BOX', intval($board_config['calendar_header_cells']));
}
}
$template->assign_vars(array(
'L_CALENDAR' => $lang['Calendar'],
'I_CALENDAR' => $images['menu_calendar'],
'U_CALENDAR' => append_sid("./calendar.$phpEx"),
)
);
//-- fin mod : calendar ----------------------------------------------------------------------------
//-- mod : split topic type ------------------------------------------------------------------------
//-- add
// split global announce
$switch_split_global_announce = isset($lang['Post_global_announcement']);
if ( isset($lang['Post_global_announcement']) && !isset( $board_config['split_global_announce'] ) )
{
$sqlw = "INSERT INTO ".CONFIG_TABLE." (config_name,config_value) VALUES('split_global_announce','" . $switch_split_global_announce . "')";
if ( !($resultw = $db->sql_query($sqlw)) ) message_die(GENERAL_ERROR, 'Could not add key split_annonce in config table', '', __LINE__, __FILE__, $sql);
$board_config['split_global_announce'] = $switch_split_global_announce;
}
if ( isset($lang['Post_global_announcement']) )
{
$switch_split_global_announce = intval($board_config['split_global_announce']);
}
// split standard announce
$switch_split_announce = true;
if ( !isset( $board_config['split_announce'] ) )
{
$sqlw = "INSERT INTO ".CONFIG_TABLE." (config_name,config_value) VALUES('split_announce','" . $switch_split_announce . "')";
if ( !($resultw = $db->sql_query($sqlw)) ) message_die(GENERAL_ERROR, 'Could not add key split_annonce in config table', '', __LINE__, __FILE__, $sql);
$board_config['split_announce'] = $switch_split_announce;
}
$switch_split_announce = intval($board_config['split_announce']);
// split sticky
$switch_split_sticky = true;
if ( !isset( $board_config['split_sticky'] ) )
{
$sqlw = "INSERT INTO ".CONFIG_TABLE." (config_name,config_value) VALUES('split_sticky','" . $switch_split_sticky . "')";
if ( !($resultw = $db->sql_query($sqlw)) ) message_die(GENERAL_ERROR, 'Could not add key split_sticky in config table', '', __LINE__, __FILE__, $sql);
$board_config['split_sticky'] = $switch_split_sticky;
}
$switch_split_sticky = intval($board_config['split_sticky']);
// split in box
$split_topic_split = false;
if ( !isset($board_config['split_topic_split']) )
{
$sqlw = "INSERT INTO ".CONFIG_TABLE." (config_name,config_value) VALUES('split_topic_split','" . $split_topic_split . "')";
if ( !($resultw = $db->sql_query($sqlw)) ) message_die(GENERAL_ERROR, 'Could not add key split_topic_split in config table', '', __LINE__, __FILE__, $sql);
$board_config['split_topic_split'] = $split_topic_split;
}
$split_topic_split = intval($board_config['split_topic_split']);
//-- fin mod : split topic type --------------------------------------------------------------------
if ( $userdata['session_logged_in'] )
{
//Nickpage vorhanden?
$sql = "SELECT COUNT(uid) AS zaehle FROM ".NICKPAGE_TABLE." WHERE uid='".$userdata['user_id']."'";
if( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Konnte Querrie nicht ausführen!', '', __LINE__, __FILE__, $sql);
}
$row = $db->sql_fetchrow($result);
//Konfiguration (ab wieviel posts...)
$sql = "SELECT anzahl_posts FROM ".NICKPAGECONFIG_TABLE;
if( !($result2 = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Konnte Querrie nicht ausführen!', '', __LINE__, __FILE__, $sql);
}
$row2 = $db->sql_fetchrow($result2);
if($row['zaehle'] == "1" OR $row2['anzahl_posts'] <= $userdata['user_posts'])
{
$template->assign_block_vars('Shownickpagebutton',array(
'U_NICKPAGE' => append_sid('nickpage.'.$phpEx.'?admin='.$userdata['username']),
));
}
}
include_once($phpbb_root_path . 'includes/mods_settings/mod_post_icons.' . $phpEx);
$template->pparse('overall_header');
?>
Ik weet het, het is heel veel ineens, maar ik zou bij God niet weten wat ik hiermee aanmoet.
Een van jullie misschien?