1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

How to Limit 3 adsense ads per thread in MyBB forum

Discussion in 'Forum Management' started by softech02, Jan 24, 2015.

  1. #1
    I have been trying to add Adsense ads to my mybb forum but not able to.
    I have inserted the adsense code in postbit and the ads are being displayed but the problem is, it is showing more than 3 ads in a single thread which is against google adsese policy. Is there any way I could limit the number of ads to 3 per thread?

    In a particular thread, I have 5 replies and it is displaying 5 ads on a single page which is not in line with adsene guidelines.

    Any help regarding this will be highly appreciated.
    softech02, Jan 24, 2015 IP
  2. jslirola

    jslirola Active Member

    Likes Received:
    Best Answers:
    Trophy Points:
    You can use a counter or redefine the condition of the code.

    Example (Adsense code after 1th, 5th and 10th reply on each page):
    <if (($postcounter - 1) % $mybb->settings['postsperpage'] == 0) || (($postcounter - 5) % $mybb->settings['postsperpage'] == 0) || (($postcounter - 10) % $mybb->settings['postsperpage'] == 0) then>
    //Adsense code goes here
    Code (markup):
    jslirola, Feb 17, 2015 IP