View Single Post
  #4  
Old 16th July 2013, 00:30
wMan wMan is offline
Banned
 
Join Date: Feb 2008
P2P
Posts: 1,433
Thumbs up
Code:
<?
ob_start("ob_gzhandler");
require "include/bittorrent.php";
dbconn(true);
if ($CURUSER["class"] > 15)
{
stdhead();
  stdmsg("FUCK OFF...", "STOP CHEATING MOTHER FUCKER");
  stdfoot();
  exit;
}

loggedinorreturn();
stdhead();
?>
<script language="JavaScript" type="text/javascript">
function selectAll(){
t=document.forms[0].length;
for(i=1; i<t; i++) document.forms[0][i].checked=document.forms[0][0].checked;
}
</script>
<?


if (get_user_class() >= UC_OWNER) {

$cba='';
if ( isset($_GET["select"]) )
{
$select=$_GET["select"];
if ( $select == 'all' ) $cba='checked';
elseif ( $select =='none' ) $cba='';
}

if (isset($_POST['delcheck'])) {

if ($_POST['delcheck'] == ""){ stderr("Sorry", "No accounts selected!"); } else {

$i = 0;
$delray = $_POST['delcheck'];
$result=mysql_query("Select * FROM users") or sqlerr();
$count=mysql_num_rows($result);

for($i=0;$i<$count;$i++){
$del_id = $delray[$i];
if ($del_id == "") {
} else {
$indquery = mysql_query("SELECT * FROM users WHERE id=$del_id") or sqlerr();
$indarray = mysql_fetch_array($indquery);
$username = $indarray["username"];
write_log("banstat", "The account <b>$username</b> was deleted by <i>$CURUSER[username]</i>.");
delete_phpBB2user($username,"nopasswordcheck",false);
mysql_query("DELETE FROM users WHERE id=$del_id LIMIT 1") or sqlerr();
}
}
$days = $_POST['count'];
stderr("Accounts Successfully Deleted", "You have successfully deleted the selected accounts!\n<br>\n<br>\n<a href=\"inactive.php?count=$days\">Return to the Account Inactivity Status page</a>.");
}
} else {

if (isset($_GET['count'])) { $days = $_GET['count']; } else { $days = 35; }

$dt = sqlesc(get_date_time(gmtime() - ($days * 86400)));
$countresult = mysql_query("SELECT * FROM users WHERE last_access < $dt ORDER BY last_access DESC");
$countnumber = mysql_num_rows($countresult);
$result = mysql_query("SELECT * FROM users WHERE last_access < $dt ORDER BY last_access DESC LIMIT 250");
$number = mysql_num_rows($result);
$dt = sqlesc(get_date_time(gmtime() - ($days * 86400)));

if ($number == 0) {

stderr("No Inactive Accounts", "Sorry, there are no accounts that have been inactive for more than $days days.\n<br>\n<br>\n<form method=\"get\" action=\"inactive.php\" name=\"daycount\">\n<input type=\"text\" name=\"count\" value=\"$days\" size=\"20\" maxlength=\"3\" style=\"padding:2px\" />&nbsp;\n<input type=\"submit\" value=\"Change Day Range\" style=\"padding:2px\" />\n</form>");

} else {
if ($countnumber > 250) { print("<h2 style=\"margin-bottom:15px\">$countnumber accounts inactive for longer than $days days.<br><span style=\"font-size:12px\">Only the first 250 are shown.</span></h2>\n"); } else { print("<h2 style=\"margin-bottom:15px\">$countnumber accounts inactive for longer than $days days.</h2>\n"); }
print("<form method=\"get\" action=\"inactive.php\" name=\"daycount\">\n");
print("<input type=\"text\" name=\"count\" value=\"$days\" size=\"20\" maxlength=\"3\" style=\"padding:2px\" />&nbsp;\n");
print("<input type=\"submit\" value=\"Change Day Range\" style=\"padding:2px\" />\n</form>\n");
print("<form method=\"post\" action=\"inactive.php\" name=\"delform\">\n");
print("<table border=\"0\" cellspacing=\"3\" cellpadding=\"3\" align=\"center\" style=\"margin-top:20px\">\n<tr><td class=\"colhead\">Delete </td><td class=\"colhead\"> PM</td><td class=\"colhead\">Report</td><td class=\"colhead\"> Class</td><td class=\"colhead\"> Username</td><td class=\"colhead\"> Ratio</td><td class=\"colhead\">Last Seen</td></tr>\n");

if ($row = mysql_fetch_array($result)) {
do {
$lastseen = $row["last_access"];
if ($lastseen == "0000-00-00 00:00:00") {
$lastseen = "never";
} else {
$lastseen .= " (" . get_elapsed_time(sql_timestamp_to_unix_timestamp($lastseen)) . " ago)";
}

if ($row["uploaded"] == "0") {
$ratio = "inf";
}
elseif ($row["downloaded"] == "0") {
$ratio = "inf";
} else {
$ratio = number_format($row["uploaded"] / $row["downloaded"], 3);
$ratio = "<u><font color=white>$ratio</font></u>";
}
print("<tr><td class=\"colhead\" align=\"center\">");
print("<input type=\"checkbox\" name=\"delete[]\" value=\"".$row["id"]."\"></td>");
print("<td class=\"colhead\"><a href=sendmessage.php?receiver=".$row["id"]."><img src=pic/button_pm.gif border=0></a></td>");
print("<td class=\"colhead\"><form method=post action=report.php?type=User&id=".$row["id"]."><input type=submit value=\"Report User\" style='height: 23px'></form></td>");
print("<td class=\"colhead\">".get_user_class_name($row["class"])."</td><td class=\"colhead\"><a href=userdetails.php?id=".$row["id"].">".$row["username"]."</a></td><td class=\"colhead\"><b>$ratio</b></td><td class=\"colhead\">$lastseen</td></tr>\n");
}

while($row = mysql_fetch_array($result));
}

print("</table>\n<br>\n<br>\n");
print("<input type=\"button\" value=\"Check All\" onclick=\"this.value=check(form)\" style=\"margin-right:10px\" />\n");
print("<input type=\"hidden\" name=\"count\" value=\"$days\"");
print("<input type=\"submit\" value=\"Delete Selected Accounts\">\n");
print("</form>\n");
stdfoot();

}
}

} else { stderr("Unauthorized", "Sorry, you are not authorized to view this page."); }

?>
try this one
Reply With Quote