Jump to content

Hide advertisements in clubs


Giray

Recommended Posts

Posted

Hi.

Is there an easyish way to hide ads in clubs? I'm using the IPS advertisement system and wish to place the ads, for example, under the header but not in clubs.

Thoughts?

Thanks!!

Posted
On 2/13/2020 at 9:24 AM, Giray said:

Is there an easyish way to hide ads in clubs? I'm using the IPS advertisement system and wish to place the ads, for example, under the header but not in clubs.

Add something like this to the ad code:

{{if \IPS\Dispatcher::i()->module->key != 'clubs'}}
advert code
{{endif}}

Of course to make it work you must install this one:

 

Posted
5 minutes ago, Daniel F said:

Keep I mind that only the club list, club index and member list use the club module, the club features( forums, topics, etc..) won’t use it!

 

Ouch. So that means that even if we remove the ad from the club list, it'll show in the topics, calendars, etc... right? Hmm.... 😩

Posted
Just now, Giray said:

Ouch. So that means that even if we remove the ad from the club list, it'll show in the topics, calendars, etc... right? Hmm.... 😩

You’ll need to adjust the condition to take both scenarios into account.

 

This should do it 

( IPS\core\FrontNavigation::$clubTabActive or ( \IPS\Dispatcher::i()->application->directory === 'core' and \IPS\Dispatcher::i()->module->key === 'clubs' ) )

 

Posted
3 minutes ago, Giray said:

Thanks @TDBF. This looks perfect. Question, will it work with standard IPS advertisements?

Thanks again!!

Yes it works with IPS Advertisements.

I wrote this because of Google Adsense complaining about not having access to parts of my site which were showing adverts.

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

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