|
From: Bart v. B. <ba...@us...> - 2002-03-01 17:05:25
|
Update of /cvsroot/phpbb/phpBB2
In directory usw-pr-cvs1:/tmp/cvs-serv315
Modified Files:
modcp.php
Log Message:
Made viewip in modcp.php usefull and introduced an undocumented feature :D
Index: modcp.php
===================================================================
RCS file: /cvsroot/phpbb/phpBB2/modcp.php,v
retrieving revision 1.60
retrieving revision 1.61
diff -C2 -r1.60 -r1.61
*** modcp.php 15 Feb 2002 23:52:41 -0000 1.60
--- modcp.php 1 Mar 2002 17:05:21 -0000 1.61
***************
*** 884,892 ****
// Get other IP's this user has posted under
//
! $sql = "SELECT DISTINCT poster_ip
FROM " . POSTS_TABLE . "
WHERE poster_id = $poster_id
! AND poster_ip <> '" . $post_row['poster_ip'] . "'
! ORDER BY poster_ip DESC";
if(!$result = $db->sql_query($sql))
{
--- 884,892 ----
// Get other IP's this user has posted under
//
! $sql = "SELECT poster_ip, count(*) as postings
FROM " . POSTS_TABLE . "
WHERE poster_id = $poster_id
! GROUP BY (poster_ip)
! ORDER BY postings DESC";
if(!$result = $db->sql_query($sql))
{
***************
*** 895,912 ****
$poster_ips = $db->sql_fetchrowset($result);
for($i = 0; $i < count($poster_ips); $i++)
{
$ip = decode_ip($poster_ips[$i]['poster_ip']);
! $ip = ( $rdns_ip_num == $ip ) ? gethostbyaddr($ip) : $ip;
! $row_color = ( !($i % 2) ) ? $theme['td_color1'] : $theme['td_color2'];
! $row_class = ( !($i % 2) ) ? $theme['td_class1'] : $theme['td_class2'];
$template->assign_block_vars("iprow", array(
"ROW_COLOR" => "#" . $row_color,
"ROW_CLASS" => $row_class,
! "IP" => $ip,
! "U_LOOKUP_IP" => append_sid("modcp.$phpEx?mode=ip&" . POST_POST_URL . "=$post_id&" . POST_TOPIC_URL . "=$topic_id&rdns=" . $ip))
);
}
--- 895,922 ----
$poster_ips = $db->sql_fetchrowset($result);
+ $j = 0;
for($i = 0; $i < count($poster_ips); $i++)
{
+ if ( $poster_ips[$i]['poster_ip'] == $post_row['poster_ip'] )
+ {
+ $template->assign_vars(array(
+ "POSTINGS" => $poster_ips[$i]['postings'] . " " .$lang['Posts'])
+ );
+ continue;
+ }
$ip = decode_ip($poster_ips[$i]['poster_ip']);
! $ip = ( $rdns_ip_num == $poster_ips[$i]['poster_ip'] || $rdns_ip_num == 'all') ? gethostbyaddr($ip) : $ip;
! $j++; // Can't use $i because of the 'continue'
! $row_color = ( !($j % 2) ) ? $theme['td_color1'] : $theme['td_color2'];
! $row_class = ( !($j % 2) ) ? $theme['td_class1'] : $theme['td_class2'];
$template->assign_block_vars("iprow", array(
"ROW_COLOR" => "#" . $row_color,
"ROW_CLASS" => $row_class,
! "IP" => $ip,
! "POSTINGS" => $poster_ips[$i]['postings'] . " " .$lang['Posts'],
! "U_LOOKUP_IP" => append_sid("modcp.$phpEx?mode=ip&" . POST_POST_URL . "=$post_id&" . POST_TOPIC_URL . "=$topic_id&rdns=" . $poster_ips[$i]['poster_ip']))
);
}
***************
*** 915,922 ****
// Get other users who've posted under this IP
//
! $sql = "SELECT DISTINCT u.username, u.user_id
FROM " . USERS_TABLE ." u, " . POSTS_TABLE . " p
WHERE p.poster_id = u.user_id
! AND p.poster_ip = '" . $post_row['poster_ip'] . "'";
if(!$result = $db->sql_query($sql))
{
--- 925,934 ----
// Get other users who've posted under this IP
//
! $sql = "SELECT u.user_id, u.username, count(*) as postings
FROM " . USERS_TABLE ." u, " . POSTS_TABLE . " p
WHERE p.poster_id = u.user_id
! AND p.poster_ip = '" . $post_row['poster_ip'] . "'
! GROUP BY u.user_id, u.username
! ORDER BY postings DESC";
if(!$result = $db->sql_query($sql))
{
***************
*** 937,940 ****
--- 949,953 ----
"ROW_CLASS" => $row_class,
"USERNAME" => $username,
+ "POSTINGS" => $poster_ids[$i]['postings'] . " " .$lang['Posts'],
"L_SEARCH_POSTS" => sprintf($lang['Search_user_posts'], $username),
|