Here is the code in the user info block, the first piece of code shows what should already be there, the second piece of code shows the logout line:
Code:
if (is_user($user)) {
$content .= "<br><img src=\"images/blocks/group-4.gif\" height=\"14\" width=\"17\"> "._BWEL.", <b>$uname</b>.<br>\n<hr>\n";
$sql = "SELECT user_id FROM $user_prefix"._users." WHERE username='$uname'";
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);
$uid = $row[user_id];
$newpms = $db->sql_numrows($db->sql_query("SELECT privmsgs_to_userid FROM $prefix"._bbprivmsgs." WHERE privmsgs_to_userid='$uid' AND (privmsgs_type='5' OR privmsgs_type='1')"));
$oldpms = $db->sql_numrows($db->sql_query("SELECT privmsgs_to_userid FROM $prefix"._bbprivmsgs." WHERE privmsgs_to_userid='$uid' AND privmsgs_type='0'"));
$content .= "<img src=\"images/blocks/email-y.gif\" height=\"10\" width=\"14\"> <a href=\"modules.php?name=Private_Messages\"><b>"._BPM."</b></a><br>\n";
$content .= "<img src=\"images/blocks/email-r.gif\" height=\"10\" width=\"14\"> "._BUNREAD.": <b>$newpms</b><br>\n";
$content .= "<img src=\"images/blocks/email-g.gif\" height=\"10\" width=\"14\"> "._BREAD.": <b>$oldpms</b><br>\n<hr>\n";
Code:
if (is_user($user)) {
$content .= "<br><img src=\"images/blocks/group-4.gif\" height=\"14\" width=\"17\"> "._BWEL.", <b>$uname</b>.<br>\n";
$sql = "SELECT user_id FROM $user_prefix"._users." WHERE username='$uname'";
$content .= "<img src=images/blocks/icon_dot.gif>&<a href=\"modules.php?name=Your_Account&op=logout\">Logout</a><BR>\n<hr>\n";
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);
$uid = $row[user_id];
$newpms = $db->sql_numrows($db->sql_query("SELECT privmsgs_to_userid FROM $prefix"._bbprivmsgs." WHERE privmsgs_to_userid='$uid' AND (privmsgs_type='1' OR privmsgs_type='5')"));
$oldpms = $db->sql_numrows($db->sql_query("SELECT privmsgs_to_userid FROM $prefix"._bbprivmsgs." WHERE privmsgs_to_userid='$uid' AND privmsgs_type='0'"));
$content .= "<img src=\"images/blocks/email-y.gif\" height=\"10\" width=\"14\"> <a href=\"modules.php?name=Private_Messages\"><b>"._BPM."</b></a><br>\n";
$content .= "<img src=\"images/blocks/email-r.gif\" height=\"10\" width=\"14\"> "._BUNREAD.": <b>$newpms</b><br>\n";
$content .= "<img src=\"images/blocks/email-g.gif\" height=\"10\" width=\"14\"> "._BREAD.": <b>$oldpms</b><br>\n<hr>\n";
This is how I have it set on my site. Please let me know if this helps, if not, I can get with you on ICQ or MSN and help you out further.
Linzilla
Kommius Nuke Soldier
Joined: Jul 09, 2003
Posts: 32
Posted:
Mon Jul 14, 2003 5:21 am
What's the line of code i have to use so that i may allow users who are currently online to add other users to their buddy list (like on the NukeCop Site Visitors block)?? I'm not sure what info it is that i have to retrieve from the database to fetch the members profile number...
sting Site Admin
Joined: Jul 24, 2003
Posts: 1985
Location: Apparently ALWAYS Online. . .
Posted:
Tue Aug 05, 2003 12:40 pm
Linzilla:
Thanks for the code - it works with the exception that I see a "&" on the screen, and I of course had to put the icon_dot.gif file in the appropriate directory. I may try removing the & to see if that works... Seems logical.
Thanks again
-sting
_________________ Is it paranoia if they are really out to get you?
-------------------------------------------------------
sting usually hangs out at nukehaven.net
natten Nuke Soldier
Joined: May 22, 2003
Posts: 16
Posted:
Tue Aug 05, 2003 1:29 pm
The little section saying, for example:
Private Messages
Unread: 5
Read: 0
does NOT work at all... It simply states wrong number, why is that?
natten Nuke Soldier
Joined: May 22, 2003
Posts: 16
Posted:
Tue Aug 05, 2003 2:16 pm
I fixed it by replacing the
$newpms
with
$newpm , from the old "who_is_online" block! (remember to add and "S")
Here is how you do it:
find the
$newpms(...) in the "block-User"_info" file
and then overwrite the line with:
$newpms = $db->sql_numrows($db->sql_query("SELECT * FROM ".$prefix."_bbprivmsgs WHERE privmsgs_to_userid='$uid' AND (privmsgs_type='5' OR privmsgs_type='1')"));
That should do it!
sdanks Nuke Cadet
Joined: Aug 12, 2003
Posts: 3
Posted:
Wed Aug 13, 2003 1:55 pm
Since Nukemods has been closed down, is there somewhere else I can get the site_vistors module?
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum