Version: 1.00, by JohnWoo
Developer Last Online: Apr 2014
Version: 2.2.x
Rating:
Released: 12-26-2002
Last Update: Never
Installs: 1
Is in Beta Stage
No support by the author.
Hello everybody !
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 "post" 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" field of last post of thread. 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 each last post 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 all "view" fields of all old posts in 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) i added "lastpostid" 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 post in that forum (or in all forums
Sorry for my English and please ask questions if you don't understand something
If im correct this will not mark threads as "read" when your session has timed out. I would install it but im worried about it adding alot of clutter to my Database.
John, do you have any idea how many querys this adds and how much processing time it will add to a forum?. Id love to add it but not if it will cause slower responce times.
-one addditional UPDATE is showthread.php
-one additional SELECT (of 2 fields only) for each thread or subforum on forumdisplay.php and search.php pages
-one addditional UPDATE in newthread.php
-two addditional UPDATE in newreply.php
-"mark forum read" works using one UPDATE
-and "mark all forums read" using one UPDATE for each forum
So, in theory forumdisplay.php will work little slower, but i can't notice it using eyes only
Originally posted by JohnWoo -one additional SELECT (of 2 fields only) for each thread or subforum on forumdisplay.php and search.php pages
If you have 25 threads displayed per page that will add 25 queries, lol . I am rather someone who sacrifices *some* features to get less neccessaire queries.
Hey, as I know.... This is a good one.. BUT
it will add too much data that is not really needed to the database..
Why don't you make an Additional Table .. let's call it (thread_read)
and add 3 fields (userid, threadid, timestamp)
and then add to it so you can at least delete them from time to time especially if the topics are too old --> no need to specify who read it
If you have 25 threads displayed per page that will add 25 queries, lol . I am rather someone who sacrifices *some* features to get less neccessaire queries.
If using a new table, he could add a JOIN to the thread SELECT so it will be the same # of queries
Originally posted by Ageel
it will add too much data that is not really needed to the database..
sorry, but i can't agree In theory on forum with 2000-3000 registered users, 25-30 always on-line users, common number 5 posts in each thread and common post length 80 words/400 bytes it will take about 3-4% of DB space
Quote:
Originally posted by Ageel
Why don't you make an Additional Table .. let's call it (thread_read) and add 3 fields (userid, threadid, timestamp)
Tried it already That way will use much more db\processor space\time. Actually i am thinking at that problem about year already... Checked code of most free\not free forums and had a lot of different attepts
Quote:
Originally posted by Icheb
If you have 25 threads displayed per page that will add 25 queries, lol . I am rather someone who sacrifices *some* features to get less neccessaire queries.
Sorry I still thinking at optimizing... Hope that somebody more clever will perform it with less db time\space
PS It was the only feature that i really missed in vb