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 05-05-2014, 02:02 PM
Set3sh's Avatar
Set3sh Set3sh is offline
 
Join Date: Jan 2013
Location: Romania
Posts: 35
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Template conditionals

How can I check for new posts in a forum/subforum?

Thank you.
Reply With Quote
  #2  
Old 05-05-2014, 02:18 PM
cellarius's Avatar
cellarius cellarius is offline
 
Join Date: Aug 2005
Posts: 1,987
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Where?
Reply With Quote
  #3  
Old 05-05-2014, 03:06 PM
Set3sh's Avatar
Set3sh Set3sh is offline
 
Join Date: Jan 2013
Location: Romania
Posts: 35
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Anywhere in a forum/subforum.

vb:if condition="new_posts">
...
<vb:else />
...

I dind't find any official documentation regarding all template variables...
Reply With Quote
  #4  
Old 05-05-2014, 03:20 PM
cellarius's Avatar
cellarius cellarius is offline
 
Join Date: Aug 2005
Posts: 1,987
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You can't, because there is none. What do you mean by "in a forum" - on forumdisplay? On showthread?

This may not be possible without a plugin. On forumdisplay or showthread (you're not entirely clear where you want to use this) you don't normally show if there's unread threads as a whole; that is only determined in the threadbits for the single thread at hand.
Reply With Quote
  #5  
Old 05-05-2014, 03:30 PM
Set3sh's Avatar
Set3sh Set3sh is offline
 
Join Date: Jan 2013
Location: Romania
Posts: 35
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I'd like to show and image at forumhome and forumdisplay when there is a new post.
So I need to know how to check for new posts in forumdisplay and showthread.
Reply With Quote
  #6  
Old 05-05-2014, 03:39 PM
Zachery's Avatar
Zachery Zachery is offline
 
Join Date: Jul 2002
Location: Ontario, Canada
Posts: 11,440
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Pictures are already shown, when there are new posts in forums, you can see this on any normal forumhome page with the forum status icons.

if you want to get that data outside, you'd need to run a query to figure it out. You'd want to take a look at Number of Posts since last visit mod for something to get you started.
Reply With Quote
  #7  
Old 05-05-2014, 04:09 PM
Set3sh's Avatar
Set3sh Set3sh is offline
 
Join Date: Jan 2013
Location: Romania
Posts: 35
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

That seem quite bad to run a query for every single time I refresh the page to know if it's a new post or not.

I'm working on a mod to reduce http requests and optimise vb.

So far I'm testing the beta in my own forum http://www.gamemaniacs.ro

The condition that tells me if there are new posts is a must to finish my first mod release.
Reply With Quote
  #8  
Old 05-05-2014, 04:18 PM
Zachery's Avatar
Zachery Zachery is offline
 
Join Date: Jul 2002
Location: Ontario, Canada
Posts: 11,440
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Why don't you checkout my iconic style, it does the things you want (massively reduce http request overhead, in a lot of places).
Reply With Quote
  #9  
Old 05-05-2014, 04:27 PM
Set3sh's Avatar
Set3sh Set3sh is offline
 
Join Date: Jan 2013
Location: Romania
Posts: 35
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thank you mate, but I'm trying to implement css sprites.
Reply With Quote
  #10  
Old 05-05-2014, 05:04 PM
Zachery's Avatar
Zachery Zachery is offline
 
Join Date: Jul 2002
Location: Ontario, Canada
Posts: 11,440
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

CSS sprites won't reduce http requests nearly as much as something like iconic.

But I don't understand why you need to know if there are new posts are not. You should assume there are and load the requires CSS/images anyway.
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 02:12 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.09532 seconds
  • Memory Usage 2,253KB
  • Queries Executed 13 (?)
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
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (10)postbit_onlinestatus
  • (10)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_postinfo_query
  • fetch_postinfo
  • 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
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete