[Request] pm spy 09

Started by undertaker, February 08, 2013, 04:01:22 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Diablo999

#4
Here's one for '09 and drop it in your admin folder. Most mods for V1 & V2 here works with tbdev09, you just have to alter them a bit.

/admin/pmview.php
<?php
/**
 *   https://09source.kicks-ass.net:8443/svn/installer09/
 *   Licence Info: GPL
 *   Copyright (C) 2010 Installer09 v.2
 *   A bittorrent tracker source based on TBDev.net/tbsource/bytemonsoon.
 *   Project Leaders: Mindless,putyn,kidvision.
 **/
if ( ! defined'IN_TBDEV_ADMIN' ) )
{
print "<h1>{$lang['text_incorrect']}</h1>{$lang['text_cannot']}";
exit();
}

require_once 
"./include/user_functions.php";
require_once 
"./include/html_functions.php";
require_once 
"./include/bbcode_functions.php";
require_once 
"./include/pager_functions.php";
$lang array_merge$langload_language('ad_pmview') );
//$stdfoot = array(/** include js **/'js' => array('checkall'));    
if ($CURUSER['class'] < UC_CODER)
      
stderr("{$lang['stderr_error']}""{$lang['text_denied']}");
$HTMLOUT='';


if(isset(
$_POST["delmp"])) {
$do="DELETE FROM messages WHERE id IN (" implode(", "$_POST['delmp']) . ")";
$res=sql_query($do);
header ("Refresh: 0; url=staffpanel.php?tool=pmview&amp;action=pmview");
stderr("Success" "The messages where successfully deleted!");
}


$HTMLOUT .='<script type="text/javascript">
/*<![CDATA[*/
var checkflag = "false";
var marked_row = new Array;
function check(field) {
if (checkflag == "false") {
for (i = 0; i < field.length; i++) {
field[i].checked = true;}
checkflag = "true";
}else {
for (i = 0; i < field.length; i++) {
field[i].checked = false; }
checkflag = "false";
}
}
/*]]>*/
</script>'
;

$res2 sql_query("SELECT COUNT(*) FROM messages");
$row mysql_fetch_array($res2);
$count $row[0];
$perpage 15;
$pager pager($perpage$count"admin.php?action=pmview&amp;action=pmview&amp;");

if (
$count $perpage)
$HTMLOUT .= $pager['pagertop'];

$res sql_query("SELECT msg.receiver, msg.subject, msg.sender, msg.unread, msg.msg, msg.added, msg.id, u1.username AS u1_username, u2.username AS u2_username FROM messages AS msg LEFT JOIN users AS u1 ON u1.id=msg.receiver LEFT JOIN users AS u2 ON u2.id=msg.sender ORDER BY msg.id DESC {$pager['limit']}") or sqlerr(__FILE____LINE__);

$HTMLOUT .= begin_main_frame("Administrative message overview");
$HTMLOUT .="
<form method='post' action='admin.php?action=pmview&amp;action=pmview'>
<table border='1' cellspacing='0' cellpadding='5'>\n
<tr>
<td class='colhead' align='left' width='1%'>Info</td>
<td class='colhead' align='left' width='1%'>Subject</td>
<td class='colhead' align='left'>Text</td>
<td class='colhead' align='left' width='1%'>Date</td>
<td class='colhead' width='1%'>Del</td></tr>\n"
;
while (
$arr mysql_fetch_assoc($res))
{
$receiver "<a href='userdetails.php?id=" $arr["receiver"] . "'><b>" $arr["u1_username"] . "</b></a>";
if(
$arr["sender"] != 0)
$sender "<a href='userdetails.php?id=" $arr["sender"] . "'><b>" $arr["u2_username"] . "</b></a>";
else
$sender "<font color='red'><b>System</b></font>";
$msg format_comment($arr["msg"]);
$added get_date($arr["added"], 'DATE',0,1);

$HTMLOUT .="<tr>
<td align='left'><b>Sender:</b>&nbsp;&nbsp;&nbsp;&nbsp;
$sender<br /><b>Reciever:</b>&nbsp;$receiver<br /><b>Read</b>&nbsp;&nbsp;&nbsp;&nbsp;".($arr["unread"] != "yes" "<b><font color='lightgreen'>Yes</font></b>" "<b><font color='red'>No</font></b>")."</td>
<td align='left'>"
.format_comment($arr['subject'])."</td>
<td align='left'>
$msg</td><td align='left'>$added</td><td align='center'><input type='checkbox' name='delmp[]' title='Mark' value='" $arr['id'] . "' /></td></tr>\n";
}
$HTMLOUT .="<tr>
<td colspan='4' align='right' class='colhead'>Mark&nbsp;all&nbsp;Messages </td>
<td width='2%' class='colhead'>
<input type='checkbox' title='Mark All' value='Mark All' onclick=\"this.value=check(form.elements);\" />
</td></tr>
<tr><td colspan='5' align='center'><input type='submit' value='Delete selected messages!' /></td></tr>"
;

