Categories hierarchy
Geplaatst: 20 aug 2005, 14:56
Ik heb deze lange mod geinstalleerd maar als ik naar mijn forum ga, krijg ik altijd deze melding:
Parse error: parse error, unexpected T_ELSE in /home/jalled/www/phpBB2/index.php on line 103
Dit is mijn bestandje index.php:
Parse error: parse error, unexpected T_ELSE in /home/jalled/www/phpBB2/index.php on line 103
Dit is mijn bestandje index.php:
Code: Selecteer alles
<?php
//-- mod : categories hierarchy --------------------------------------------------------------------
/***************************************************************************
* index.php
* -------------------
* begin : Saturday, Feb 13, 2001
* copyright : (C) 2001 The phpBB Group
* email : support@phpbb.com
*
* $Id: index.php,v 1.99.2.3 2004/07/11 16:46:15 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.
*
***************************************************************************/
define('IN_PHPBB', true);
$phpbb_root_path = './';
include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.'.$phpEx);
//
// Start session management
//
$userdata = session_pagestart($user_ip, PAGE_INDEX);
init_userprefs($userdata);
//
// End session management
//
// Bookie Mod
if ( $userdata['user_level'] == ADMIN )
{
include_once($phpbb_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_bookmakers.' . $phpEx);
$time_now = time();
$total_bets = 0;
$count_assigned = 0;
$sql = "SELECT * FROM " . BOOKIE_ADMIN_BETS_TABLE . " WHERE bet_time<'$time_now' AND checked=0 ";
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Error getting total for Bookie Mod', '', __LINE__, __FILE__, $sql);
}
while ( $row = $db->sql_fetchrow($result) )
{
$total_bets = $total_bets +1;
}
if ( $total_bets > 0 )
{
$bookie_image = '<img src="' . $images['folder_hot_new'] . '" alt="New" title="New" hspace="3" border="0" />';
$template->assign_block_vars('bookie_bets_due', array());
}
}
// End Bookie Mod
$viewcat = ( !empty($HTTP_GET_VARS[POST_CAT_URL]) ) ? $HTTP_GET_VARS[POST_CAT_URL] : -1;
//-- mod : categories hierarchy --------------------------------------------------------------------
//-- add
$viewcat = intval($viewcat);
if ($viewcat <= 0) $viewcat = -1;
$viewcatkey = ($viewcat < 0) ? 'Root' : POST_CAT_URL . $viewcat;
//-- fin mod : categories hierarchy ----------------------------------------------------------------
if( isset($HTTP_GET_VARS['mark']) || isset($HTTP_POST_VARS['mark']) )
{
$mark_read = ( isset($HTTP_POST_VARS['mark']) ) ? $HTTP_POST_VARS['mark'] : $HTTP_GET_VARS['mark'];
}
else
{
$mark_read = '';
}
//
// Handle marking posts
//
if( $mark_read == 'forums' )
//-- mod : categories hierarchy --------------------------------------------------------------------
//-- add
if ( $viewcat < 0 )
{
//-- fin mod : categories hierarchy ----------------------------------------------------------------
{
if( $userdata['session_logged_in'] )
{
setcookie($board_config['cookie_name'] . '_f_all', time(), 0, $board_config['cookie_path'], $board_config['cookie_domain'], $board_config['cookie_secure']);
}
$template->assign_vars(array(
"META" => '<meta http-equiv="refresh" content="3;url=' .append_sid("index.$phpEx") . '">')
);
//-- mod : categories hierarchy --------------------------------------------------------------------
//-- add
}
else
{
if( $userdata['session_logged_in'] )
{
// get the list of object authorized
$keys = array();
$keys = get_auth_keys($viewcatkey);
// mark each forums
for ($i=0; $i < count($keys['id']); $i++) if ($tree['type'][ $keys['idx'][$i] ] == POST_FORUM_URL)
{
$forum_id = $tree['id'][ $keys['idx'][$i] ];
$sql = "SELECT MAX(post_time) AS last_post FROM " . POSTS_TABLE . " WHERE forum_id = $forum_id";
if ( !($result = $db->sql_query($sql)) ) message_die(GENERAL_ERROR, 'Could not obtain forums information', '', __LINE__, __FILE__, $sql);
if ( $row = $db->sql_fetchrow($result) )
{
$tracking_forums = ( isset($HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_f']) ) ? unserialize($HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_f']) : array();
$tracking_topics = ( isset($HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_t']) ) ? unserialize($HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_t']) : array();
if ( ( count($tracking_forums) + count($tracking_topics) ) >= 150 && empty($tracking_forums[$forum_id]) )
{
asort($tracking_forums);
unset($tracking_forums[key($tracking_forums)]);
}
if ( $row['last_post'] > $userdata['user_lastvisit'] )
{
$tracking_forums[$forum_id] = time();
setcookie($board_config['cookie_name'] . '_f', serialize($tracking_forums), 0, $board_config['cookie_path'], $board_config['cookie_domain'], $board_config['cookie_secure']);
}
}
}
}
$template->assign_vars(array(
"META" => '<meta http-equiv="refresh" content="3;url=' .append_sid("index.$phpEx?" . POST_CAT_URL . "=$viewcat") . '">')
);
}
//-- fin mod : categories hierarchy ----------------------------------------------------------------
$message = $lang['Forums_marked_read'] . '<br /><br />' . sprintf($lang['Click_return_index'], '<a href="' . append_sid("index.$phpEx") . '">', '</a> ');
message_die(GENERAL_MESSAGE, $message);
}
//
// End handle marking posts
//
//-- mod : categories hierarchy --------------------------------------------------------------------
//-- delete
// $tracking_topics = ( isset($HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_t']) ) ? unserialize($HTTP_COOKIE_VARS[$board_config['cookie_name'] . "_t"]) : array();
// $tracking_forums = ( isset($HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_f']) ) ? unserialize($HTTP_COOKIE_VARS[$board_config['cookie_name'] . "_f"]) : array();
//-- fin mod : categories hierarchy ----------------------------------------------------------------
//
// If you don't use these stats on your index you may want to consider
// removing them
//
//-- mod : categories hierarchy --------------------------------------------------------------------
//-- delete
// $total_posts = get_db_stat('postcount');
// $total_users = get_db_stat('usercount');
//-- add
include_once($phpbb_root_path . 'includes/mods_settings/mod_categories_hierarchy.' . $phpEx);
if ( ($board_config['display_viewonline'] == 2) || ( ($viewcat < 0) && ($board_config['display_viewonline'] == 1) ) )
{
if ( empty($board_config['max_posts']) || empty($board_config['max_users']) )
{
board_stats();
}
$total_posts = $board_config['max_posts'];
$total_users = $board_config['max_users'];
//-- fin mod : categories hierarchy ----------------------------------------------------------------
$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'];
}
//-- mod : categories hierarchy --------------------------------------------------------------------
//-- add
}
//-- fin mod : categories hierarchy ----------------------------------------------------------------
//
// Start page proper
//
//-- mod : categories hierarchy --------------------------------------------------------------------
//-- delete
/
/
//-- fin mod : categories hierarchy ----------------------------------------------------------------
//
// Start output of page
//
//-- mod : categories hierarchy --------------------------------------------------------------------
//-- add
// set the parm of the mark read func
$mark = ($viewcat == -1 ) ? '' : '&' . POST_CAT_URL . '=' . $viewcat;
// monitor the board statistic
if (($board_config['display_viewonline'] == 2) || (($viewcat < 0) && ($board_config['display_viewonline'] == 1)))
{
//-- fin mod : categories hierarchy ----------------------------------------------------------------
define('SHOW_ONLINE', true);
//-- mod : categories hierarchy --------------------------------------------------------------------
//-- add
}
//-- fin mod : categories hierarchy ----------------------------------------------------------------
$page_title = $lang['Index'];
include($phpbb_root_path . 'includes/page_header.'.$phpEx);
$template->set_filenames(array(
'body' => 'index_body.tpl')
);
$template->assign_vars(array(
'TOTAL_POSTS' => sprintf($l_total_post_s, $total_posts),
'TOTAL_USERS' => sprintf($l_total_user_s, $total_users),
'NEWEST_USER' => sprintf($lang['Newest_user'], '<a href="' . append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=$newest_uid") . '">', $newest_user, '</a>'),
'FORUM_IMG' => $images['forum'],
'FORUM_NEW_IMG' => $images['forum_new'],
'FORUM_LOCKED_IMG' => $images['forum_locked'],
'L_FORUM' => $lang['Forum'],
'L_TOPICS' => $lang['Topics'],
'L_REPLIES' => $lang['Replies'],
'L_VIEWS' => $lang['Views'],
'L_POSTS' => $lang['Posts'],
'L_LASTPOST' => $lang['Last_Post'],
'L_NO_NEW_POSTS' => $lang['No_new_posts'],
'L_NEW_POSTS' => $lang['New_posts'],
'L_NO_NEW_POSTS_LOCKED' => $lang['No_new_posts_locked'],
'L_NEW_POSTS_LOCKED' => $lang['New_posts_locked'],
'L_ONLINE_EXPLAIN' => $lang['Online_explain'],
// Bookie Mod
'BOOKIE_START' => $lang['bookie_start'],
'BOOKIE_COUNT' => $total_bets,
'BOOKIE_END' => $lang['bookie_finish'],
'ASSIGN_START' => $lang['bookie_assign_start'],
'ASSIGN_COUNT' => $count_assigned,
'ASSIGN_END' => $lang['bookie_assign_finish'],
'BOOKIE_HEADER' => $lang['bookie_header'],
'BOOKIE_IMAGE' => $bookie_image,
'ASSIGN_IMAGE' => $assign_image,
// End Bookie Mod
'L_MODERATOR' => $lang['Moderators'],
'L_FORUM_LOCKED' => $lang['Forum_is_locked'],
'L_MARK_FORUMS_READ' => $lang['Mark_all_forums'],
//-- mod : categories hierarchy --------------------------------------------------------------------
// here we added
// $mark
//-- modify
'U_MARK_READ' => append_sid("index.$phpEx?mark=forums$mark"))
//-- fin mod : categories hierarchy ----------------------------------------------------------------
);
//
// Okay, let's build the index
//
//-- mod : categories hierarchy --------------------------------------------------------------------
//-- delete
/
/
// don't display the board statistics
if ( ($board_config['display_viewonline'] == 2) || ( ($viewcat < 0) && ($board_config['display_viewonline'] == 1) ) )
{
$template->assign_block_vars('disable_viewonline', array());
}
// display the index
$display = display_index($viewcatkey);
if ( !$display )
//-- fin mod : categories hierarchy ----------------------------------------------------------------
{
message_die(GENERAL_MESSAGE, $lang['No_forums']);
}
//
// Generate the page
//
$template->pparse('body');
include($phpbb_root_path . 'includes/page_tail.'.$phpEx);
?>