View Tracker Pm's

Started by rickandmary, July 23, 2012, 03:03:05 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

rickandmary

save and upload to root as spam.php
<?
ob_start("ob_gzhandler");

require "include/bittorrent.php";

dbconn(false);

loggedinorreturn();

if (get_user_class() < UC_SYSOP)
stderr("Error", "Permission denied.");

stdhead("Spam test");
//////////PAGER////////////
$res2 = mysql_query("SELECT COUNT(*) FROM messages $where");
        $row = mysql_fetch_array($res2);
        $count = $row[0];
$perpage = 30;
    list($pagertop, $pagerbottom, $limit) = pager($perpage, $count, $_SERVER["PHP_SELF"] ."?" );
echo $pagertop;
//////////END PAGER///////////
$res = mysql_query("SELECT * FROM messages ORDER BY id DESC $limit") or sqlerr(__FILE__, __LINE__);print("<h1>Spam test</h1>\n");
  print("<table border=1 cellspacing=0 cellpadding=5>\n");
  ///////////////////////////////////////
?>
<form method="post" action="/take-delmp.php">
<?
///////////////////////////////////////
  print("<tr><td class=colhead align=left>Sender</td><td class=colhead align=left>Receiver</td><td class=colhead align=left>Text</td><td class=colhead align=left>Date</td><td class=colhead>Delete</td></tr>\n");
  while ($arr = mysql_fetch_assoc($res))
  {
    $res2 = mysql_query("SELECT username FROM users WHERE id=" . $arr["receiver"]) or sqlerr();
    $arr2 = mysql_fetch_assoc($res2);
    $receiver = "<a href=userdetails.php?id=" . $arr["receiver"] . "><b>" . $arr2["username"] . "</b></a>";
    $res3 = mysql_query("SELECT username FROM users WHERE id=" . $arr["sender"]) or sqlerr();
    $arr3 = mysql_fetch_assoc($res3);
    $sender = "<a href=userdetails.php?id=" . $arr["sender"] . "><b>" . $arr3["username"] . "</b></a>";
             if( $arr["sender"] == 0 )
             $sender = "<font color=red><b>System</b></font>";
    $msg = format_comment($arr["msg"]);
  $added = format_comment($arr["added"]);
  print("<tr><td>$sender</td><td>$receiver</td><td align=left>$msg</td><td align=left>$added</td>");
/////////////////////////////////////////////////////////////////////////////////
  if ($_GET[check] == "yes") {
    echo("<TD><INPUT type=\"checkbox\" checked name=\"delmp[]\" value=\"" . $arr['id'] . "\"></TD>\n</TR>\n");
   }
   else {
    echo("<TD><INPUT type=\"checkbox\" name=\"delmp[]\" value=\"" . $arr['id'] . "\"></TD>\n</TR>\n");
   }

  /////////////////////////////////////////////////////////////////////////////////
}
print("</table>");
print("<p>Times are in GMT.</p>\n");
?>
<input type="submit" value="Delete!" />
</form>
<!------------------------------------------------->
<A href="spam.php?&page=<? echo $_GET[page];?>action=<? echo $_GET[action]; ?>&box=<? echo $_GET[box]; ?>&check=yes">Select All</A>
<!------------------------------------------------->
<?
print($pagerbottom);
stdfoot();
?>


save and upload as take_delmp.php
<?
require_once("include/bittorrent.php");
dbconn();
loggedinorreturn();
if (get_user_class() == UC_SYSOP) {

if(isset($_POST["delmp"])) {
$do="DELETE FROM messages WHERE id IN (" . implode(", ", $_POST[delmp]) . ")";
$res=mysql_query($do);
}
}
header("Refresh: 0; url=/spam.php");
?>