![]() |
Template conditionals
How can I check for new posts in a forum/subforum?
Thank you. |
Where?
|
Anywhere in a forum/subforum.
vb:if condition="new_posts"> ... <vb:else /> ... I dind't find any official documentation regarding all template variables... |
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. |
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. |
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. |
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. |
Why don't you checkout my iconic style, it does the things you want (massively reduce http request overhead, in a lot of places).
|
Thank you mate, but I'm trying to implement css sprites.
|
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. |
If there are new posts, to load an image to let users know that.
With phpbb, mybb, xenforo I can easily do that. Why it can not be posssible with vbulletin? |
Why wouldn't your images already be part of your global sprite sheet?
|
Thank you for trying to help me but I need solutions not questions.
|
That is a solution to your problem.
|
It is not.
Let me share you my way of optimising vbulletin: > replace most images with css buttons > combine a few of them to preserve the style That is why it is imperious that I check if there are new posts or not. |
You should serve 1 sprite, with all of your images, not multiple.
|
Yeah, well, that information is just not available out of the box. You can do it on forumhome or on forumdisplay for subforums, but Lynne has explained to you how to do that. As far as I know, inside the forum (i.e. forumdisplay for threads and showthread) that information is just not readily available. You'd probably have to do a plugin checking the lastpost date of the forum against the last activity date of the user. Maybe that information can be pulled out of the datastore.
|
Well, that is just great...
Lynnes suggestion works if you need to check if subforums have new posts. But you can't check if a category forum has new posts using her solution. Are you aware of a plugin that can solve my problem or some piece of code that I might insert in a template? |
So here is what I don't get. you want to reduce the overall http request, why aren't you just serving one big sprite image, with all the graphics your forum uses?
Why even bother using graphics when you can use something like FontAwesome? |
All times are GMT. The time now is 06:18 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 | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|