query("INSERT INTO `ipbans` SET `ip` = '". $_GET['banip'] ."', `reason`='online.php ban', `date` = '". ctime() ."', `banner` = '$loguserid'") or print mysql_error(); // if ($_GET['uid']) mysql_query("UPDATE `users` SET `powerlevel` = -1, `title` = 'Banned; account hijacked. Contact admin via PM to change it.' WHERE `id` = '". $_GET['uid'] ."'") or print mysql_error(); xk_ircsend("1|". xk(8) . $loguser['name'] . xk(7) ." added IP ban for ". xk(8) . $_GET['banip'] . xk(7) ."."); return header("Location: online.php?m=1"); } $sort = filter_bool($_GET['sort']); $lnk = 'minute | $lnk=300>5 minutes | $lnk=900>15 minutes | $lnk=3600>hour | $lnk=86400>day "; if($isadmin) print '
Admin cruft: Sort by ".($sort == 'IP' ? 'date' : 'IP') .""; // Logged in users $posters = $sql->query("SELECT id,posts,name,sex,powerlevel,aka,lastactivity,lastip,lastposttime,lasturl,birthday FROM users WHERE lastactivity>".(ctime()-$time).' ORDER BY '.($sort=='IP'&&$isadmin?'lastip':'lastactivity DESC')); print "
$fonttag Online users during the last ".timeunits2($time).": $tblstart $tccellh width=20>  $tccellh width=200>Username $tccellh width=120> Last activity $tccellh width=180> Last post $tccellh width=*>URL "; if($isadmin) print "$tccellh width=120>IP address"; print "$tccellh width=60> Posts"; for ($i=1; $user=$sql->fetch($posters); $i++) { $userlink = getuserlink($user); if(!$user['posts']) $user['lastposttime'] = getblankdate(); else $user['lastposttime'] = date($dateformat,$user['lastposttime']+$tzoff); $user['lasturl']=str_replace('<','<',$user['lasturl']); $user['lasturl']=str_replace('>','>',$user['lasturl']); $user['lasturl']=str_replace('%20',' ',$user['lasturl']); $user['lasturl']=str_replace('shoph','shop',$user['lasturl']); $user['lasturl']=preg_replace('/[\?\&]debugsql(|=[0-9]+)/i','',$user['lasturl']); // let's not give idiots any ideas $lasturltd = "$tccell2l>$user[lasturl]"; if (substr($user['lasturl'], -11) =='(IP banned)') $lasturltd = "$tccell2l>". substr($user[lasturl], 0, -12) ." (IP banned)"; elseif (substr($user['lasturl'], -11) =='(Tor proxy)') $lasturltd = "$tccell2l>". substr($user[lasturl], 0, -12) ." (Tor proxy)"; print " $tccell1>$i $tccell2l>{$userlink} $tccell1>".date('h:i:s A',$user['lastactivity']+$tzoff)." $tccell1>$user[lastposttime] $lasturltd"; if ($banorama) $ipban = "$smallfont
[Ban - G]"; if($isadmin) print "$tccell1>$user[lastip] $ipban"; // $tccell1r>". $user['ipmatches'] ." 0 ? "images/dot2.gif" : "images/dot5.gif") ."' align='absmiddle'>"; print "$tccell2>$user[posts]"; } //WHERE date>'.(ctime()-$time).' $guests = $sql->query('SELECT *, (SELECT COUNT(`ip`) FROM `ipbans` WHERE `ip` = `guests`.`ip`) AS banned FROM guests ORDER BY '.($sort=='IP'&&$isadmin?'ip':'date').' DESC'); print " $tblend $fonttag
Guests online in the past 5 min.: $tblstart $tccellh width=20>  $tccellh width=300>  $tccellh width=120>Last activity $tccellh width=*>URL "; if($isadmin) print "$tccellh width=120> IP address"; print ''; for($i=1;$guest=$sql->fetch($guests);$i++){ $guest['lasturl']=str_replace('<','<',$guest['lasturl']); $guest['lasturl']=str_replace('>','>',$guest['lasturl']); $guest['lasturl']=str_replace('shoph','shop',$guest['lasturl']); $guest['lasturl']=preg_replace('/[\?\&]debugsql=[0-9]+/i','',$guest['lasturl']); // let's not give idiots any ideas /* if ($guest['useragent'] == "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.0.19) Gecko/2010031218 Firefox/3.0.19" && $banorama) { // if (stripos($guest['useragent'], "robot") !== false && $banorama) $marker = " style='color: #f88;'"; else $marker = ""; */ $marker = ''; $lasturltd = "$tccell2l$marker>$guest[lasturl]"; if (substr($guest['lasturl'], -11) =='(IP banned)') $lasturltd = "$tccell2l$marker>". substr($guest['lasturl'], 0, -12) ." (IP banned)"; elseif (substr($guest['lasturl'], -11) =='(Tor proxy)') $lasturltd = "$tccell2l$marker>". substr($guest['lasturl'], 0, -12) ." (Tor proxy)"; print " $tccell1$marker>$i $tccell2s$marker>". htmlspecialchars($guest['useragent']) ." $tccell1$marker>".date('h:i:s A',$guest['date']+$tzoff)." $lasturltd"; if ($banorama && !$guest['banned']) $ipban = "Ban - "; elseif ($guest['banned']) $ipban = "Banned - "; else $ipban = ""; if($isadmin) print "$tccell1$marker> $guest[ip]$smallfont
[$ipbanG-W-H]"; print ""; } print $tblend.$footer; printtimedif($startingtime); function urlformat($url) { return preg_replace("/^\/thread\.php\?pid=([0-9]+)$/", "/thread.php?pid=\\1#\\1", $url); }