1
0
mirror of https://github.com/Xkeeper0/jul.git synced 2025-08-20 15:03:48 -07:00
Files
css
errors
ext
images
js
lib
numgfx
schemes
tlayouts
.gitignore
.htaccess
README.md
acs.php
activeusers.php
activity.php
activity2.php
activity3.php
activity3u.php
admin-editforums.php
admin-editmods.php
admin-slammer.php
admin-threads.php
admin-threads2.php
admin.php
adnonsense.php
announcement.php
avatar.php
biggestposters.php
calendar.php
del.php
digits.png
digits4.png
digits8.png
digitstiny.png
doomcounter.php
editpost.php
editprofile.php
editthread.php
edituser.php
faq.php
favicon-star.ico
favicon.gif
favicon.ico
favicon.php
favicon1.ico
favicon1x.ico
favicon2.ico
favicon2x.ico
favicon3.ico
favicon3x.ico
favicon4.ico
favicon4x.ico
favicon5.ico
favicon5x.ico
favicon6.ico
favicon6x.ico
favicon7.ico
favicon7x.ico
favicon8.ico
favicon8x.ico
forum.php
hex.php
idiotredir.php
index.php
ipsearch.php
irc.php
latestposts.php
login.php
memberlist.php
milestones.php
newreply.php
newthread.php
newyear.php
numgfx.php
numgfxbig.php
online.php
perfdata.php
posticons.dat
postradar.php
postsbyforum.php
postsbythread.php
postsbytime.php
postsbyuser.php
ppdgauge.php
private.php
profile.php
ranks.php
register.php
robots.txt
sendprivate.php
shitbugs.php
shop.php
shoped.php
shoph.php
showprivate.php
sigsize.php
smilies.dat
smilies.php
smilies2.dat
smilies2.php
smilieslol.dat
stats.php
status.php
thread.php
jul/ipsearch.php
2015-08-08 22:45:34 -07:00

157 lines
5.4 KiB
PHP

