");
output("Set up a new ban by IP or by ID (recommended IP, though if you have several different users behind a NAT, you can try ID which is easily defeated)`n");
rawoutput("");
output("IP: ");
rawoutput("");
output_notl("`n");
rawoutput("");
output("ID: ");
rawoutput("");
output("`nDuration: ");
rawoutput("");
output("Days (0 for permanent)`n");
$reason = httpget("reason");
if ($reason == "")
$reason=translate_inline("Don't mess with me.");
output("Reason for the ban: ");
rawoutput("");
output_notl("`n");
$pban = translate_inline("Post ban");
$conf = translate_inline("Are you sure you wish to issue a permanent ban?");
rawoutput("");
rawoutput("");
output("For an IP ban, enter the beginning part of the IP you wish to ban if you wish to ban a range, or simply a full IP to ban a single IP`n`n");
addnav("","user.php?op=saveban");
if ($row['name']!=""){
$id = $row['uniqueid'];
$ip = $row['lastip'];
$name = $row['name'];
output("`0To help locate similar users to `@%s`0, here are some other users who are close:`n", $name);
output("`bSame ID (%s):`b`n", $id);
$sql = "SELECT name, lastip, uniqueid, laston, gentimecount FROM " . db_prefix("accounts") . " WHERE uniqueid='".addslashes($id)."' ORDER BY lastip";
$result = db_query($sql);
while ($row = db_fetch_assoc($result)){
output("`0• (%s) `%%s`0 - %s hits, last: %s`n", $row['lastip'],
$row['name'], $row['gentimecount'],
reltime(strtotime($row['laston'])));
}
output_notl("`n");
$oip = "";
$dots = 0;
output("`bSimilar IP's`b`n");
for ($x=strlen($ip); $x>0; $x--){
if ($dots>1) break;
$thisip = substr($ip,0,$x);
$sql = "SELECT name, lastip, uniqueid, laston, gentimecount FROM " . db_prefix("accounts") . " WHERE lastip LIKE '$thisip%' AND NOT (lastip LIKE '$oip') ORDER BY uniqueid";
//output("$sql`n");
$result = db_query($sql);
if (db_num_rows($result)>0){
output("• IP Filter: %s ", $thisip);
rawoutput("");
output("Use this filter");
rawoutput("");
output_notl("`n");
while ($row=db_fetch_assoc($result)){
output(" ",true);
output("• (%s) [%s] `%%s`0 - %s hits, last: %s`n",
$row['lastip'], $row['uniqueid'], $row['name'],
$row['gentimecount'],
reltime(strtotime($row['laston'])));
}
output_notl("`n");
}
if (substr($ip,$x-1,1)==".") {
$x--;
$dots++;
}
$oip = $thisip."%";
}
}
?>