Jump to content

(NB41) Enhanced Advertisements

Featured Replies

  • Author

Hello,

14 hours ago, sulervo said:

Can I insert ads after 1st post in specified categories?

Yes

14 hours ago, sulervo said:

How this will act with ads in "After the first post in each topic" location?

Both ads will be displayed

  • Replies 509
  • Views 52.8k
  • Created
  • Last Reply

Top Posters In This Topic

Most Popular Posts

  • Right...I think we all understand this. He's not been heard from since Jan 2021. Unfortunately I'm unable to wait until he's back here to update this application, as I need it updated for 4.6 and

  • newbie LAC
    newbie LAC

    Hello again You can add in your code data-excludequote Example <div style="float:right; position:relative; padding: 0 0 0 5px;" data-excludequote> Google ads code </div&gt

  • Hello, 1. https://invisionpower.com/forums/topic/429838-nb41-enhanced-advertisements/?do=findComment&comment=2638531 2. HTML  {{if (\IPS\Request::i()->app == 'forums' and \IPS\R

Posted Images

Just purchased this. Works perfectly with selector+position examples but I have no idea how to publish ads after 1st post in specified categories.. Could you please give me selector and position?

And how I solve category ID? www.foo.bar/forum/2-common/ Thought it's "2" but it's not..

 

Edited by sulervo

Like this way?

{{if \IPS\Request::i()->app == 'forums' and \IPS\Request::i()->module == 'forums' and \IPS\Request::i()->controller == 'topic'}}
    {{$forumId = 0; try { $topic = \IPS\forums\Topic::loadAndCheckPerms( \IPS\Request::i()->id ); $forumId = $topic->forum_id; } catch( \Exception $e ) {};}}
{{endif}}
{{if in_array($forumId, array(3, 4))}}
code
{{endif}}

4 hours ago, sulervo said:

And how I solve category ID? www.foo.bar/forum/2-common/ Thought it's "2" but it's not..

Actually this number is category ID?

  • Author

Hello,

9 hours ago, sulervo said:

Like this way?

Yes.

+

- Selector

article.cPost:eq(0)

- Position 

Insert advert after the chosen element(s)

 

If I would like to upload banners to the system then category based targeting is not possible? I mean that other option if you don't want to use HTML code.

  • Author
13 hours ago, sulervo said:

If I would like to upload banners to the system then category based targeting is not possible? I mean that other option if you don't want to use HTML code.

Use the setting "Extra condition"

{{if \IPS\Request::i()->app == 'forums' and \IPS\Request::i()->module == 'forums' and \IPS\Request::i()->controller == 'topic'}}
    {{$forumId = 0; try { $topic = \IPS\forums\Topic::loadAndCheckPerms( \IPS\Request::i()->id ); $forumId = $topic->forum_id; } catch( \Exception $e ) {};}}
{{endif}}
{{if in_array($forumId, array(3, 4))}}
1
{{endif}}

 

  • 3 weeks later...
  • Author
13 hours ago, Hugo_S4 said:

Hello. Please help. How to insert an ad after the second search result. In this view https://invisionpower.com/search/?&q=test . Thank you and best regards.

Hello,

CSS selector 

#elSearch_main [data-role="resultsContents"] .ipsStreamItem:eq(1)

Position 

Insert advert after the chosen element(s)

 

Thank you for your help. It works great. Regards :thumbsup:

  • 2 weeks later...
On 24.3.2017 at 7:06 AM, newbie LAC said:

Use the setting "Extra condition"


{{if \IPS\Request::i()->app == 'forums' and \IPS\Request::i()->module == 'forums' and \IPS\Request::i()->controller == 'topic'}}
    {{$forumId = 0; try { $topic = \IPS\forums\Topic::loadAndCheckPerms( \IPS\Request::i()->id ); $forumId = $topic->forum_id; } catch( \Exception $e ) {};}}
{{endif}}
{{if in_array($forumId, array(3, 4))}}
1
{{endif}}

 

If system select ad which condition is false it shows nothing? Is there possible to determine backup ad which shows if condition doesn't match?

  • Author

Hello,

20 minutes ago, sulervo said:

If system select ad which condition is false it shows nothing?

Yes

20 minutes ago, sulervo said:

Is there possible to determine backup ad which shows if condition doesn't match?

Currently no.

Edited by newbie LAC

hi @newbie LAC

Can you advise how i can put a banner at the Right Side of the Second NavBar please?

positie.thumb.jpg.9bf4b5af98ac92810e23c39182760a4d.jpg

I tried insert CSS Selector - add inside at the end:

ipsNavBar_secondary

