Log in

View Full Version : Accessing perpage variable in postbit template?


gobears20
03-15-2007, 02:48 PM
How do I access the perpage variable in the postbit template? I've tried some different things but with no luck. I'm trying to add an advertisement after the first and last post of each page of a thread and I need to know how many posts per page there are to do this.

None of these seem to work:

$perpage
$vbulletin->GPC['perpage']
$vbulletin->options['grpspostsperpage']
$vboptions['perpage']
$vboptions['grpspostsperpage']

Brad
03-15-2007, 03:06 PM
Use $FIRSTPOSTID for the first post on the page, and $LASTPOSTID for the last.

Use them both in a conditonal and compare them to the current post's postid. :)

gobears20
03-15-2007, 03:16 PM
Neither of those work. I'm using the latest vb version 3.6.5

Brad
03-15-2007, 03:24 PM
Ah I'm sorry, I forget about scope sometimes...

Try using this for the first post inside the postbit template;


<if condition="!$GLOBALS['FIRSTPOSTID']">
<!-- / Your ad code here -->
</if>

For the last post just append the code below the postbit area in the SHOWTHREAD template.