Jump to content

Recommended Posts

Posted

Hi,

i want some ad codes not to be shown in special subforums/areas of the site. Is there any smart way to do this?


For example: Ad code from Google (Adsense) shall not be shown in a sub forum called "Google Adsense Problems" while other Ad code can be displayed there without problems.

Posted (edited)

Part of your solution is here: IPS Thread

I have personally battled with this and keeping Adsense happy is goal number one.

Now you'll have to combine that with a ELSE statement so if it doesn't show ads because it's excluded then show another ad.  I'm not an expert but I imagine it would look something like this.

{{if ( \IPS\Request::i()->controller == 'forums' AND isset( \IPS\Request::i()->id ) AND ! in_array( \IPS\Request::i()->id, array( forum_id1, forum_id2, forum_id3, forum_id4 ) ) ) OR !( in_array( \IPS\Request::i()->controller, array( 'system_app1', 'system_app2', 'system_app3', 'forums' ) ) OR in_array( \IPS\Request::i()->app, array( 'external_app1', 'external_app2') ) )}}
	{advertisement="ad_tag_adsense"}
{{else}}
        {advertisement="ad_tag_other"}
{{endif}}

 

Edited by thompsone
Posted (edited)

i've simply add an id to ads, and removed with something like this:  $( "#adsid" ).remove(); added only in page where i want remove (eg in a sidebar block) ;)

imho, more simple :)

u can test in my laltroweb.it/tools/bugtrack/ page.

(ads in sidebar is removed here)!

 

regards...

 

 

Edited by laltroweb.it
Posted

Can you provide a live use example of how and where you've deployed this? How do you handle ads after the first post where you want some but not others depending on location?

Posted (edited)

see link. in my sidebar exit an ads. I've remove just in this page with this little code. with jQuery u can check also by title or url... many way to do this :)

Edited by laltroweb.it
  • 4 years later...
Posted

This proved to be a useful topic, thanks @thompsone

Though I got a question how should the code look so that the advertisement code would also include the ad appear in the TOPIC VIEW of a certain FORUM ID too. I mean to show ads on the top of the page when viewing any topic that is within a forum which ID is for example 55, 65 and 75?

I've found this post but I don't understand enough to make it work.

@newbie LAC, @opentype any ideas guys? 🙂

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...