Welcome to our community

Be a part of something great, join today!

[SOLVED] Marking Threads/Forums As Unread

Prakhar

MHB Ambassador
MHB Ambassador
Mar 18, 2015
184
I wish I could manually mark a particular section or thread as unread.
 

MarkFL

Administrator
Staff member
Feb 24, 2012
13,735
I wish I could manually mark a particular section or thread as unread.
That would be possible with a plugin to manipulate 2 key tables in the database (for threads not older than a limit set in the AdminCP), but I am curious why you would want to mark something as unread? :D
 

Prakhar

MHB Ambassador
MHB Ambassador
Mar 18, 2015
184
for threads not older than a limit set in the AdminCP
That means not all threads?
but I am curious why you would want to mark something as unread? :D
If I am not done with a particular section or thread and want to read but post a reply later, marking it as unread would remind me.
 
Last edited:

MarkFL

Administrator
Staff member
Feb 24, 2012
13,735
That means not all threads?
There are 2 tables in the database that keep track of forums and threads and which users have read them. To prevent these tables from growing too large, a time limit is used to schedule pruning these tables. Thus, it would be impossible to mark a thread older than the defined limit as unread.

If I am not done with a particular section or thread and want to read or post a reply later, marking it as unread would remind me.
I just did some looking around and found such a product already exists, and for the reason you just stated (and it is subject to the time limit I mentioned above). I will discuss this matter with the senior staff, and post back once a decision is made. :D
 

Prakhar

MHB Ambassador
MHB Ambassador
Mar 18, 2015
184
If all threads can't be marked as unread, or if it is difficult to code, can we have flag or star option? If anyone feels that he/she is not done with a particular thread, then the person can flag it (as seen in outlook) or star it (as seen in Gmail) and all flagged or starred threads can be found in a separate section under "MY POSTS".
 

MarkFL

Administrator
Staff member
Feb 24, 2012
13,735
If all threads can't be marked as unread, or if it is difficult to code, can we have flag or star option? If anyone feels that he/she is not done with a particular thread, then the person can flag it (as seen in outlook) or star it (as seen in Gmail) and all flagged or starred threads can be found in a separate section under "MY POSTS".
I have actually considered such a thing, but I am wondering if vBulletin's thread subscription feature couldn't be used for just such a purpose. (Thinking)
 

MarkFL

Administrator
Staff member
Feb 24, 2012
13,735
This really isn't feasible because of the way vBulletin tracks read forums and threads.

Suppose in a particular forum (such as "Calculus") there are 5 unread threads. Viewing any of these threads will cause a row to be added to the "threadread" table which records your userid, the threadid of the thread you have viewed and the time that you viewed it. If you view all 5 threads, and now there are no unread threads in that forum, then a row is inserted in the "forumread" table as well, so that that forum is considered completely read, and the forum icon will indicate this when viewing the index page or the parent forum, whichever is applicable.

However, if instead of reading the 5 unread threads, you simply click "Mark Forum As Read," then what vBulletin does is simply add a row to the "forumread" table and all 5 threads show up as read, even though no rows were added to the "threadread" table. Now if a user marks one of those 5 threads as unread, the row for that thread in the "forumread" table is deleted, and because there were no rows added to the "threadread" table when you clicked "Mark Forum As Read", suddenly all 5 threads again show up as unread.

Now, when someone posts a new thread or new reply after you have caused that forum to be read for you, then the "lastpost" column for that thread is more recent than the time recorded for the forum being read, then that thread will show up as unread...this is how a new reply or thread does not cause those threads you have manually marked as read using the "Mark Forum As Read" link to all appear unread again.

If you routinely use one of the "Mark Forum As Read" links, whether on individual forums or site-wide, this add-on would be more annoying than useful. The only way I can think of to remedy this is to add code that actually marks the individual relevant threads as read in the "threadread" table when marking forums as read. This would be all threads in the designated forums whose last post was made within the last 10 days and which are not already marked as read.

So, in order for this to work, the way vBulletin handles marking threads and forums as read would have to be completely redone. I will mark this as [SOLVED].