But it doesn't appear.

Please kindly advise,

Karel

  • Author

Hello,

11 hours ago, Karel Beuckelaere said:

Can you advise how i can put a banner at the Right Side of the Second NavBar please?

Selector 

#elNavSecondary_1 .ipsNavBar_secondary

Position

Insert advert inside the chosen element(s), at the end

 

5 minutes ago, newbie LAC said:

Hello,

Selector 


#elNavSecondary_1 .ipsNavBar_secondary

Position


Insert advert inside the chosen element(s), at the end

 

Thanks, however seems that due to design it looks a bit strange :-) also due to the different tabs, its a bit moving arround now :-)

If you re-look at my example, maybe its better to put it on the left side of the Seach bar, right alinged? (at main navbar)

Thanks again for your great support :-)

  • Author
1 minute ago, Karel Beuckelaere said:

Thanks, however seems that due to design it looks a bit strange :-) also due to the different tabs, its a bit moving arround now :-)

I gave you selector and position. Other things are css.

See my example

<span class="ipsPos_right" style="margin: 10px;">Right Side of the Second NavBar</span>

Result

rs.thumb.jpg.99536afd4b5908860d367d53b7827a65.jpg

  • 2 weeks later...

I wonder if you could put an advert in the search input?  Instead of it saying Search... it says "Eat at Joes Pizza".

Great plugin BTW.  :)

 

Edited by Bluto

  • Author

Hello,

11 hours ago, Bluto said:

I wonder if you could put an advert in the search input?  Instead of it saying Search... it says "Eat at Joes Pizza".

You can do it via js

$("#elSearchField").attr("placeholder", "Eat at Joes Pizza");

 

Edited by newbie LAC

Is there a way to use the css selector and have ads rotate in a position?  

Right now, both ads are showing up.  Would love to sell multiple ads in specific spots using the css selector, but not really sure how to do it.

  • Author
12 hours ago, Bluto said:

Is there a way to use the css selector and have ads rotate in a position?  

Right now, both ads are showing up.  Would love to sell multiple ads in specific spots using the css selector, but not really sure how to do it.

Hello,

I don't know how you will set up your ads for this. Therefore I propose my solution

HTML

{{$r = mt_rand(1,3);}}
{{if $r == 1}}
	<div class="ipsMessage ipsMessage_error">
		This is an error message.
	</div>
{{elseif $r == 2}}
	<div class="ipsMessage ipsMessage_success">
		This message indicates something happened successfully.
	</div>
{{else}}
	<div class="ipsMessage ipsMessage_warning">
		This message warns the user of something terrible (or not so terrible).
	</div>
{{endif}}

Selector 

#elContent

Position

Insert advert before the chosen element(s)

Result (I refresh the page)

mess.thumb.gif.246186e5dfa0e3261f3b14c01e16c5af.gif

Edited by newbie LAC

Thanks for the previous code!

I'm also trying to figure out how to create an if statement = if an advertisement key is disabled it will show something else.  In my case I'm using links in my footer in a list and I don't want the lines of links to be blank if no one is advertising.

{advertisement="footer_text_advert_1"}

Trying a bunch of thing to get this setup.  Below is the last code I tested.  What would be the if part of the statement?  I've tried = NULL, = 0, empty, isset, !=, figured you might know since you deal with all the variables.  I don't code IPB enough to know what I'm supposed to use.

{{if advertisement.footer_text_advert_1 > 0}}
	{advertisement="footer_text_advert_1"}
{{else}}
	Some other link.
{{endif}}

I appreciate any help you can give me.  :)

 

Got it, I believe.

{{if empty( \IPS\core\Advertisement::loadByLocation( 'ad_key' ))}}

Nothing Here

{{else}}

{advertisement="ad_key"}

{{endif}}

 

Edited by Bluto

  • Author
6 hours ago, Bluto said:

Trying a bunch of thing to get this setup.  Below is the last code I tested.

{{if $advert = \IPS\core\Advertisement::loadByLocation('footer_text_advert_1')}}
	{$advert|raw}
{{else}}
	Some other link.
{{endif}}

 

Thanks for the code.  The code I put in above,  I copied from one of the IPS premade spots.

This is going to work great for text links in the footer (or anywhere else on the site) which can be sold in the store.  If some links aren't purchased, I have a default ads created called filler ads to fill in the non-sold spots.

Edited by Bluto

  • Author

Hello,

13 hours ago, Hugo_S4 said:

How to insert ads in these views?:

Is this for 4.1.9 or for 4.2?

4.1.9 ;)

Recently Browsing 0

  • No registered users viewing this page.