vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=251)
-   -   Number of Unread Posts per Thread? (https://vborg.vbsupport.ru/showthread.php?t=309268)

Cedric_FP 03-07-2014 09:19 AM

Number of Unread Posts per Thread?
 
Hello,

I am interested in implementing functionality like the Something Awful forums where, after a user has read a thread, the "go to first new post" button also reads out the *number* of unread posts.

Is this possible? So far, all I know is that this is the go to first new post button code:

Code:

                                      <vb:if condition="$show['gotonewpost']"><a href="{vb:link thread, {vb:raw thread}, {vb:raw pageinfo_newpost}, 'threadid', 'threadtitle'}" id="thread_gotonew_{vb:raw thread.realthreadid}"><img class="gotonewpost" src="{vb:stylevar imgdir_button}/firstnew.png" alt="{vb:rawphrase go_to_first_new_post}" /></a>
                                        </vb:if>

Is there like a short code I can use to display, in text next to the image, the number of new unread posts in that thread? Something like:

Code:

<vb:raw threadinfo_unreadpostscount>
I just made that up, I know it doesn't exist. But I am totally unsure if this functionality is even built into VB4.


Thank you so much in advance for any help you can provide.

tbworld 03-07-2014 09:44 AM

I have really never looked into it, so I am waiting for other experts on the vbulletin.org to chime in. There is this modification that may give you some insight into the process.

Display Unread Posts (and Reputation Comments in 4.1)
https://vborg.vbsupport.ru/showthrea...=231060&page=4

If no one replies, then I will revisit the question for you. :)

Cedric_FP 03-11-2014 01:44 PM

I have to be honest, I can't find anything in that plugin to use as a template call for unread post count per thread. Perhaps it's something that is not even tracked?

tbworld 03-11-2014 03:32 PM

For posts in a thread, a record of the last post read in the thread, by the user, would have had to been stored. Looking at the database tables I do not see anything that can be used to derive it and unfortunately the way vb handles unread posts does not get us there either. It might be possible to extract recent read post information from the activity stream, but I have to ponder that some more when I have a fresh brain. :)

Sorry, for the bad news, it would have been nice if it was easily possible.

Cedric_FP 03-12-2014 03:04 AM

Thanks for the help anyway, tbworld :)

cellarius 03-12-2014 10:42 AM

vB stores read/unread-information as a timeline per thread per user, i.e. it safes the time the user last looked at the thread. One would have to get that time, then count all posts in the post table that have been posted to a said thread after that time. Since this would have to be done with every load of showthread, it has the potential to add a lot of additional strain on the database, especially the post table. It probably is possible, but I would definitely advise against it.

tbworld 03-13-2014 12:08 PM

Thanks @cellarius! Very nicely worded.

I have to quit doing research at 4am, for some reason I completely overlooked the 'post' table. I did conclude that on a busy board the extra server load, might not make this feasible, but at least now it is possible. Thanks again for the input. :)

@Cedric FP, I will add this to my backlog and take a further look at this when I have time.

Cedric_FP 03-15-2014 07:38 AM

Thanks cellarius. Though my ability to write something like that is severely limited, I will try to give it a go anyway. The server load is a good point. I wonder if it is possible to only have it count the unread posts of someone who has already visited the thread at least once. That way, it partially acts as a thread subscription.

@tbworld - thanks. I would greatly appreciate any further help on this issue.

Edit: I wonder if there is any similar functionality built into the thread subscription system?

cellarius 03-15-2014 02:50 PM

Quote:

Originally Posted by Cedric_FP (Post 2487386)
I wonder if it is possible to only have it count the unread posts of someone who has already visited the thread at least once.

Of course you would only count for users that have already visited the thread once. Only for users that have visited the thread before an entry exists in the threadread table.

Quote:

That way, it partially acts as a thread subscription.
Partially.

Quote:

Edit: I wonder if there is any similar functionality built into the thread subscription system?
No. The thread subscription system uses the same data as the unread posts system.


All times are GMT. The time now is 04:24 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01114 seconds
  • Memory Usage 1,733KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_code_printable
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (9)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete