MyBB Community Forums

Full Version: Need Simple Coding Help
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
This is the code I'm currently using to show ads at the bottom of the first post on each page of a thread:

<if ($postcounter - 1) % $mybb->settings['postsperpage'] == "0" then>
<script type="text/javascript"><!--
google_ad_client = "ca-pub-XXXXXXXXX";
/* ####### */
google_ad_slot = "8543578465";
google_ad_width = 468;
google_ad_height = 60;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></if>

However, there is one board that I don't want the ads to show on. What would I need to add to exclude it from that specific board?

Thanks in advance!
Where are you placing this code?
Make it check the fid = the forum where you dont want it to show
(2012-08-26, 11:12 PM)testerwester Wrote: [ -> ]Where are you placing this code?

It's being added to the postbit. My code is working, I just need to have it not show on one forum.

(2012-08-27, 02:46 AM)TMGFX Wrote: [ -> ]Make it check the fid = the forum where you dont want it to show

Can you show me how to do that by posted an edited version of my code?
Use this, it's the best advertisement manager for MyBB:
http://mods.mybb.com/view/my-advertisements/
(2012-08-27, 04:59 AM)koolaidpwn Wrote: [ -> ]Use this, it's the best advertisement manager for MyBB:
http://mods.mybb.com/view/my-advertisements/

That doesn't do what I am trying to, it doesn't have the option to have ads in the post itself.

What I need to know is what needs to be edited here to exclude a specific forum:

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

Any help with that would be greatly appreciated.
In above code, find;
<if ($postcounter - 1) % $mybb->settings['postsperpage'] == "0" then>
and Replace it with;
<if ($postcounter - 1) % $mybb->settings['postsperpage'] == "0" && $post['fid'] != "X" then>
Replace X with the Forum ID you don't want to show ads in.