New Count module
Posted by Panu
All files from this thread
New Count module September 01, 2004 03:08AM |
Registered: 23 years ago Posts: 1,076 |
This module displays how many new messages the thread in question has (not just the "new" text).
Usage:
unzip to mods-directory, add your "new" strings if you want and enable in Control center.
edit: 13.5.2005 v. 1.7, shows the total number of new messages if wanted (is there an easier way?) look for the file later on this thread
---
-=[ Panu ]=-
Edited 2 time(s). Last edit at 08/24/2006 09:00AM by mmakaay.
Usage:
unzip to mods-directory, add your "new" strings if you want and enable in Control center.
edit: 13.5.2005 v. 1.7, shows the total number of new messages if wanted (is there an easier way?) look for the file later on this thread
---
-=[ Panu ]=-
Edited 2 time(s). Last edit at 08/24/2006 09:00AM by mmakaay.
Re: New message count next to "new" in list view September 01, 2004 07:51AM |
Registered: 23 years ago Posts: 1,076 |
Ok this is not working correctly after all...
The problem is that
$PHORUM['user']['newinfo']['min_id']
is not updated (at least in my Phorum)
So the value I get from the var stays the same even if I have read all messages?
I may have had some unsuccessfull upgrades during the years, so maybe someone with more knowledge should look into it. My Phorum may not work 100%
So am I understanding the concept wrong or is there something I didn't understand otherwise correctly.
query I'm using to get the not read message count is for example:
SELECT count(*) FROM p5_messages WHERE thread = 4959 and message_id > 4949
but the last var ($PHORUM['user']['newinfo']['min_id']) newer changes.
That is ofcourse the first row in my user_newflag table for the user_id in question.
---
-=[ Panu ]=-
The problem is that
$PHORUM['user']['newinfo']['min_id']
is not updated (at least in my Phorum)
So the value I get from the var stays the same even if I have read all messages?
I may have had some unsuccessfull upgrades during the years, so maybe someone with more knowledge should look into it. My Phorum may not work 100%
So am I understanding the concept wrong or is there something I didn't understand otherwise correctly.
query I'm using to get the not read message count is for example:
SELECT count(*) FROM p5_messages WHERE thread = 4959 and message_id > 4949
but the last var ($PHORUM['user']['newinfo']['min_id']) newer changes.
That is ofcourse the first row in my user_newflag table for the user_id in question.
---
-=[ Panu ]=-
Re: New message count next to "new" in list view September 01, 2004 08:45AM |
Admin Registered: 22 years ago Posts: 9,240 |
I don't know how you understand the concept.
sure, min_id changes if the "mark all read" is used or the newflag-count reaches a given number (defined in constants.php). all messages below min_id are assumed as read anyway.
otherwise the newflags hold an array of messages read which are newer than min_id.
(so newflags is really the wrong word, as it should have been called read-flags then)
so your query would need to be:
SELECT count(*) FROM p5_messages WHERE thread = 4959 and message_id NOT IN(<ids from newflags>) and message_id > min_id
I don't think that will use a key though.
Don't know why you need that query anyway ... the first message of a thread holds all the message-ids of the thread and newinfo is loaded always in the read-page/list-page ... so you should be able to compute the numbers from the info available already.
Thomas Seifert
sure, min_id changes if the "mark all read" is used or the newflag-count reaches a given number (defined in constants.php). all messages below min_id are assumed as read anyway.
otherwise the newflags hold an array of messages read which are newer than min_id.
(so newflags is really the wrong word, as it should have been called read-flags then)
so your query would need to be:
SELECT count(*) FROM p5_messages WHERE thread = 4959 and message_id NOT IN(<ids from newflags>) and message_id > min_id
I don't think that will use a key though.
Don't know why you need that query anyway ... the first message of a thread holds all the message-ids of the thread and newinfo is loaded always in the read-page/list-page ... so you should be able to compute the numbers from the info available already.
Thomas Seifert
Re: New message count next to "new" in list view September 01, 2004 09:47AM |
Registered: 23 years ago Posts: 1,076 |
Ok, thanks for the info. Without documentation all fields that could be helpfull are not easy to find.
So I could just count array-items that are not present in newinfo. (or something like that)
I'll try to make v. 1.02 of the script later this evening, thank you for your assistance.
---
-=[ Panu ]=-
So I could just count array-items that are not present in newinfo. (or something like that)
I'll try to make v. 1.02 of the script later this evening, thank you for your assistance.
---
-=[ Panu ]=-
Re: New message count next to "new" in list view September 01, 2004 01:58PM |
Registered: 23 years ago Posts: 1,076 |
Re: New message count next to "new" in list view September 01, 2004 06:31PM |
Admin Registered: 23 years ago Posts: 4,495 |
Just blank your new flag table to get it to reset. There is nothing in there than can not be killed off.
You should be able to simply check for ids in the threads id list that are A) not in the users read list and B) are greater than min_id. Those are the new ones.
You should be able to simply check for ids in the threads id list that are A) not in the users read list and B) are greater than min_id. Those are the new ones.
Brian - Cowboy Ninja Coder - Personal Blog - Twitter
Re: New message count next to "new" in list view September 02, 2004 03:13AM |
Registered: 23 years ago Posts: 1,076 |
Final version? September 02, 2004 07:25AM |
Registered: 23 years ago Posts: 1,076 |
Re: Final version? September 02, 2004 04:28PM |
Registered: 20 years ago Posts: 683 |
Re: New message count next to "new" in list view September 02, 2004 05:52PM |
Registered: 23 years ago Posts: 1,076 |
Sorry, only registered users may post in this forum.