Go Back   vb.org Archive > vBulletin 4 Discussion > vB4 General Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 03-07-2014, 09:19 AM
Cedric_FP Cedric_FP is offline
 
Join Date: May 2005
Posts: 169
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default 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.
Reply With Quote
  #2  
Old 03-07-2014, 09:44 AM
tbworld tbworld is offline
 
Join Date: Oct 2008
Posts: 2,126
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #3  
Old 03-11-2014, 01:44 PM
Cedric_FP Cedric_FP is offline
 
Join Date: May 2005
Posts: 169
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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?
Reply With Quote
  #4  
Old 03-11-2014, 03:32 PM
tbworld tbworld is offline
 
Join Date: Oct 2008
Posts: 2,126
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #5  
Old 03-12-2014, 03:04 AM
Cedric_FP Cedric_FP is offline
 
Join Date: May 2005
Posts: 169
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks for the help anyway, tbworld
Reply With Quote
  #6  
Old 03-12-2014, 10:42 AM
cellarius's Avatar
cellarius cellarius is offline
 
Join Date: Aug 2005
Posts: 1,987
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #7  
Old 03-13-2014, 12:08 PM
tbworld tbworld is offline
 
Join Date: Oct 2008
Posts: 2,126
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #8  
Old 03-15-2014, 07:38 AM
Cedric_FP Cedric_FP is offline
 
Join Date: May 2005
Posts: 169
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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?
Reply With Quote
  #9  
Old 03-15-2014, 02:50 PM
cellarius's Avatar
cellarius cellarius is offline
 
Join Date: Aug 2005
Posts: 1,987
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Cedric_FP View Post
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.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 01:57 AM.


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.03850 seconds
  • Memory Usage 2,240KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (2)bbcode_code
  • (3)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (9)post_thanks_box
  • (9)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (9)post_thanks_postbit_info
  • (9)postbit
  • (9)postbit_onlinestatus
  • (9)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete