Helmi Posted February 21, 2016 Posted February 21, 2016 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.
thompsone Posted February 21, 2016 Posted February 21, 2016 (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 February 21, 2016 by thompsone nealtz and Maxxius 1 1
ipbfuck Posted February 29, 2016 Posted February 29, 2016 (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 February 29, 2016 by laltroweb.it thompsone 1
thompsone Posted February 29, 2016 Posted February 29, 2016 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?
ipbfuck Posted February 29, 2016 Posted February 29, 2016 (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 February 29, 2016 by laltroweb.it
Maxxius Posted February 28, 2021 Posted February 28, 2021 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? 🙂
Recommended Posts