'') OR (" . db_prefix("bans") . ".uniqueid=" . db_prefix("accounts") . ".uniqueid AND " . db_prefix("bans") . ".uniqueid<>''))"; $r = db_query($sql); echo ""; $number=db_num_rows($r); for ($x=0;$x<$number;$x++){ $ro = db_fetch_assoc($r); echo ""; } if (db_num_rows($r)==0) echo ""; echo ""; exit(); } db_query("DELETE FROM " . db_prefix("bans") . " WHERE banexpire < \"".date("Y-m-d")."\" AND banexpire>'0000-00-00'"); $duration = httpget("duration"); if ($duration=="") { $since = " WHERE banexpire <= '".date("Y-m-d H:i:s",strtotime("+2 weeks"))."' AND banexpire > '0000-00-00'"; output("`bShowing bans that will expire within 2 weeks.`b`n`n"); }else{ if ($duration=="forever") { $since=""; output("`bShowing all bans`b`n`n"); }else{ $since = " WHERE banexpire <= '".date("Y-m-d H:i:s",strtotime("+".$duration))."' AND banexpire > '0000-00-00'"; output("`bShowing bans that will expire within %s.`b`n`n",$duration); } } addnav("Will Expire Within"); addnav("1 week","user.php?op=removeban&duration=1+week"); addnav("2 weeks","user.php?op=removeban&duration=2+weeks"); addnav("3 weeks","user.php?op=removeban&duration=3+weeks"); addnav("4 weeks","user.php?op=removeban&duration=4+weeks"); addnav("2 months","user.php?op=removeban&duration=2+months"); addnav("3 months","user.php?op=removeban&duration=3+months"); addnav("4 months","user.php?op=removeban&duration=4+months"); addnav("5 months","user.php?op=removeban&duration=5+months"); addnav("6 months","user.php?op=removeban&duration=6+months"); addnav("1 year","user.php?op=removeban&duration=1+year"); addnav("2 years","user.php?op=removeban&duration=2+years"); addnav("4 years","user.php?op=removeban&duration=4+years"); addnav("Forever","user.php?op=removeban&duration=forever"); $sql = "SELECT * FROM " . db_prefix("bans") . " $since ORDER BY banexpire"; $result = db_query($sql); rawoutput(" "); rawoutput(""); $ops = translate_inline("Ops"); $bauth = translate_inline("Ban Author"); $ipd = translate_inline("IP/ID"); $dur = translate_inline("Duration"); $mssg = translate_inline("Message"); $aff = translate_inline("Affects"); $l = translate_inline("Last"); rawoutput(""); $i=0; while ($row = db_fetch_assoc($result)) { $liftban = translate_inline("Lift ban"); $showuser = translate_inline("Click to show users"); rawoutput(""); rawoutput(""); $i++; } rawoutput("
$ops$bauth$ipd$dur$mssg$aff$l
"); output_notl("%s", $liftban, true); rawoutput(""); addnav("","user.php?op=delban&ipfilter=".URLEncode($row['ipfilter'])."&uniqueid=".URLEncode($row['uniqueid'])); rawoutput(""); output_notl("`&%s`0", $row['banner']); rawoutput(""); output_notl("%s", $row['ipfilter']); output_notl("%s", $row['uniqueid']); rawoutput(""); // "43200" used so will basically round to nearest day rather than floor number of days $expire= sprintf_translate("%s days", round((strtotime($row['banexpire'])+43200-strtotime("now"))/86400,0)); if (substr($expire,0,2)=="1 ") $expire= translate_inline("1 day"); if (date("Y-m-d",strtotime($row['banexpire'])) == date("Y-m-d")) $expire=translate_inline("Today"); if (date("Y-m-d",strtotime($row['banexpire'])) == date("Y-m-d",strtotime("1 day"))) $expire=translate_inline("Tomorrow"); if ($row['banexpire']=="0000-00-00") $expire=translate_inline("Never"); output_notl("%s", $expire); rawoutput(""); output_notl("%s", $row['banreason']); rawoutput(""); $file = "user.php?op=removeban&subop=xml&ip={$row['ipfilter']}&id={$row['uniqueid']}"; rawoutput(""); addnav("",$file); rawoutput(""); output_notl("%s", relativedate($row['lasthit'])); rawoutput("
"); ?>