PDA

View Full Version : Code Help - How to place statement after each 1st post


kau
11-10-2007, 10:57 PM
I want to put some code after the first post on every page.

I've found code that will put a statement after the first post;

<if condition="$post[postcount] == 1">

However, this only does it once. When the user clicks Page 2 I want the ad to show again after 1st post on that page. Has to be dynamic though since users can choose how many posts per page they see.

Anyone know?

Jelmertjee
11-11-2007, 05:19 PM
well, you would need to get a variable with the number of posts a user has set to display per page, then it should be easy to calculate which posts are on the first page with some simple php I guess..

Gray Matter
11-11-2007, 05:58 PM
<if condition="$post[postcount] % $vboptions[maxposts] == 1">

Jelmertjee
11-11-2007, 06:35 PM
Well that's even easier, great idea Gray Matter!

Gray Matter
11-11-2007, 06:51 PM
I can't really take the credit. I found it a while ago while searching vB.org. ;)