|
From: Paul S. O. <ps...@us...> - 2001-11-03 13:54:08
|
Update of /cvsroot/phpbb/phpBB2
In directory usw-pr-cvs1:/tmp/cvs-serv17905
Modified Files:
viewonline.php viewforum.php
Log Message:
Fixed various issues and bugs
Index: viewonline.php
===================================================================
RCS file: /cvsroot/phpbb/phpBB2/viewonline.php,v
retrieving revision 1.34
retrieving revision 1.35
diff -C2 -r1.34 -r1.35
*** viewonline.php 2001/11/02 22:36:34 1.34
--- viewonline.php 2001/11/03 13:54:03 1.35
***************
*** 34,38 ****
--- 34,56 ----
//
+ // ---------------
+ // Begin functions
//
+ function inarray($needle, $haystack)
+ {
+ for($i = 0; $i < sizeof($haystack); $i++ )
+ {
+ if( $haystack[$i] == $needle )
+ {
+ return true;
+ }
+ }
+ return false;
+ }
+ //
+ // End functions
+ // -------------
+
+ //
// Output page header and load
// viewonline template
***************
*** 73,77 ****
$onlinerow_reg = $db->sql_fetchrowset($result);
! $sql = "SELECT session_page, session_logged_in, session_time
FROM " . SESSIONS_TABLE . "
WHERE session_logged_in = 0
--- 91,95 ----
$onlinerow_reg = $db->sql_fetchrowset($result);
! $sql = "SELECT session_page, session_logged_in, session_time, session_ip
FROM " . SESSIONS_TABLE . "
WHERE session_logged_in = 0
***************
*** 110,115 ****
--- 128,141 ----
//
+ // Get auth data
+ //
+ $is_auth_ary = array();
+ $is_auth_ary = auth(AUTH_VIEW, AUTH_LIST_ALL, $userdata);
+
+ //
// Registered users ...
//
+ $reg_userid_ary = array();
+
if( count($onlinerow_reg) )
{
***************
*** 121,130 ****
for($i = 0; $i < count($onlinerow_reg); $i++)
{
! if( !eregi("," . $onlinerow_reg[$i]['user_id'], $displayed_userid_list) )
{
if( $onlinerow_reg[$i]['user_allow_viewonline'] || $userdata['user_level'] == ADMIN )
{
- $displayed_userid_list .= "," . $onlinerow_reg[$i]['user_id'];
-
$username = $onlinerow_reg[$i]['username'];
$hidden = FALSE;
--- 147,154 ----
for($i = 0; $i < count($onlinerow_reg); $i++)
{
! if( !inarray($onlinerow_reg[$i]['user_id'], $reg_userid_ary) )
{
if( $onlinerow_reg[$i]['user_allow_viewonline'] || $userdata['user_level'] == ADMIN )
{
$username = $onlinerow_reg[$i]['username'];
$hidden = FALSE;
***************
*** 133,138 ****
else
{
- $displayed_userid_list .= "," . $onlinerow_reg[$i]['user_id'];
-
$username = $onlinerow_reg[$i]['username'];
$hidden = TRUE;
--- 157,160 ----
***************
*** 140,144 ****
}
! if($onlinerow_reg[$i]['session_page'] < 1)
{
switch($onlinerow_reg[$i]['session_page'])
--- 162,166 ----
}
! if( $onlinerow_reg[$i]['session_page'] < 1 || !$is_auth_ary[$onlinerow_reg[$i]['session_page']]['auth_view'] )
{
switch($onlinerow_reg[$i]['session_page'])
***************
*** 210,219 ****
}
- $l_h_user_s = ($hidden_users == 1) ? $lang['User'] : $lang['Users'];
- $l_r_user_s = ($registered_users == 1) ? $lang['User'] : $lang['Users'];
- $l_is_are = ($registered_users == 1) ? $lang['is'] : $lang['are'];
-
$template->assign_vars(array(
! "TOTAL_REGISTERED_USERS_ONLINE" => $lang['There'] . " $l_is_are $logged_visible_online " . $lang['Registered'] . " $l_r_user_s " . $lang['and'] . " $logged_hidden_online " . $lang['Hidden'] . " $l_h_user_s " . $lang['online'])
);
--- 232,237 ----
}
$template->assign_vars(array(
! "TOTAL_REGISTERED_USERS_ONLINE" => sprintf($lang['Reg_users_online'], $registered_users, $hidden_users))
);
***************
*** 222,226 ****
{
$template->assign_vars(array(
! "TOTAL_REGISTERED_USERS_ONLINE" => $lang['There'] . " " . $lang['are'] . " 0 " . $lang['Registered'] . " " . $lang['Users'] . " " . $lang['and'] . " 0 " . $lang['Hidden'] . " " . $lang['Users'] . " " . $lang['online'],
"L_NO_REGISTERED_USERS_BROWSING" => $lang['No_users_browsing'])
);
--- 240,244 ----
{
$template->assign_vars(array(
! "TOTAL_REGISTERED_USERS_ONLINE" => sprintf($lang['Reg_users_online'], 0, 0),
"L_NO_REGISTERED_USERS_BROWSING" => $lang['No_users_browsing'])
);
***************
*** 230,233 ****
--- 248,253 ----
// Guest users
//
+ $guest_userip_ary = array();
+
if( count($onlinerow_guest) )
{
***************
*** 236,311 ****
for($i = 0; $i < count($onlinerow_guest); $i++)
{
! $guest_users++;
!
! if($onlinerow_guest[$i]['session_page'] < 1)
{
! switch($onlinerow_guest[$i]['session_page'])
{
! case PAGE_INDEX:
! $location = $lang['Forum_index'];
! $location_url = "index.$phpEx";
! break;
! case PAGE_POSTING:
! $location = $lang['Posting_message'];
! $location_url = "index.$phpEx";
! break;
! case PAGE_LOGIN:
! $location = $lang['Logging_on'];
! $location_url = "index.$phpEx";
! break;
! case PAGE_SEARCH:
! $location = $lang['Searching_forums'];
! $location_url = "search.$phpEx";
! break;
! case PAGE_PROFILE:
! $location = $lang['Viewing_profile'];
! $location_url = "index.$phpEx";
! break;
! case PAGE_VIEWONLINE:
! $location = $lang['Viewing_online'];
! $location_url = "viewonline.$phpEx";
! break;
! case PAGE_VIEWMEMBERS:
! $location = $lang['Viewing_member_list'];
! $location_url = "memberlist.$phpEx";
! break;
! case PAGE_PRIVMSGS:
! $location = $lang['Viewing_priv_msgs'];
! $location_url = "privmsg.$phpEx";
! break;
! case PAGE_FAQ:
! $location = $lang['Viewing_FAQ'];
! $location_url = "faq.$phpEx";
! break;
! default:
! $location = $lang['Forum_index'];
! $location_url = "index.$phpEx";
}
- }
- else
- {
- $location_url = append_sid("viewforum.$phpEx?" . 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'];
! $template->assign_block_vars("guest_user_row", array(
! "ROW_COLOR" => "#" . $row_color,
! "ROW_CLASS" => $row_class,
! "USERNAME" => $lang['Guest'],
! "LASTUPDATE" => create_date($board_config['default_dateformat'], $onlinerow_guest[$i]['session_time'], $board_config['board_timezone']),
! "LOCATION" => $location,
! "U_FORUM_LOCATION" => append_sid($location_url))
! );
}
! $l_g_user_s = ($guest_users == 1) ? $lang['User'] : $lang['Users'];
! $l_is_are = ($guest_users == 1) ? $lang['is'] : $lang['are'];
$template->assign_vars(array(
! "TOTAL_GUEST_USERS_ONLINE" => $lang['There'] . " $l_is_are $guests_online " . $lang['Guest'] . " $l_g_user_s " . $lang['online'])
);
--- 256,333 ----
for($i = 0; $i < count($onlinerow_guest); $i++)
{
! if( !inarray($onlinerow_guest[$i]['session_ip'], $guest_userip_ary) )
{
! $guest_users++;
!
! if($onlinerow_guest[$i]['session_page'] < 1 || !$is_auth_ary[$onlinerow_reg[$i]['session_page']]['auth_view'] )
! {
! switch($onlinerow_guest[$i]['session_page'])
! {
! case PAGE_INDEX:
! $location = $lang['Forum_index'];
! $location_url = "index.$phpEx";
! break;
! case PAGE_POSTING:
! $location = $lang['Posting_message'];
! $location_url = "index.$phpEx";
! break;
! case PAGE_LOGIN:
! $location = $lang['Logging_on'];
! $location_url = "index.$phpEx";
! break;
! case PAGE_SEARCH:
! $location = $lang['Searching_forums'];
! $location_url = "search.$phpEx";
! break;
! case PAGE_PROFILE:
! $location = $lang['Viewing_profile'];
! $location_url = "index.$phpEx";
! break;
! case PAGE_VIEWONLINE:
! $location = $lang['Viewing_online'];
! $location_url = "viewonline.$phpEx";
! break;
! case PAGE_VIEWMEMBERS:
! $location = $lang['Viewing_member_list'];
! $location_url = "memberlist.$phpEx";
! break;
! case PAGE_PRIVMSGS:
! $location = $lang['Viewing_priv_msgs'];
! $location_url = "privmsg.$phpEx";
! break;
! case PAGE_FAQ:
! $location = $lang['Viewing_FAQ'];
! $location_url = "faq.$phpEx";
! break;
! default:
! $location = $lang['Forum_index'];
! $location_url = "index.$phpEx";
! }
! }
! else
{
! $location_url = append_sid("viewforum.$phpEx?" . 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'];
! $template->assign_block_vars("guest_user_row", array(
! "ROW_COLOR" => "#" . $row_color,
! "ROW_CLASS" => $row_class,
! "USERNAME" => $lang['Guest'],
! "LASTUPDATE" => create_date($board_config['default_dateformat'], $onlinerow_guest[$i]['session_time'], $board_config['board_timezone']),
! "LOCATION" => $location,
! "U_FORUM_LOCATION" => append_sid($location_url))
! );
! }
}
! $l_g_user_s = ( $guest_users == 1 ) ? $lang['Guest_user_online'] : $lang['Guest_users_online'];
$template->assign_vars(array(
! "TOTAL_GUEST_USERS_ONLINE" => sprintf($l_g_user_s, $guest_users))
);
***************
*** 314,319 ****
{
$template->assign_vars(array(
! "TOTAL_GUEST_USERS_ONLINE" => $lang['There'] . " " . $lang['are'] . " 0 " . $lang['Guest'] . " " . $lang['Users'] . " " . $lang['online'],
! "L_NO_GUESTS_BROWSING" => $lang['No_guests_browsing'])
);
}
--- 336,341 ----
{
$template->assign_vars(array(
! "TOTAL_GUEST_USERS_ONLINE" => sprintf($lang['Guest_users_online'], 0, 0),
! "L_NO_GUESTS_BROWSING" => $lang['No_users_browsing'])
);
}
Index: viewforum.php
===================================================================
RCS file: /cvsroot/phpbb/phpBB2/viewforum.php,v
retrieving revision 1.96
retrieving revision 1.97
diff -C2 -r1.96 -r1.97
*** viewforum.php 2001/11/03 01:12:54 1.96
--- viewforum.php 2001/11/03 13:54:04 1.97
***************
*** 547,551 ****
$topic_poster = ( $topic_rowset[$i]['user_id'] != ANONYMOUS ) ? "<a href=\"" . append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=" . $topic_rowset[$i]['user_id']) . "\">" : "";
! $topic_poster .= $topic_rowset[$i]['username'];
$topic_poster .= ( $topic_rowset[$i]['user_id'] != ANONYMOUS ) ? "</a>" : "";
--- 547,551 ----
$topic_poster = ( $topic_rowset[$i]['user_id'] != ANONYMOUS ) ? "<a href=\"" . append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=" . $topic_rowset[$i]['user_id']) . "\">" : "";
! $topic_poster .= ( $topic_rowset[$i]['user_id'] != ANONYMOUS ) ? $topic_rowset[$i]['username'] : $topic_rowset[$i]['post_username'];
$topic_poster .= ( $topic_rowset[$i]['user_id'] != ANONYMOUS ) ? "</a>" : "";
|