View Full Version : Real "read/not read" threads and "new messages in forum" highlighting 1.1

29 Dec 2002, 16:09
Hello !

Think that i finished testing and optimizing beta hack from

- Thread on forumdisplay highlighted for user as read only if that user saw last post in that thread or if last post in that thread is older then user defined (from user CP options) amount of time (from 1 to 999 hours and infinity)
- Forums on index page and subforums on forumdisplay pages will be highlited as "have no new posts" only if user saw last post in that forum or subforum
- Highliting system is completly cookie-free
- System will require extra Database space (2-4% on large forums and 5-6% on small)
- Sytem will add some extra queries to scripts

-one addditional UPDATE is showthread.php
-one additional SELECT (of 2 fields only) for each subforum on forumdisplay.php
-one addditional UPDATE in newthread.php
-two addditional UPDATE in newreply.php
-"mark forum read" works using one extra SELECT and one extra UPDATE
-and "mark all forums read" using one extra SELECT and one extra UPDATE for each forum :)

Few words how it works :)
As you know vb "marking threads and posts read" system is time and cookie based. This hack is based on adding to "thread" table one extra field - "view" (suppose that it must work fine with TEXT type, but for really large forums we can make it LONGTEXT :)
Now when somebody open thread, his usedid will be added to that "view". After several users (who open that thread) string in that field may look like
37 298 16879 7287 29087 28 298
So it will be just a long string with userid-s separated by space
Now then user open forumdisplay.php script will check string in that view field of each thread for part of string
[space userid space]
and if is will be found thread will be marked as read. If you think that it will use too much database space, i can say that it will use some place of course, but not too much, because after each reply in thread (new last post in thread) all old data in "view" field of thread will be deleted.
On forum home page script looks for userid number in "view" field of last post in each forum and if it found, display that there were no new posts in that forum.
To make it work faster (with less database requests) was added new "view" field in thread table :)
Additionally read\unread marking can be time based (new field ) "marktime" in users table. And users are able to select number of hours (all posts older then that number of hours will be marked as read) in their CP options.
And at last to mark forum (or all forums) read we just mark read last thread in that forum (or in all forums:)
Sorry for my English and please ask questions if you don't understand something :)

Chris M
29 Dec 2002, 17:08

I'm gonna test this out:)


29 Dec 2002, 17:17
Is there a live site with this installed? Seems very interesting. Also, is it server intensive?

29 Dec 2002, 17:23
There was site. But it is down last 3 weeks and board will be replaced by ibforums (because of expired vb license). And no :) it is not server intensive at all :) Admins say that nothing changed after installing.

29 Dec 2002, 17:35
So there are sites where it can be tested?

29 Dec 2002, 17:42
Actually only 1.0 was tested :) And it much more server intensive... 1.1 was tested only locally and i asked 2 my friends to install it, but their forums have about 2 posts\month, so it was not real testing - sorry :)
But from localhost (2.2.6) everything works :)

02 Jan 2003, 01:54
Originally posted by JohnWoo
.........(because of expired vb license).......

Um, I thought the license never expires. Your support just stops after a year. Then after that you just pay a few dollars($30) for another year of support and downloads. ;)

Any screenshots avail? Or does the look of the board not really change?

02 Jan 2003, 04:18
Originally posted by 350Chevy
Um, I thought the license never expires. Your support just stops after a year. Then after that you just pay a few dollars($30) for another year of support and downloads. ;)

Depends, if you buy the owned ($160) license then that is the case, however if you buy the leased license then, yes, he is correct.

02 Jan 2003, 06:32
Ahhh... gotcha.. :)

02 Jan 2003, 08:11
Becides i have hazy idea about all that licensing things :)
I was just hired and administering vb was my job (for mor then year) And now, for some strange reason, i have to start from the beginning and go investigate ibforums... And i don't like it at all.

And here is screen shot :) part of showthread.php

04 Jan 2003, 11:24
I will be testing this myself. We've gotten a number of complaints from a few users that have been missing new threads and who have been asking for a better way to manage what they've read.

I will post the results here in the next few days.

Best wishes,

04 Jan 2003, 19:15
Just a question, perhaps it was in the hack description and I missed it...

But will this hack allow to un-read threads to be marked as new indefinately, or will they still eventually be marked as read?

04 Jan 2003, 19:47
Hello !

Not sure that i understand this question correctly - sorry :)
But to marked as read thread need:
- user opened showthread page after last post in that thread
- or last post in forum was in that thread when user desided to "mark read" that forum or all forums
- or last post in thread older then number of hours specified by user in his CP options and if that number of hours is not zero

under any other condition thread will be marked as unread :)

05 Jan 2003, 00:01
let me rephrase the question....

How long will unread posts stay unread when user does not read the thread, does not open the thread, and just reads other threads instead?

05 Jan 2003, 00:15
It will be marked unread until the user reads the thread, not a second earlier.

05 Jan 2003, 00:26

Taco John
05 Jan 2003, 05:53
I've been looking for a hack like this all week... Funny how I run into it on accident...

I'll install it right away and report back after some testing... :)

05 Jan 2003, 07:54
Originally posted by MacKenzie
let me rephrase the question....

How long will unread posts stay unread when user does not read the thread, does not open the thread, and just reads other threads instead?

Icheb is right in case of zero in user CP "Highlight as read threads without new posts last" settings :) If there is some other number, unread threads will be marked as read after that number of hours :)

05 Jan 2003, 13:43

Excellent hack. We've been needing this feature on my forums. love VB... just hate 2.X.X's method of timing out new posts.... especialy when I tend to spend a half hour to hour making a response post to any number of threads in my debate category ;)

07 Jan 2003, 03:43

07 Jan 2003, 12:34
Read the thread again, then you'll find a screenshot. Besides, is your imagination that weak? ;)

07 Jan 2003, 13:21
Possibly.... :D thanks. ;)

20 Jan 2003, 06:47
We've yet to install this hack but we're revisiting this method--has anyone successfully installed it? If so, how are things since you've done so?

Best wishes,

08 Feb 2003, 17:33

Great installation instructions and works like a breeze.


08 Feb 2003, 18:06
Nice hack but one extremely large problem here!

My site when from 28 queries on the home page to 49!!!

I love what it does but I'd like to keep my server healthy. ;)

08 Feb 2003, 18:37
Hello !

My site when from 28 queries on the home page to 49!!!

Yes :) It ads one additional query per forum on index.php...
Sorry, but it is a pay :) I am still thinking at optimizing...
But only index.php is so large problem. On all other pages it is not too heavy and you may not change index.php at all and leave it without real highlighting. After it "not read messages" on forumdisplay.php and search.php will be still real :)

20 Mar 2004, 19:30
Has anyone installed this on the new vb3 gold version? any problems / does it work?. And for a newbie when it mentions commenting lines of post then adding new after the comment, is it just basically adding whatever is mentioned after what to find/ hope this made sense !

20 Mar 2004, 19:58
please wait :)
I'll do some tests today and upgraded version for vb3 must appear tomorrow :)

20 Mar 2004, 20:24
What a great weekend this has turned out to be, first vb3 gold is released and now the one thing that everyone of my members +++++es about will hopefully be taken care of. Thank you very much JohnWoo !!!!

21 Mar 2004, 21:24
Sorry kylek, but i have not much time for playing with it today...
but hope that this one will work :)

22 Mar 2004, 00:10
No problem, I will go and check that one out. Thanks !!