$HTMLOUT .="</table></form>";

$HTMLOUT .= end_main_frame();
if (
$count $perpage)
$HTMLOUT .= $pager['pagerbottom'];
print 
stdhead("{$lang['pmview_header']}") . $HTMLOUT stdfoot();
?>


Edit: Forgot the lang-file.
lang/lang_ad_pmview.php
<?php
$lang 
= array( 

'pmview_error'  => 'Error'
'pmview_noacc'  => 'You have no rights to be here'
'pmview_incorrect'  => 'You have no rights to be here, move ya ass freak'
'pmview_cannot'  => 'You cant see this outsite admin'
'pmview_header'  => 'Message Log'
'pmview_title'  => 'Message Log'
'pmview_from'  => 'From:'
'pmview_to'  => 'To:'
'pmview_message'  => 'Message:'
'pmview_info'  => 'Please inform your user, stat you spy on them'
);
?>


DarkMaster

heres my old one but you will need to modify it alittle to work with 09

<?
ob_start("ob_gzhandler");
require "include/bittorrent.php";
dbconn(false);
loggedinorreturn();
if (get_user_class() < UC_STAFF_LEADER) {
  stdhead("Error!");
  $iduser= ($CURUSER["id"]); $addusername = $CURUSER['username']; $link_touser = "<a target='_blank' href='userdetails.php?id=$iduser'>$addusername</a>";
  write_staff_log("$link_touser is have message:<br>Permission denied! (Attempt To Acess Tool By UnAutorised Person).","FF9900","error");
  stdmsg('Error',"Permission denied!", error);
  stdfoot();
  die();
  }
gzip();
noaccess(UC_STAFF_LEADER);

//optimized, secured, added options, fixed some typos by Alex2005 for TBDEV.NET\\

$postperpage = 0+$_GET["postperpage"];
$returnto = $_POST["returnto"];

if(isset($_POST["delmp"])) {
$do="DELETE FROM messages WHERE id IN (" . implode(", ", $_POST['delmp']) . ")";
$res=sql_query($do);
if ($returnto) {
header("Location: ".htmlspecialchars($returnto));
die;
}else{
header ("Refresh: 2; url=/msgspy.php");
stderr("Success" , "The messages where successfully deleted!");
}
}

//===start page===//
stdhead("Administrative message overview"); ?>
<center><b><font color=lime>Please <font color=red>DONT</font> delete any unread messages, as the member wont  get them.<br>
Your be deleteing the message totally and not just from here</b></font></center>
<p>
<script language="Javascript" type="text/javascript">
<!-- Begin
var checkflag = "false";
var marked_row = new Array;
function check(field) {
if (checkflag == "false") {
for (i = 0; i < field.length; i++) {
field[i].checked = true;}
checkflag = "true";
}else {
for (i = 0; i < field.length; i++) {
field[i].checked = false; }
checkflag = "false";
}
}
// End -->
</script>
<?
//===START*PAGER===//
$res2 = sql_query("SELECT COUNT(*) FROM messages $where");
$row = mysql_fetch_array($res2);
$count = $row[0];
if ($postperpage != 0)
$perpage = $postperpage;
else
$perpage = 10;
list($pagertop, $pagerbottom, $limit) = pager($perpage, $count, $_SERVER["PHP_SELF"] ."?postperpage=$perpage&" );
echo $pagertop;
//===END*PAGER===//
//===Message*amount*selector===//

