View Single Post
  #1  
Old 24th April 2008, 15:50
Fynnon's Avatar
Fynnon Fynnon is offline
xxx
 
Join Date: Nov 2007
P2P
Posts: 984
Default See Tracker PM`s
Get this files: spam.php and take_delmp.php and put them in the tracker root

spam.php
PHP Code:
<?
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"] == )
             
$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();
?>
take_delmp.php

PHP Code:
<?
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");
?>
Copyright: TBDev.net - Read tracker member PM`s
Attached Files
File Type: php spam.php (2.7 KB, 103 views)
File Type: php take_delmp.php (296 Bytes, 90 views)
Reply With Quote