vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=251)
-   -   Template conditionals (https://vborg.vbsupport.ru/showthread.php?t=311063)

Set3sh 05-05-2014 02:02 PM

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

Thank you.

cellarius 05-05-2014 02:18 PM

Where?

Set3sh 05-05-2014 03:06 PM

Anywhere in a forum/subforum.

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

I dind't find any official documentation regarding all template variables...

cellarius 05-05-2014 03:20 PM

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.

Set3sh 05-05-2014 03:30 PM

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.

Zachery 05-05-2014 03:39 PM

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.

Set3sh 05-05-2014 04:09 PM

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.

Zachery 05-05-2014 04:18 PM

Why don't you checkout my iconic style, it does the things you want (massively reduce http request overhead, in a lot of places).

Set3sh 05-05-2014 04:27 PM

Thank you mate, but I'm trying to implement css sprites.

Zachery 05-05-2014 05:04 PM

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.


All times are GMT. The time now is 10:07 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.01130 seconds
  • Memory Usage 1,727KB
  • 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
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete