$tblstart"; if(!$isadmin){ print " $tccell1>Sorry, but this feature is reserved to admins. ".redirect('index.php','return to the board',0); }else{ if(!$su) $su='n'; if(!$sp) $sp='u'; if(!$sm) $sm='n'; if(!$d) $d=1; $ch1[$su]=' checked'; $ch2[$sp]=' checked'; $ch3[$sm]=' checked'; $ch4[$d]=' checked'; print "
$tccellh colspan=2>IP search $tccell1 width=20%>IP to search: $tccell2l>$inpt=ip size=15 maxlength=15 value=$ip> $tccell1>Sort users by: $tccell2l> $radio=su value=n$ch1[n]> Name     $radio=su value=p$ch1[p]> Posts     $radio=su value=r$ch1[r]> Registration     $radio=su value=s$ch1[s]> Last post     $radio=su value=a$ch1[a]> Last activity     $radio=su value=i$ch1[i]> Last IP $tccell1>Sort posts by: $tccell2l> $radio=sp value=u$ch2[u]> User     $radio=sp value=d$ch2[d]> Date     $radio=sp value=i$ch2[i]> IP $tccell1>Sort private messages by: $tccell2l> $radio=sm value=n$ch3[n]> Sent by     $radio=sm value=d$ch3[d]> Date     $radio=sm value=i$ch3[i]> IP $tccell1>Distinct users and IP's: $tccell2l> $radio=d value=1$ch4[1]> Yes     $radio=d value=0$ch4[0]> No $tccell1>  $tccell1l>$inps=s value=Submit>
"; if($ip){ $ip=str_replace('*','%',$ip); switch($su){ case 'n': $usort='ORDER BY name'; break; case 'p': $usort='ORDER BY posts DESC'; break; case 'r': $usort='ORDER BY regdate'; break; case 's': $usort='ORDER BY lastposttime'; break; case 'a': $usort='ORDER BY lastactivity'; break; case 'i': $usort='ORDER BY lastip'; break; } switch($sp){ case 'u': $psort='ORDER BY name'; break; case 'd': $psort='ORDER BY date'; break; case 'i': $psort='ORDER BY ip'; break; } switch($sm){ case 'n': $msort='ORDER BY name1'; break; case 'd': $msort='ORDER BY date'; break; case 'i': $msort='ORDER BY ip'; break; } if($d){ $pgroup='GROUP BY p.ip,u.id'; $mgroup='GROUP BY p.ip,u1.id'; } $users=mysql_query("SELECT * FROM users WHERE lastip LIKE '$ip' $usort"); $posts=mysql_query("SELECT p.*,u.name,u.sex,u.powerlevel,t.title FROM posts p,users u,threads t WHERE ip LIKE '$ip' AND p.user=u.id AND p.thread=t.id $pgroup $psort") or print mysql_error(); $pmsgs=mysql_query("SELECT p.*,t.title,u1.name AS name1,u2.name AS name2,u1.sex AS sex1,u2.sex AS sex2,u1.powerlevel pow1,u2.powerlevel pow2 FROM pmsgs p,pmsgs_text t,users u1,users u2 WHERE ip LIKE '$ip' AND p.userfrom=u1.id AND p.userto=u2.id AND p.id=pid $mgroup $msort"); print " $tblend
$tblstart $tccellh colspan=7>Users: ".mysql_num_rows($users)." $tccellc>id $tccellc>Name $tccellc>Registered on $tccellc>Last post $tccellc>Last activity $tccellc>Posts $tccellc>Last IP "; for($c=0;$c<500 && $user=mysql_fetch_array($users);$c++) print " $tccell2>$user[id] $tccell1>$user[name] $tccell1>".@date($dateformat,$user[regdate])." $tccell1>".date($dateformat,$user[lastposttime])." $tccell1>".date($dateformat,$user[lastactivity])." $tccell1>$user[posts] $tccell2>$user[lastip] "; if($post=mysql_fetch_array($users)) print "$tccell2 colspan=7>Too many results!"; print " $tblend
$tblstart $tccellh colspan=5>Posts: ".mysql_num_rows($posts)." $tccellc>id $tccellc>Posted by $tccellc>Thread $tccellc>Date $tccellc>IP "; for($c=0;$c<500 && $post=mysql_fetch_array($posts);$c++) print " $tccell2>$post[id] $tccell1>$post[name] $tccell1>$post[title] $tccell1>".date($dateformat,$post[date])." $tccell2>$post[ip] "; if($post=mysql_fetch_array($posts)) print "$tccell2 colspan=5>Too many results!"; print " $tblend
$tblstart $tccellh colspan=6>Private messages: ".mysql_num_rows($pmsgs)." $tccellc>id $tccellc>Sent by $tccellc>Sent to $tccellc>Title $tccellc>Date $tccellc>IP "; for($c=0;$c<500 && $pmsg=mysql_fetch_array($pmsgs);$c++) print " $tccell2>$pmsg[id] $tccell1>$pmsg[name1] $tccell1>$pmsg[name2] $tccell1>$pmsg[title] $tccell1>".date($dateformat,$pmsg[date])." $tccell2>$pmsg[ip] "; if($pmsg=mysql_fetch_array($pmsgs)) print "$tccell2 colspan=6>Too many results!"; } } print $tblend.$footer; printtimedif($startingtime); ?>