<?php
require_once('lib/function.php');
$windowtitle = "IP Address Search";
require_once('lib/layout.php');
print "$header<br>";
admincheck();
print adminlinkbar('ipsearch.php');
print "$tblstart";
if(!$su) $su='n';
if(!$sp) $sp='u';
if(!$sm) $sm='n';
if(!$d) $d='y';
$ch1[$su]=' checked';
$ch2[$sp]=' checked';
$ch3[$sm]=' checked';
$ch4[$d]=' checked';
print "
<form action=ipsearch.php method=post>
$tccellh colspan=2>IP search<tr>
$tccell1 width=20%><b>IP to search:</b></td>
$tccell2l>$inpt=ip size=15 maxlength=15 value=$ip><tr>
$tccell1><b>Sort users by:</b></td>
$tccell2l>
$radio=su value=n$ch1[n]> Name &nbsp; &nbsp;
$radio=su value=p$ch1[p]> Posts &nbsp; &nbsp;
$radio=su value=r$ch1[r]> Registration &nbsp; &nbsp;
$radio=su value=s$ch1[s]> Last post &nbsp; &nbsp;
$radio=su value=a$ch1[a]> Last activity &nbsp; &nbsp;
$radio=su value=i$ch1[i]> Last IP
<tr>
$tccell1><b>Sort posts by:</b></td>
$tccell2l>
$radio=sp value=u$ch2[u]> User &nbsp; &nbsp;
$radio=sp value=d$ch2[d]> Date &nbsp; &nbsp;
$radio=sp value=i$ch2[i]> IP
<tr>
$tccell1><b>Sort private messages by:</b></td>
$tccell2l>
$radio=sm value=n$ch3[n]> Sent by &nbsp; &nbsp;
$radio=sm value=d$ch3[d]> Date &nbsp; &nbsp;
$radio=sm value=i$ch3[i]> IP
<tr>
$tccell1><b>Distinct users and IP's:</b></td>
$tccell2l>
$radio=d value=y$ch4[y]> Yes &nbsp; &nbsp;
$radio=d value=n$ch4[n]> No
<tr>
$tccell1>&nbsp</td>
$tccell1l>$inps=s value=Submit></td>
</form>
";
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 === 'y') {
$pgroup='GROUP BY p.ip,u.id';
$mgroup='GROUP BY p.ip,u1.id';
}
$users=$sql->query("SELECT * FROM users WHERE lastip LIKE '$ip' $usort");
$posts=$sql->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");
$pmsgs=$sql->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<br>$tblstart
$tccellh colspan=7><b>Users: ".mysql_num_rows($users)."</b><tr>
$tccellc>id</td>
$tccellc>Name</td>
$tccellc>Registered on</td>
$tccellc>Last post</td>
$tccellc>Last activity</td>
$tccellc>Posts</td>
$tccellc>Last IP</td>
";
for($c=0;$c<500 && $user=$sql->fetch($users);$c++)
if ($users['id'] != 428) print "
<tr>
$tccell2>$user[id]</td>
$tccell1><a href=profile.php?id=$user[id]><font ".getnamecolor($user['sex'],$user['powerlevel']).">$user[name]</font></a></td>
$tccell1>".@date($dateformat,$user['regdate'])."</td>
$tccell1>".date($dateformat,$user['lastposttime'])."</td>
$tccell1>".date($dateformat,$user['lastactivity'])."</td>
$tccell1>$user[posts]</td>
$tccell2>$user[lastip]</td>
";
if($post=$sql->fetch($users))
print "<tr>$tccell2 colspan=7>Too many results!";
print "
$tblend<br>$tblstart
$tccellh colspan=5><b>Posts: ".mysql_num_rows($posts)."</b><tr>
$tccellc>id</td>
$tccellc>Posted by</td>
$tccellc>Thread</td>
$tccellc>Date</td>
$tccellc>IP</td>
";
for($c=0;$c<500 && $post=$sql->fetch($posts);$c++)
if ($post['user'] != 428)
print "
<tr>
$tccell2>$post[id]</td>
$tccell1><a href=profile.php?id=$post[user]><font ".getnamecolor($post['sex'],$post['powerlevel']).">$post[name]</font></a></td>
$tccell1><a href=thread.php?id=$post[thread]>$post[title]</a></td>
$tccell1><nobr>".date($dateformat,$post['date'])."</nobr></td>
$tccell2>$post[ip]</td>
";
if($post=$sql->fetch($posts))
print "<tr>$tccell2 colspan=5>Too many results!";
print "
$tblend<br>$tblstart
$tccellh colspan=6><b>Private messages: ".mysql_num_rows($pmsgs)."</b><tr>
$tccellc>id</td>
$tccellc>Sent by</td>
$tccellc>Sent to</td>
$tccellc>Title</td>
$tccellc>Date</td>
$tccellc>IP</td>
";
for($c=0;$c<500 && $pmsg=$sql->fetch($pmsgs);$c++)
if ($pmsg['userfrom'] != 428 && $pmsg['userto'] != 428)
print "
<tr>
$tccell2>$pmsg[id]</td>
$tccell1><a href=profile.php?id=$pmsg[userfrom]><font ".getnamecolor($pmsg['sex1'],$pmsg['pow1']).">$pmsg[name1]</font></a></td>
$tccell1><a href=profile.php?id=$pmsg[userto]><font ".getnamecolor($pmsg['sex2'],$pmsg['pow2']).">$pmsg[name2]</font></a></td>
$tccell1><a href=showprivate.php?id=$pmsg[id]>$pmsg[title]</a></td>
$tccell1><nobr>".date($dateformat,$pmsg['date'])."</nobr></td>
$tccell2>$pmsg[ip]</td>
";
if($pmsg=$sql->fetch($pmsgs))
print "<tr>$tccell2 colspan=6>Too many results!";
}
print $tblend.$footer;
printtimedif($startingtime);
?>