Jump to content

Hide advertisements in clubs

Featured Replies

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!!

In the core software there's no way to do this, unfortunately.

But it wouldn't be too hard to code a plugin to make this work.

  • Author

Thanks @Makoto. If I decide to go ahead with this, I'll reach out to you for a quote...

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:

 

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!

 

  • Author
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.... 😩

Yeah. Then you need custom plugin - I may do that for you. 

Edited by DawPi

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' ) )

 

So you don't even really need a custom plug-in, looks like you can do this pretty easily with @newbie LAC's plugin and Daniel's little bit of template logic 🙂

As I said.  
 

GIF by Shalita Grant

Hello,

My application has additional "helpers"

{{ !isset(\IPS\Output::i()->hiddenElements['nbenhadverts_club'])}}
	Show advert on all pages except clubs
{{endif}}

 

Updated to allow disable or enable adverts on clubs and many other pages.

  • Author

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

Thanks again!!

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.

Edited by TDBF

  • Author

Lifesaver! Thanks.

Archived

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

Recently Browsing 0

  • No registered users viewing this page.