PDA

View Full Version : Show Thread Enhancements - Show ads for last post on page only when there are more than X replies


tpearl5
07-05-2012, 10:00 PM
By default the ad in the last post will show if there are 2 posts on a page. This results in two successive, often cluttered looking ads. Alternatives if statements to this did not account for multi-page threads where 2 posts were on a page.

Here is the solution:

In postbit find
<vb:if condition="$post['islastshown']">

replace with
<vb:if condition="$post[postcount] % $vboptions[maxposts] > 2 OR $post[postcount] % $vboptions[maxposts] == 0">

I found that more than 2 posts on a page is sufficient to show an ad again. Of course if you rather have more posts on a page before showing another ad, simply change the 2 in the conditional to whatever you want.

karlm
07-14-2012, 10:46 PM
Handy to know, thanks!