Quote
Mod Name: Snippit:: Shows who has sent you pm's and how many you have. (User Info Panel Mod)
Filename: ---
Author: Dark Fusion
Version: v1.00 (PHPFusion V7.02)
Developer: DrunkeN
Site: http://www.dark-fusion.se
Quote
License:
This program is released as free software under the
Affero GPL license. You can redistribute it and/or
modify it under the terms of this license which you
can read by viewing the included agpl.txt or online
at http://www.gnu.org/licenses/agpl.html. Removal of this
copyright header is strictly prohibited without
written permission from the original author(s).
Quote
DESCRIPTION:
This modification will Show who has sent you pm's and how many you have in a list with the usernames and how many PM's you have from the user.
Quote
INSTALLATION:
Open infusions/user_info_panel/user_info_panel.php
FindCode Download source
echo ($msg_count == 1 ? $locale['global_126'] : $locale['global_127'])."</a></strong>\n";
echo "</div>\n";
Add this afterCode Download source$result = dbquery("SELECT m.message_id,
m.message_read,
m.message_datestamp,
u.user_id,
u.user_name,
u.user_status,
u.user_avatar
FROM ".DB_MESSAGES." m
LEFT JOIN ".DB_USERS." u ON m.message_from=u.user_id
WHERE message_to='".$userdata['user_id']."' AND message_folder='0' AND message_read='0'
GROUP BY u.user_id DESC LIMIT 0,10"
);
$senders = array();
if(dbrows($result)){
while ($pmdata = dbarray($result)) {
$senders[] = array($pmdata['user_id'], $pmdata['user_name'], $pmdata['user_status']);
}
if (count($senders)) {
$i = 1;
echo "<table cellpadding='0' cellspacing='0' width='100%'><tr>\n";
echo "<td class='tbl2'><strong>From</strong></td>";
echo "<td align='right' class='tbl2'><strong>Messages</strong></td>";
echo "</tr>";
while (list($key, $sender) = each($senders)) {
$pmcount = dbcount("(message_id)", DB_MESSAGES, "message_to='".$userdata['user_id']."' AND message_from='".$sender[0]."' AND message_read='0'");
echo "<tr>\n<td>".profile_link($sender[0], $sender[1], $sender[2])."</td>\n<td align='right'>".$pmcount." ".($pmcount == 1 ? $locale['global_126'] : $locale['global_127'])."</td>\n</tr>\n";
$i++;
}
echo "</table>";
}
}
[/code]
Save and upload user_info_panel.php
Demo: See attached images.
Category Forum
Code Snippet and functions - 8Labels
None yet
Statistics
3 participants
Notifications
You are not receiving notifications from this thread.
Related Questions