MyBB Community Forums

Full Version: Ads after first and sixth post on every page without plugin
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I inserted the an ad code inside postbit at the bottom which can be found inside edit template option.
It works but the ad shows after each and every post on every page

I found this code on some website to display ads after first and fifth post but this code doesn't have any effect the ads continue to display after each and every post may be its old thats why. Can anyone write a code which only allows ads after first and the sixth post on every page.
Quote:
<if (($postcounter - 1) % $mybb->settings['postsperpage'] == 0) || (($postcounter - 5) % $mybb->settings['postsperpage'] == 0) then>
//Adsense code goes here
</if> 
^ that code requires template conditionals plugin