Problem z PA
: 01 listopada 2009, 10:00
Witam,
Gdy chcę wejść do panelu Administracyjnego pojawia mi się napis
Parse error: syntax error, unexpected ';' .../public_html/forum/admin/index.php on line 964
fragment index.php
Proszę o pomoc
$sql = "SELECT u.user_id, u.username, u.user_session_time, u.user_session_start, u.user_session_time, u.user_session_page, u.user_level, u.user_jr, s.session_logged_in, s.session_ip, s.session_start
FROM (" . USERS_TABLE . " u, " . SESSIONS_TABLE . " s)
WHERE s.session_logged_in = " . TRUE . "
AND u.user_id = s.session_user_id
AND u.user_id <> " . ANONYMOUS . "
AND s.session_time >= " . ( CR_TIME - 300 ) . "
ORDER BY u.user_session_time DESC";
if(!$result = $db->sql_query($sql))
{
message_die(GENERAL_ERROR, "Couldn't obtain regd user/online information.", "", __LINE__, __FILE__, $sql);
}
$onlinerow_reg = $db->sql_fetchrowset($result);
$sql = "SELECT session_page, session_logged_in, session_time, session_ip, session_start
FROM " . SESSIONS_TABLE . "
WHERE session_logged_in = 0
AND session_time >= " . ( CR_TIME - 300 ) . "
ORDER BY session_ip ASC";
if(!$result = $db->sql_query($sql))
{
message_die(GENERAL_ERROR, "Couldn't obtain guest user/online information.", "", __LINE__, __FILE__, $sql);
}
$onlinerow_guest = $db->sql_fetchrowset($result);
$sql = "SELECT forum_name, forum_id
FROM " . FORUMS_TABLE;
if($forums_result = $db->sql_query($sql))
{
while($forumsrow = $db->sql_fetchrow($forums_result))
{
$forum_data[$forumsrow['forum_id']] = $forumsrow['forum_name'];
}
}
else
{
message_die(GENERAL_ERROR, "Couldn't obtain user/online forums information.", "", __LINE__, __FILE__, $sql);
}
$reg_userid_ary = array();
if( count($onlinerow_reg) )
{
$registered_users = 0;
for($i = 0; $i < count($onlinerow_reg); $i++)
{
if( !inarray($onlinerow_reg[$i]['user_id'], $reg_userid_ary) )
{
$reg_userid_ary[] = $onlinerow_reg[$i]['user_id'];
$username = $onlinerow_reg[$i]['username'];
$colored_username = color_username($onlinerow_reg[$i]['user_level'], $onlinerow_reg[$i]['user_jr'], $onlinerow_reg[$i]['user_id'], $username);
$username = $colored_username[0];
if( $onlinerow_reg[$i]['user_allow_viewonline'] || $userdata['user_level'] == ADMIN )
{
$registered_users++;
$hidden = FALSE;
}
else
{
$hidden_users++;
$hidden = TRUE;
}
if( $onlinerow_reg[$i]['user_session_page'] < 1 )
{
$location_url = "#";
switch($onlinerow_reg[$i]['user_session_page'])
{
case PAGE_INDEX:
$location = $lang['Forum_index'];
break;
case PAGE_POSTING:
$location = $lang['Posting_message'];
break;
case PAGE_LOGIN:
$location = $lang['Logging_on'];
break;
case PAGE_SEARCH:
$location = $lang['Searching_forums'];
break;
case PAGE_PROFILE:
$location = $lang['Viewing_profile'];
break;
case PAGE_VIEWONLINE:
$location = $lang['Viewing_online'];
break;
case PAGE_VIEWMEMBERS:
$location = $lang['Viewing_member_list'];
break;
case PAGE_TOPIC_VIEW:
$location = $lang['Viewing_topic'];
break;
case PAGE_PRIVMSGS:
$location = $lang['Viewing_priv_msgs'];
break;
case PAGE_FAQ:
$location = $lang['Viewing_FAQ'];
break;
case PAGE_STAFF:
$location = $lang['Staff'];
break;
case PAGE_ALBUM:
$location = $lang['Album'];
break;
case PAGE_DOWNLOAD:
$location = $lang['Downloads2'];
break;
case PAGE_GROUPCP:
$location = $lang['Usergroups'];
break;
case PAGE_STATISTICS:
$location = $lang['Statistics'];
break;
case PAGE_SHOUTBOX:
$location = 'ShoutBox';
break;
case PAGE_ADMIN_PANEL:
$location = $lang['Admin_panel'];
break;
default:
$location = $lang['Forum_index'];
}
}
else
{
$location_url = append_sid("admin_forums.$phpEx?mode=editforum&" . POST_FORUM_URL . "=" . $onlinerow_reg[$i]['user_session_page']);
$location = $forum_data[$onlinerow_reg[$i]['user_session_page']];
}
$row_color = ( $registered_users % 2 ) ? $theme['td_color1'] : $theme['td_color2'];
$row_class = ( $registered_users % 2 ) ? $theme['td_class1'] : $theme['td_class2'];
$reg_ip = decode_ip($onlinerow_reg[$i]['session_ip']);
$user_time_online = ($onlinerow_reg[$i]['user_session_start']) ? $onlinerow_reg[$i]['user_session_time'] - $onlinerow_reg[$i]['user_session_start'] : CR_TIME - $onlinerow_reg[$i]['session_start'];
$time_online = (($user_time_online) < 3600) ? round( ($user_time_online) / 60, 0 ) : round( ($user_time_online) / 60 / 60, 1 );
$lang_online = (($user_time_online) < 3600) ? $lang['online_minutes'] : $lang['online_hours'];
$template->assign_block_vars("reg_user_row", array(
"ROW_COLOR" => "#" . $row_color,
"ROW_CLASS" => $row_class,
"USERNAME" => $username,
"USERNAME_COLOR" => $colored_username[1],
"TIME" => sprintf($lang_online, $time_online),
"STARTED" => create_date($board_config['default_dateformat'], $onlinerow_reg[$i]['session_start'], $board_config['board_timezone']),
"LASTUPDATE" => create_date($board_config['default_dateformat'], $onlinerow_reg[$i]['user_session_time'], $board_config['board_timezone']),
"FORUM_LOCATION" => $location,
"IP_ADDRESS" => $reg_ip,
"HOST" => (isset($HTTP_GET_VARS['hosts']) && $reg_host = @gethostbyaddr($reg_ip)) ? ' (' . $reg_host . ')' : '',
"U_WHOIS_IP" => $board_config['address_whois'] . $reg_ip,
"U_USER_PROFILE" => append_sid("../profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=" . $onlinerow_reg[$i]['user_id']),
"U_FORUM_LOCATION" => append_sid($location_url))
);
}
}
}
else
{
$template->assign_vars(array(
"L_NO_REGISTERED_USERS_BROWSING"=> $lang['No_users_browsing'])
);
}
//
// Guest users
//
if( count($onlinerow_guest) )
{
$guest_users = 0;
for($i = 0; $i < count($onlinerow_guest); $i++)
{
$guest_userip_ary[] = $onlinerow_guest[$i]['session_ip'];
$guest_users++;
if( $onlinerow_guest[$i]['session_page'] < 1 )
{
switch( $onlinerow_guest[$i]['session_page'] )
{
case PAGE_INDEX:
$location = $lang['Forum_index'];
break;
case PAGE_POSTING:
$location = $lang['Posting_message'];
break;
case PAGE_LOGIN:
$location = $lang['Logging_on'];
break;
case PAGE_SEARCH:
$location = $lang['Searching_forums'];
break;
case PAGE_PROFILE:
$location = $lang['Viewing_profile'];
break;
case PAGE_VIEWONLINE:
$location = $lang['Viewing_online'];
break;
case PAGE_VIEWMEMBERS:
$location = $lang['Viewing_member_list'];
break;
case PAGE_TOPIC_VIEW:
$location = $lang['Viewing_topic'];
break;
case PAGE_FAQ:
$location = $lang['Viewing_FAQ'];
break;
case PAGE_STAFF:
$location = $lang['Staff'];
break;
case PAGE_ALBUM:
$location = $lang['Album'];
break;
case PAGE_DOWNLOAD:
$location = $lang['Downloads2'];
break;
case PAGE_GROUPCP:
$location = $lang['Usergroups'];
break;
case PAGE_STATISTICS:
$location = $lang['Statistics'];
break;
case PAGE_SHOUTBOX:
$location = 'ShoutBox';
break;
default:
$location = $lang['Forum_index'];
}
}
else
{
$location_url = append_sid("admin_forums.$phpEx?mode=editforum&" . POST_FORUM_URL . "=" . $onlinerow_guest[$i]['session_page']);
$location = $forum_data[$onlinerow_guest[$i]['session_page']];
}
$row_color = ( $guest_users % 2 ) ? $theme['td_color1'] : $theme['td_color2'];
$row_class = ( $guest_users % 2 ) ? $theme['td_class1'] : $theme['td_class2'];
$guest_ip = decode_ip($onlinerow_guest[$i]['session_ip']);
$time_online = ((CR_TIME - $onlinerow_guest[$i]['session_start']) < 3600) ? round( (CR_TIME - $onlinerow_guest[$i]['session_start']) / 60, 0 ) : round( (CR_TIME - $onlinerow_guest[$i]['session_start']) / 60 / 60, 1 );
$lang_online = ((CR_TIME - $onlinerow_guest[$i]['session_start']) < 3600) ? $lang['online_minutes'] : $lang['online_hours'];
$template->assign_block_vars('guest_user_row', array(
"ROW_COLOR" => "#" . $row_color,
"ROW_CLASS" => $row_class,
"USERNAME" => $lang['Guest'],
"TIME" => sprintf($lang_online, $time_online),
"STARTED" => create_date($board_config['default_dateformat'], $onlinerow_guest[$i]['session_start'], $board_config['board_timezone']),
"LASTUPDATE" => create_date($board_config['default_dateformat'], $onlinerow_guest[$i]['session_time'], $board_config['board_timezone']),
"FORUM_LOCATION" => $location,
"IP_ADDRESS" => $guest_ip,
"HOST" => (isset($HTTP_GET_VARS['hosts']) && $guest_host = @gethostbyaddr($guest_ip)) ? ' (' . $guest_host . ')' : '',
"U_WHOIS_IP" => $board_config['address_whois'] . $guest_ip,
"U_FORUM_LOCATION" => append_sid($location_url))
);
}
}
else
{
$template->assign_vars(array(
"L_NO_GUESTS_BROWSING" => $lang['No_users_browsing'])
);
}
$template->assign_vars(array(
"LINK_SHOW_HOSTS" => (isset($HTTP_GET_VARS['hosts'])) ? '<br />' : '<a href="' . append_sid("index.$phpEx?pane=right&hosts=1") . '">' . $lang['Show_hosts'] . '</a>')
);
include($phpbb_root_path . 'includes/functions_log.'.$phpEx);
log_action('admin', '', $userdata['user_id'], $userdata['username']);
$template->pparse('body');
include('./page_footer_admin.'.$phpEx);
}
else
{
//
// Generate frameset
//
$template->set_filenames(array(
"body" => "admin/index_frameset.tpl")
);
$template->assign_vars(array(
"S_FRAME_NAV" => append_sid("index.$phpEx?pane=left"),
"S_FRAME_MAIN" => append_sid("index.$phpEx?pane=right"))
);
header ("Expires: " . gmdate("D, d M Y H:i:s", CR_TIME) . " GMT");
header ("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
$template->pparse("body");
$db->sql_close();
exit;
}
echo;
?>
Gdy chcę wejść do panelu Administracyjnego pojawia mi się napis
Parse error: syntax error, unexpected ';' .../public_html/forum/admin/index.php on line 964
fragment index.php
Proszę o pomoc
$sql = "SELECT u.user_id, u.username, u.user_session_time, u.user_session_start, u.user_session_time, u.user_session_page, u.user_level, u.user_jr, s.session_logged_in, s.session_ip, s.session_start
FROM (" . USERS_TABLE . " u, " . SESSIONS_TABLE . " s)
WHERE s.session_logged_in = " . TRUE . "
AND u.user_id = s.session_user_id
AND u.user_id <> " . ANONYMOUS . "
AND s.session_time >= " . ( CR_TIME - 300 ) . "
ORDER BY u.user_session_time DESC";
if(!$result = $db->sql_query($sql))
{
message_die(GENERAL_ERROR, "Couldn't obtain regd user/online information.", "", __LINE__, __FILE__, $sql);
}
$onlinerow_reg = $db->sql_fetchrowset($result);
$sql = "SELECT session_page, session_logged_in, session_time, session_ip, session_start
FROM " . SESSIONS_TABLE . "
WHERE session_logged_in = 0
AND session_time >= " . ( CR_TIME - 300 ) . "
ORDER BY session_ip ASC";
if(!$result = $db->sql_query($sql))
{
message_die(GENERAL_ERROR, "Couldn't obtain guest user/online information.", "", __LINE__, __FILE__, $sql);
}
$onlinerow_guest = $db->sql_fetchrowset($result);
$sql = "SELECT forum_name, forum_id
FROM " . FORUMS_TABLE;
if($forums_result = $db->sql_query($sql))
{
while($forumsrow = $db->sql_fetchrow($forums_result))
{
$forum_data[$forumsrow['forum_id']] = $forumsrow['forum_name'];
}
}
else
{
message_die(GENERAL_ERROR, "Couldn't obtain user/online forums information.", "", __LINE__, __FILE__, $sql);
}
$reg_userid_ary = array();
if( count($onlinerow_reg) )
{
$registered_users = 0;
for($i = 0; $i < count($onlinerow_reg); $i++)
{
if( !inarray($onlinerow_reg[$i]['user_id'], $reg_userid_ary) )
{
$reg_userid_ary[] = $onlinerow_reg[$i]['user_id'];
$username = $onlinerow_reg[$i]['username'];
$colored_username = color_username($onlinerow_reg[$i]['user_level'], $onlinerow_reg[$i]['user_jr'], $onlinerow_reg[$i]['user_id'], $username);
$username = $colored_username[0];
if( $onlinerow_reg[$i]['user_allow_viewonline'] || $userdata['user_level'] == ADMIN )
{
$registered_users++;
$hidden = FALSE;
}
else
{
$hidden_users++;
$hidden = TRUE;
}
if( $onlinerow_reg[$i]['user_session_page'] < 1 )
{
$location_url = "#";
switch($onlinerow_reg[$i]['user_session_page'])
{
case PAGE_INDEX:
$location = $lang['Forum_index'];
break;
case PAGE_POSTING:
$location = $lang['Posting_message'];
break;
case PAGE_LOGIN:
$location = $lang['Logging_on'];
break;
case PAGE_SEARCH:
$location = $lang['Searching_forums'];
break;
case PAGE_PROFILE:
$location = $lang['Viewing_profile'];
break;
case PAGE_VIEWONLINE:
$location = $lang['Viewing_online'];
break;
case PAGE_VIEWMEMBERS:
$location = $lang['Viewing_member_list'];
break;
case PAGE_TOPIC_VIEW:
$location = $lang['Viewing_topic'];
break;
case PAGE_PRIVMSGS:
$location = $lang['Viewing_priv_msgs'];
break;
case PAGE_FAQ:
$location = $lang['Viewing_FAQ'];
break;
case PAGE_STAFF:
$location = $lang['Staff'];
break;
case PAGE_ALBUM:
$location = $lang['Album'];
break;
case PAGE_DOWNLOAD:
$location = $lang['Downloads2'];
break;
case PAGE_GROUPCP:
$location = $lang['Usergroups'];
break;
case PAGE_STATISTICS:
$location = $lang['Statistics'];
break;
case PAGE_SHOUTBOX:
$location = 'ShoutBox';
break;
case PAGE_ADMIN_PANEL:
$location = $lang['Admin_panel'];
break;
default:
$location = $lang['Forum_index'];
}
}
else
{
$location_url = append_sid("admin_forums.$phpEx?mode=editforum&" . POST_FORUM_URL . "=" . $onlinerow_reg[$i]['user_session_page']);
$location = $forum_data[$onlinerow_reg[$i]['user_session_page']];
}
$row_color = ( $registered_users % 2 ) ? $theme['td_color1'] : $theme['td_color2'];
$row_class = ( $registered_users % 2 ) ? $theme['td_class1'] : $theme['td_class2'];
$reg_ip = decode_ip($onlinerow_reg[$i]['session_ip']);
$user_time_online = ($onlinerow_reg[$i]['user_session_start']) ? $onlinerow_reg[$i]['user_session_time'] - $onlinerow_reg[$i]['user_session_start'] : CR_TIME - $onlinerow_reg[$i]['session_start'];
$time_online = (($user_time_online) < 3600) ? round( ($user_time_online) / 60, 0 ) : round( ($user_time_online) / 60 / 60, 1 );
$lang_online = (($user_time_online) < 3600) ? $lang['online_minutes'] : $lang['online_hours'];
$template->assign_block_vars("reg_user_row", array(
"ROW_COLOR" => "#" . $row_color,
"ROW_CLASS" => $row_class,
"USERNAME" => $username,
"USERNAME_COLOR" => $colored_username[1],
"TIME" => sprintf($lang_online, $time_online),
"STARTED" => create_date($board_config['default_dateformat'], $onlinerow_reg[$i]['session_start'], $board_config['board_timezone']),
"LASTUPDATE" => create_date($board_config['default_dateformat'], $onlinerow_reg[$i]['user_session_time'], $board_config['board_timezone']),
"FORUM_LOCATION" => $location,
"IP_ADDRESS" => $reg_ip,
"HOST" => (isset($HTTP_GET_VARS['hosts']) && $reg_host = @gethostbyaddr($reg_ip)) ? ' (' . $reg_host . ')' : '',
"U_WHOIS_IP" => $board_config['address_whois'] . $reg_ip,
"U_USER_PROFILE" => append_sid("../profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=" . $onlinerow_reg[$i]['user_id']),
"U_FORUM_LOCATION" => append_sid($location_url))
);
}
}
}
else
{
$template->assign_vars(array(
"L_NO_REGISTERED_USERS_BROWSING"=> $lang['No_users_browsing'])
);
}
//
// Guest users
//
if( count($onlinerow_guest) )
{
$guest_users = 0;
for($i = 0; $i < count($onlinerow_guest); $i++)
{
$guest_userip_ary[] = $onlinerow_guest[$i]['session_ip'];
$guest_users++;
if( $onlinerow_guest[$i]['session_page'] < 1 )
{
switch( $onlinerow_guest[$i]['session_page'] )
{
case PAGE_INDEX:
$location = $lang['Forum_index'];
break;
case PAGE_POSTING:
$location = $lang['Posting_message'];
break;
case PAGE_LOGIN:
$location = $lang['Logging_on'];
break;
case PAGE_SEARCH:
$location = $lang['Searching_forums'];
break;
case PAGE_PROFILE:
$location = $lang['Viewing_profile'];
break;
case PAGE_VIEWONLINE:
$location = $lang['Viewing_online'];
break;
case PAGE_VIEWMEMBERS:
$location = $lang['Viewing_member_list'];
break;
case PAGE_TOPIC_VIEW:
$location = $lang['Viewing_topic'];
break;
case PAGE_FAQ:
$location = $lang['Viewing_FAQ'];
break;
case PAGE_STAFF:
$location = $lang['Staff'];
break;
case PAGE_ALBUM:
$location = $lang['Album'];
break;
case PAGE_DOWNLOAD:
$location = $lang['Downloads2'];
break;
case PAGE_GROUPCP:
$location = $lang['Usergroups'];
break;
case PAGE_STATISTICS:
$location = $lang['Statistics'];
break;
case PAGE_SHOUTBOX:
$location = 'ShoutBox';
break;
default:
$location = $lang['Forum_index'];
}
}
else
{
$location_url = append_sid("admin_forums.$phpEx?mode=editforum&" . POST_FORUM_URL . "=" . $onlinerow_guest[$i]['session_page']);
$location = $forum_data[$onlinerow_guest[$i]['session_page']];
}
$row_color = ( $guest_users % 2 ) ? $theme['td_color1'] : $theme['td_color2'];
$row_class = ( $guest_users % 2 ) ? $theme['td_class1'] : $theme['td_class2'];
$guest_ip = decode_ip($onlinerow_guest[$i]['session_ip']);
$time_online = ((CR_TIME - $onlinerow_guest[$i]['session_start']) < 3600) ? round( (CR_TIME - $onlinerow_guest[$i]['session_start']) / 60, 0 ) : round( (CR_TIME - $onlinerow_guest[$i]['session_start']) / 60 / 60, 1 );
$lang_online = ((CR_TIME - $onlinerow_guest[$i]['session_start']) < 3600) ? $lang['online_minutes'] : $lang['online_hours'];
$template->assign_block_vars('guest_user_row', array(
"ROW_COLOR" => "#" . $row_color,
"ROW_CLASS" => $row_class,
"USERNAME" => $lang['Guest'],
"TIME" => sprintf($lang_online, $time_online),
"STARTED" => create_date($board_config['default_dateformat'], $onlinerow_guest[$i]['session_start'], $board_config['board_timezone']),
"LASTUPDATE" => create_date($board_config['default_dateformat'], $onlinerow_guest[$i]['session_time'], $board_config['board_timezone']),
"FORUM_LOCATION" => $location,
"IP_ADDRESS" => $guest_ip,
"HOST" => (isset($HTTP_GET_VARS['hosts']) && $guest_host = @gethostbyaddr($guest_ip)) ? ' (' . $guest_host . ')' : '',
"U_WHOIS_IP" => $board_config['address_whois'] . $guest_ip,
"U_FORUM_LOCATION" => append_sid($location_url))
);
}
}
else
{
$template->assign_vars(array(
"L_NO_GUESTS_BROWSING" => $lang['No_users_browsing'])
);
}
$template->assign_vars(array(
"LINK_SHOW_HOSTS" => (isset($HTTP_GET_VARS['hosts'])) ? '<br />' : '<a href="' . append_sid("index.$phpEx?pane=right&hosts=1") . '">' . $lang['Show_hosts'] . '</a>')
);
include($phpbb_root_path . 'includes/functions_log.'.$phpEx);
log_action('admin', '', $userdata['user_id'], $userdata['username']);
$template->pparse('body');
include('./page_footer_admin.'.$phpEx);
}
else
{
//
// Generate frameset
//
$template->set_filenames(array(
"body" => "admin/index_frameset.tpl")
);
$template->assign_vars(array(
"S_FRAME_NAV" => append_sid("index.$phpEx?pane=left"),
"S_FRAME_MAIN" => append_sid("index.$phpEx?pane=right"))
);
header ("Expires: " . gmdate("D, d M Y H:i:s", CR_TIME) . " GMT");
header ("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
$template->pparse("body");
$db->sql_close();
exit;
}
echo;
?>