Login
Username: Password:
Remember me

[Sign Up] / [Recover Password]

Theme / Language

Popular
New Torrents
new name
Size: 18.40 MB
Most active
new name
S: 74 L: 3
New Posters
View If Messages Are Read
Controls ·  Search New posts · Mark unread

You are in: Forum / Forum / v2.08 / v2.08 Mods Completed

Unknown User
2012-11-14 09:02:36
This smallest modification in "messagespy" code allows you to see if messages are read or not.

If you want to see this, edit admincp.php and replace the "messagespy" code with this one:



if ($action=="messagespy"){

if ($do == "del") {

if ($_POST["delall"])

SQL_Query_exec("DELETE FROM `messages`");

else {

if (!@count($_POST["del"])) show_error_msg(T_("ERROR"), "Nothing selected", 1);

$ids = array_map("intval", $_POST["del"]);

$ids = implode(", ", $ids);

SQL_Query_exec("DELETE FROM `messages` WHERE `id` IN ($ids)");

}

header("Refresh: 2;url=admincp.php?action=messagespy");

stdhead();

show_error_msg("Success", "Entries deleted", 0);

stdfoot();

die;

}



stdhead("Message Spy");

navmenu();



$res2 = SQL_Query_exec("SELECT COUNT(*) FROM messages WHERE location in ('in', 'both')");

$row = mysql_fetch_array($res2);

$count = $row[0];



$perpage = 50;



list($pagertop, $pagerbottom, $limit) = pager($perpage, $count, "admincp.php?action=messagespy&");



begin_frame("Message Spy");



$res = SQL_Query_exec("SELECT * FROM messages WHERE location in ('in', 'both') ORDER BY id DESC $limit");



$mess = number_format(get_row_count("messages"),0);

$read = number_format(get_row_count("messages", "WHERE unread = 'no'"));

$unread = number_format(get_row_count("messages", "WHERE unread = 'yes'"));



print("<div style='margin-top:10px' align='center'><font size='2'>Messages: <b>$mess</b> &nbsp;|&nbsp; Read: <b>$read</b> &nbsp;|&nbsp; Unread: <b>$unread</b></font</div>");

print("<br /><br />");



echo $pagertop;



print("<form id='messagespy' method='post' action='?action=messagespy&amp;do=del'><table border='0' cellspacing='0' cellpadding='3' align='center' class='table_table'>n");



print("<tr>

<th class='table_head' align='left'><input type='checkbox' name='checkall' onclick='checkAll(this.form.id);' /></th>

<th class='table_head' align='left'>INFO</th>

<th class='table_head' align='left'>Text</th>

<th class='table_head' align='center' width='10%'>Date</th>

</tr>n");



while ($arr = mysql_fetch_assoc($res)){

$res2 = SQL_Query_exec("SELECT username FROM users WHERE id=" . $arr["receiver"]);



if ($arr2 = mysql_fetch_assoc($res2))

$receiver = "<a href='account-details.php?id=" . $arr["receiver"] . "'><b>" . $arr2["username"] . "</b></a>";

else

$receiver = "<i>Deleted</i>";



$res3 = SQL_Query_exec("SELECT username FROM users WHERE id=" . $arr["sender"]);

$arr3 = mysql_fetch_assoc($res3);



$sender = "<a href='account-details.php?id=" . $arr["sender"] . "'><b>" . $arr3["username"] . "</b></a>";

if( $arr["sender"] == 0 )

$sender = "<b>System</b>";

$msg = format_comment($arr["msg"]);



$added = utc_to_tz($arr["added"]);



print("<tr>

<td class='table_col2'><input type='checkbox' name='del[]' value='$arr[id]' /></td>

<td align='left' class='table_col1'>

Sender:&nbsp;$sender

<div style='margin-top:5px; margin-bottom:5px'>Receiver:&nbsp;$receiver</div>

Read:&nbsp;".($arr["unread"] != "yes" ? "<b><font color=limegreen>Yes</font></b>" : "<b><font color=red>No</font></b>")."

</td>

<td align='left' class='table_col1'>$msg</td>

<td align='center' class='table_col2'>$added</td>

</tr>");

}



print("</table><br />");

echo "<input type='submit' value='Delete Checked' /> <input type='submit' value='Delete All' name='delall' /></form>";



print($pagerbottom);



end_frame();

stdfoot();

}


msgspy.png
msgspy.png
2012-11-14 12:06:38
Wowww! Thanks You!! :D
Unknown User
2012-11-14 14:06:05
Very nice, thanks
2012-11-17 17:36:29
I like that, thanks for the share :)
TTv3 Micro Edition
Ubuntu 20.04.6 LTS Server
Mysql Version: 10.3.39-MariaDB-0ubuntu0.20.04.2
PHP Version: 7.4.3-4ubuntu2.20
Apache Version: Apache/2.4.59 (Ubuntu)
Unknown User
2012-12-01 06:16:32
thanks :)
Unknown User
2012-12-01 09:05:25
thanks
Unknown User
2013-01-09 00:35:12
Thank you
Unknown User
2013-02-17 07:30:50
thanks that is really nice
Unknown User
2013-02-18 23:07:22
Can some 1 make the pm for users desplay like that and when some click on the pm alret auto mark as read thanks
Unknown User
2013-09-09 02:20:19
Work great thanks the KING
Unknown User
2020-09-12 14:46:25
[php]
if ($action=="messagespy") {
if ($do == "del") {
if ($_POST["delall"])
SQL_Query_exec("DELETE FROM `messages`");
else {
if (!@count($_POST["del"])) show_error_msg(T_("ERROR"), "Nothing selected",  1);
$ids = array_map("intval", $_POST["del"]);
$ids = implode(", ", $ids);
SQL_Query_exec("DELETE FROM `messages` WHERE `id` IN ($ids)");
}

header("Refresh: 2;url=admincp.php?action=messagespy");

stdhead();

show_error_msg("Success", "Entries deleted", 0);

stdfoot();
die;
}

stdhead("Message Spy");
navmenu();

$res2 = SQL_Query_exec("SELECT COUNT(*) FROM messages WHERE location in ('in', 'both')");
$row = mysql_fetch_array($res2);
$count = $row[0];
$perpage = 50;

list($pagertop, $pagerbottom, $limit) = pager($perpage, $count, "admincp.php?action=messagespy&amp;");

begin_frame("Message Spy");

$res = SQL_Query_exec("SELECT * FROM messages WHERE location in ('in', 'both') ORDER BY id DESC $limit");
$mess = number_format(get_row_count("messages"),0);
$read = number_format(get_row_count("messages", "WHERE unread = 'no'"));
$unread = number_format(get_row_count("messages", "WHERE unread = 'yes'"));

print("<div style='margin-top:10px' align='center'><font size='2'>Messages: <b>$mess</b> &nbsp;|&nbsp; Read: <b>$read</b> &nbsp;|&nbsp; Unread: <b>$unread</b></font</div>");
print("<br /><br />");
echo $pagertop;
print("<form id='messagespy' method='post' action='?action=messagespy&amp;do=del'><table border='0' cellspacing='0' cellpadding='3' align='center' class='table_table'>\n");

print("<tr>
<th class='table_head' align='left'><input type='checkbox' name='checkall' onclick='checkAll(this.form.id);' /></th>
<th class='table_head' align='left'>INFO</th>
<th class='table_head' align='left'>Text</th>
<th class='table_head' align='center' width='10%'>Date</th>
</tr>\n");

while ($arr = mysql_fetch_assoc($res)) {
$res2 = SQL_Query_exec("SELECT username FROM users WHERE id=" . $arr["receiver"]);
if ($arr2 = mysql_fetch_assoc($res2))
$receiver = "<a href='account-details.php?id=" . $arr["receiver"] . "'><b>" . $arr2["username"] . "</b></a>";
else
$receiver = "<i>Deleted</i>";
$res3 = SQL_Query_exec("SELECT username FROM users WHERE id=" . $arr["sender"]);
$arr3 = mysql_fetch_assoc($res3);
$sender = "<a href='account-details.php?id=" . $arr["sender"] . "'><b>" . $arr3["username"] . "</b></a>";

if( $arr["sender"] == 0 )
$sender = "<b>System</b>";
$msg = format_comment($arr["msg"]);
$added = utc_to_tz($arr["added"]);

print("<tr>
<td class='table_col2'><input type='checkbox' name='del[]' value='$arr[id]' /></td>
<td align='left' class='table_col1'>
Sender:&nbsp;$sender
<div style='margin-top:5px; margin-bottom:5px'>Receiver:&nbsp;$receiver</div>
Read:&nbsp;".($arr["unread"] != "yes" ? "<b><font color=limegreen>Yes</font></b>" : "<b><font color=red>No</font></b>")."
</td>
<td align='left' class='table_col1'>$msg</td>
<td align='center' class='table_col2'>$added</td>
</tr>");
}

print("</table><br />");

echo "<input type='submit' value='Delete Checked' /> <input type='submit' value='Delete All' name='delall' /></form>";

print($pagerbottom);

end_frame();
stdfoot();
}
[/php]
Users online

No users online

Search



Statistics

    Torrents

  • Tracking: 3
  • Todays torrents: 0
  • Seeders: 0
  • Leechers: 0
  • Peers: 0
  • Downloaded: 89.96 GB
  • Uploaded: 9.86 GB

  • Members

  • We have: 838
  • New today: 0
  • Guest today: 9

  • Online

  • Total online: 9
  • Members: 0
  • Guests online: 9
  • Comments: 3
  • Messages: 1,728