safesql( htmlspecialchars( strip_tags( trim( $_REQUEST['ip'] ) ) ) ); else $ip = ""; if( isset( $_REQUEST['name'] ) ) $name = $db->safesql( htmlspecialchars( strip_tags( trim( $_REQUEST['name'] ) ) ) ); else $name = ""; if( $_REQUEST['doaction'] == "dodelcomments" AND $_REQUEST['id']) { if( $_REQUEST['user_hash'] == "" or $_REQUEST['user_hash'] != $dle_login_hash ) { die( "Hacking attempt! User not found" ); } $id = intval( $_REQUEST['id'] ); $result = $db->query( "SELECT COUNT(*) as count, post_id FROM " . PREFIX . "_comments WHERE user_id='$id' AND is_register='1' GROUP BY post_id" ); while ( $row = $db->get_array( $result ) ) { $db->query( "UPDATE " . PREFIX . "_post set comm_num=comm_num-{$row['count']} where id='{$row['post_id']}'" ); } $db->free( $result ); $db->query( "UPDATE " . USERPREFIX . "_users set comm_num='0' WHERE user_id ='$id'" ); $db->query( "DELETE FROM " . PREFIX . "_comments WHERE user_id='$id' AND is_register='1'" ); } echoheader( "", "" ); echo <<
{$lang['opt_iptoolsc']}
   
{$lang['opt_ipfe']}
{$lang['opt_iptoolsname']}
   
HTML; if( $_REQUEST['action'] == "find" and $ip != "" ) { echo <<
HTML; $db->query( "SELECT * FROM " . USERPREFIX . "_users WHERE logged_ip LIKE '{$ip}%'" ); $i = 0; while ( $row = $db->get_array() ) { $i ++; if( $row[news_num] == 0 ) { $news_link = "$row[news_num]"; } else { $news_link = "[" . $row[news_num] . "]"; } if( $row[comm_num] == 0 ) { $comms_link = $row['comm_num']; } else { $comms_link = "[" . $row[comm_num] . "]"; } if( $row['banned'] == 'yes' ) $group = "" . $lang['user_ban'] . ""; else $group = $user_group[$row['user_group']]['group_name']; echo " "; } if( $i == 0 ) { echo ""; } echo <<
{$lang['user_name']} IP {$lang['user_reg']} {$lang['user_last']} {$lang['user_news']} {$lang['user_coms']} {$lang['user_acc']}
{$row['name']} " . $row['logged_ip'] . " " . langdate( "d/m/Y - H:i", $row['reg_date'] ) . " " . langdate( 'd/m/Y - H:i', $row['lastdate'] ) . " " . $news_link . " " . $comms_link . " " . $group . "


$lang[ip_empty]

HTML; $db->query( "SELECT " . PREFIX . "_comments.user_id, " . PREFIX . "_comments.ip, " . USERPREFIX . "_users.comm_num, banned, user_group, reg_date, lastdate, " . USERPREFIX . "_users.name, " . USERPREFIX . "_users.news_num FROM " . PREFIX . "_comments LEFT JOIN " . USERPREFIX . "_users ON " . PREFIX . "_comments.user_id=" . USERPREFIX . "_users.user_id WHERE " . PREFIX . "_comments.ip LIKE '{$ip}%' AND " . PREFIX . "_comments.is_register = '1' AND " . USERPREFIX . "_users.name != '' GROUP BY " . PREFIX . "_comments.user_id" ); $i = 0; while ( $row = $db->get_array() ) { $i ++; if( $row[news_num] == 0 ) { $news_link = "$row[news_num]"; } else { $news_link = "[" . $row[news_num] . "]"; } if( $row[comm_num] == 0 ) { $comms_link = $row['comm_num']; } else { $comms_link = "[" . $row[comm_num] . "]"; } if( $row['banned'] == 'yes' ) $group = "" . $lang['user_ban'] . ""; else $group = $user_group[$row['user_group']]['group_name']; echo " "; } if( $i == 0 ) { echo ""; } echo <<
{$lang['user_name']} IP {$lang['user_reg']} {$lang['user_last']} {$lang['user_news']} {$lang['user_coms']} {$lang['user_acc']}
{$row['name']} " . $row['ip'] . " " . langdate( "d/m/Y - H:i", $row['reg_date'] ) . " " . langdate( 'd/m/Y - H:i', $row['lastdate'] ) . " " . $news_link . " " . $comms_link . " " . $group . "


$lang[ip_empty]

HTML; } if( $name != "" ) { echo <<
HTML; $row = $db->super_query( "SELECT user_id, name, logged_ip FROM " . USERPREFIX . "_users WHERE name='" . $name . "'" ); if( ! $row['user_id'] ) { echo "
" . $lang['user_nouser'] . "
"; } else { echo $lang['user_name'] . " " . $row['name'] . "

" . $lang['opt_iptoollast'] . " " . $row['logged_ip'] . "

" . $lang['opt_iptoolcall'] . " "; $db->query( "SELECT ip FROM " . PREFIX . "_comments WHERE user_id = '{$row['user_id']}' GROUP BY ip" ); $ip_list = array (); while ( $row = $db->get_array() ) { $ip_list[] = "" . $row['ip'] . ""; } echo implode( ", ", $ip_list ); } echo <<
HTML; } echofooter(); ?>