//query optimized by Alex2005 for TBDEV.NET\\
$res = sql_query("SELECT msg.receiver, msg.subject, msg.sender, msg.unread, msg.msg, msg.added, msg.id, u1.username AS u1_username, u2.username AS u2_username FROM messages AS msg LEFT JOIN users AS u1 ON u1.id=msg.receiver LEFT JOIN users AS u2 ON u2.id=msg.sender ORDER BY msg.id DESC $limit") or sqlerr(__FILE__, __LINE__);

begin_main_frame("Administrative message overview");
print("<table border=1 cellspacing=0 cellpadding=5>\n");
//===select how many
print("<tr>");
print("<form method=\"GET\" action=\"/msgspy.php?\">");
//print("<input type=\"hidden\" name=\"postperpage\" value=\"postperpage\">\n");
print("<td class=\"colhead\" colspan=\"3\" align=\"left\"><b>How many messages to show per site: </b><select name=\"postperpage\">\n");
print("<option value=$postperpage>$postperpage</option>\n");
print("<option value=10>10</option>\n"); //==Set*to*value*you*need===//
print("<option value=25>25</option>\n"); //==Set*to*value*you*need===//
print("<option value=50>50</option>\n"); //==Set*to*value*you*need===//
print("<option value=150>150</option>\n"); //==Set*to*value*you*need===//
print("<option value=300>300</option>\n"); //==Set*to*value*you*need===//
print("<option value=500>500</option>\n"); //==Set*to*value*you*need===//
print("<option value=1000>1000</option>\n"); //==Set*to*value*you*need===//
print("<option value=1500>1500</option>\n"); //==Set*to*value*you*need===//
print("<input type=\"submit\" class=\"btn\" value=\"Set to it!\" /></td><td class=\"colhead\" colspan=\"2\">Times are in GMT.</td></form></tr>");
print("<form method=\"post\" name=\"form\" action=\"/msgspy.php\">");
print("<input type=\"hidden\" name=\"returnto\" value=\"msgspy.php?postperpage=$perpage&page=\">\n");
print("<tr><td class=\"colhead\" align=\"left\" width='1%'>Info</td>".
"<td class=\"colhead\" align='left' width='1%'>Subject</td>".
"<td class=\"colhead\" align=\"left\">Text</td><td class=\"colhead\" align=\"left\" width='1%'>Date</td><td class=\"colhead\" width='1%'>Del</td></tr>\n");
while ($arr = mysql_fetch_assoc($res))
{
$receiver = "<a href=userdetails.php?id=" . $arr["receiver"] . "><b>" . $arr["u1_username"] . "</b></a>";
if($arr["sender"] != 0)
$sender = "<a href=userdetails.php?id=" . $arr["sender"] . "><b>" . $arr["u2_username"] . "</b></a>";
else
$sender = "<font color=red><b>System</b></font>";
$msg = format_comment($arr["msg"]);

//if you have timezone mod, uncomment this code an comment the next one
//$added = display_date_time($arr["added"]);
$added = $arr["added"];

print("<tr><td align=\"left\"><b>Sender:</b>&nbsp;&nbsp;&nbsp;&nbsp;$sender<br><b>Reciever:</b>&nbsp;$receiver<br><b>Read</b>&nbsp;&nbsp;&nbsp;&nbsp;".($arr["unread"] != "yes" ? "<b><font color=lightgreen>Yes</font></b>" : "<b><font color=red>No</font></b>")."</td>".
"<td align=left>".format_comment($arr['subject'])."</td>".
"<td align=left>$msg</td><td align=left>$added</td><td align=center><input type=\"checkbox\" name=\"delmp[]\" title=\"Mark\" value=\"" . $arr['id'] . "\" /></td></tr>\n");
}
print("<td colspan=\"4\" align=\"right\" class=\"colhead\">Mark&nbsp;all&nbsp;Messages </td><td width=\"2%\" class=\"colhead\">");
?>
<input type=checkbox title='Mark All' value='Mark All' onClick="this.value=check(document.form.elements);">
<?
print("</td></tr>");
print("<tr><td colspan=\"5\" align=\"center\"><input type=\"submit\" class=\"btn\" value=\"Delete selected messages!\" /></td></tr></form>");
end_main_frame();
?><br><?
print($pagerbottom);
print("</table>");
stdfoot();
//===end page//
?>

Please Place All Support Questions In The Right Section

undertaker

i am after spy pm aswel if any one could help thanks for 09