![]() |
read messages
Can anyone help me with this line of code? I am trying to find the amount of read messages form the listing of messages in the private messages.
$readpm=$DB_site->query_first("SELECT COUNT(*) AS messages FROM privatemessage WHERE userid=$bbuserinfo[userid] AND folderid=0 $ignoreusers"); It is counting all of the messages as read. Any help will be greatly appreciated. Thanks in advance. |
You have to add AND readtime!=0
|
Thank you very much. It worked great! But now it says that I still have a new message after reading it. This is the code for new messages. Am I missing something in here also?
$newpm=$DB_site->query_first("SELECT COUNT(*) AS messages FROM privatemessage WHERE userid=$bbuserinfo[userid] AND dateline>$bbuserinfo[lastvisit] AND folderid=0 $ignoreusers"); |
Replace [minicode]dateline>$bbuserinfo[lastvisit][/minicode] with [minicode]readtime <> 0[/minicode] . :)
|
After changing that line of code as instructed, it still says I have one new message when I have already read it. Here is the complete code in case something else is messing it up.
$ignoreusers=""; if (trim($bbuserinfo['ignorelist'])!="") { $ignoreusers='AND fromuserid<>'.implode(' AND fromuserid<>',explode(' ',$bbuserinfo[ignorelist])); } $newpm=$DB_site->query_first("SELECT COUNT(*) AS messages FROM privatemessage WHERE userid=$bbuserinfo[userid] AND readtime <> 0 AND folderid=0 $ignoreusers"); $readpm=$DB_site->query_first("SELECT COUNT(*) AS messages FROM privatemessage WHERE userid=$bbuserinfo[userid] AND readtime!=0 AND folderid=0 $ignoreusers"); $unreadpm=$DB_site->query_first("SELECT COUNT(*) AS messages FROM privatemessage WHERE userid=$bbuserinfo[userid] AND messageread=0 AND folderid=0 $ignoreusers"); $sentpm=$DB_site->query_first("SELECT COUNT(*) AS messages FROM privatemessage WHERE userid=$bbuserinfo[userid] AND folderid=-1 $ignoreusers"); $allpm=$DB_site->query_first("SELECT COUNT(*) AS messages FROM privatemessage WHERE userid=$bbuserinfo[userid] $ignoreusers"); Hope this is helpful to you because it has me stumped. :-) |
yea.. it'll say u have a new message.. but it wont say u have an unread message
|
Ok, I've narrowed it down to cookies. If I turn off "Automatic login with cookies" then it reads it right. But when I go into my usercp with that set, I have to re-login each time. Is there any way to re-set the new messages without cookies interfering with it in any way?
|
All times are GMT. The time now is 07:04 AM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|