![]() |
Get current amount of posts shown on a page
I'm working on a conditional which runs in the "global_start" hook which sets up adverts for the page.
One of the things I am doing, push advert banner data into the ad_location_showthread_afterqr template, but ONLY if there are more than 2 replies shown on the page. The code: PHP Code:
As I don't have access to the $post parameter at that time, I can't do a count (can I?) so does anyone know the code I need? Psuedo like: If more than 2 replies shown on THIS page, then set X=Y Thanks! |
Is ad_location_showthread_afterqr a template you added? Where is is being used? If it's in the SHOWTHREAD template then you can probably move your plugin to showthread_complete and use $counter as a count of the posts on the page.
|
Lol, sorry I totally got that wrong - it's the ad_showthread_beforeqr template (the one built in).
I can't move the plugin though, as it's a single one which works out all the advert banners for the page (be it a show thread or not). Actually, that's not true - *ideally* I don't want to be chopping it all up - but if there is no other way, then so be it. Although - if the $counter variable is always there, then it could be used in a conditional in the template itself? |
Quote:
|
All times are GMT. The time now is 10:10 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:
|