MyBB Community Forums

Full Version: How to add an AD after 6th post without plugin
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi can you help I want to show Adsense Ad after 6th post on every page. I mean if a thread has 2 pages then I want Adsense Ad to show after 6th post on every page. Can I do that with conditional template?
Thanks

This code shows ad after 3 post. But how to show it after 3 post on each page?
<if $postcounter == '3' then>
//add code here will be show after third post
</if>
Here are some plugins.

http://mods.mybb.com/view/ads-after-firs...r-mybb-14x - Be sure to change compatibility
http://yaldaram.com/showthread.php?tid=992
http://mods.mybb.com/view/my-advertisements - Recommended

Open the file /inc/plugins/FILENAME.php and change this line:

"compatibility" => "14*" 

To

"compatibility" => "16*" 
Thank you so much but I don't like plugins! Is there a way to do that with conditional template. Without plugins please
Try:
<if ($postcounter - 6) % $mybb->settings['postsperpage'] == "0" then>
    blabla
</if>

@down, there is a difference between 1 plugin providing a way to do 100 conditionals/simple functions and 100 plugins providing 1 conditional/simple function. Of course you can insert even thing like menu items through plugin (I think there are even some like that) but what's the point of it?
Quote:Thank you so much but I don't like plugins! Is there a way to do that with conditional template. Without plugins please

Ironically template conditionals are a plugin.
can you make this code to begin working only after 1 page!
<if ($postcounter - 1) % ($mybb->settings['postsperpage']) == "5" then>
</if>
1st post on every page except 1st:

<if ($postcounter - 1) % $mybb->settings['postsperpage'] == "0" && $page > 1 then>
         blabla
</if>
(2013-07-19, 11:18 AM)Destroy666 Wrote: [ -> ]1st post on every page except 1st:

<if ($postcounter - 1) % $mybb->settings['postsperpage'] == "0" && $page > 1 then>
         blabla
</if>

Dude I love you! You're amazing! How do you know all that stuff?