Jump to content

(NB41) Enhanced Advertisements

Featured Replies

  • Author
{{if request.controller == 'search' and !isset(request.q)}}
<div class="cSearchAd">Advert 1</div>
<style>
.cSearchAd, div[data-controller="core.front.search.main"] {
	display: table-cell;
}
.cSearchAd {
	float: right;
	border: 3px solid red;
	height: 600px;
	width: 300px;
	margin: 0 10px;
}
</style>
{{endif}}

and 

{{if request.controller == 'search' and isset(request.q) and request.q == 'adv'}}
<div class="cSearchAd">Advert 2</div>
<style>
.cSearchAd, div[data-controller="core.front.search.main"] {
	display: table-cell;
}
.cSearchAd {
	float: right;
	border: 3px solid red;
	height: 600px;
	width: 300px;
	margin: 0 10px;
}
</style>
{{endif}}

Selector

div[data-controller="core.front.search.main"]

Position 

Insert advert before the chosen element(s)

 

  • 1 month later...
  • 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

On 4/14/2017 at 8:12 AM, newbie LAC said:

Hello,

CSS selector 


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

Position 


Insert advert after the chosen element(s)

 

Hello ! 

what would be the same for showing a banner after the 5th unread topic ?  (in the unread list)

in this url link ? https://invisioncommunity.com/discover/unread/

 

[I must say NewbieLac is amazing, he has just helped me put a floating/sticky   ad to specific forums only !   super application ] 

  • Author
8 hours ago, MeMaBlue said:

Hello ! 

what would be the same for showing a banner after the 5th unread topic ?  (in the unread list)

in this url link ? https://invisioncommunity.com/discover/unread/

Hello,

Use the same position

Selector is 

[data-streamreadtype="unread"] [data-role="streamContent"] .ipsStreamItem:eq(4)

 

  • 2 weeks later...

I haven't tested it yet, but will this work with 4.2?

  • Author
3 hours ago, Bluto said:

I haven't tested it yet, but will this work with 4.2?

Hello,

I've made quick test and the app works.

I am posting instructions I got from newbie LAC that i have already implemented!  

Here are the selectors for the  streams

that involve all new posts or new posts from followed or content you have posted in,  i.e. what is in there 

image.png.0c5bd04e89ddae6562459d15e1cf449e.png

 

discover/unread/

[data-streamid="1"] [data-role="streamContent"] .ipsStreamItem:eq(4)

discover/content-started/

[data-streamid="2"] [data-role="streamContent"] .ipsStreamItem:eq(4)

discover/followed-content/

[data-streamid="3"] [data-role="streamContent"] .ipsStreamItem:eq(4)

discover/content-posted/

[data-streamid="5"] [data-role="streamContent"] .ipsStreamItem:eq(4)

Here is the instructions to Add a STICKY POP UP   to SPECIFIC  forum ids  (the banner will stay put when you scroll)

when you press X it will go away. 

image.thumb.png.4e5573561d3494ba1049903b571ab248.png

1)   This you put into your Custom.css file 

.avbxouter {
    z-index: 2;
    box-sizing: border-box;
    position: fixed;
    bottom: 0;
    width: 100%;
    margin-bottom: 0%;
}
.avbxouter:hover {}.avbxmain {
    border: 0px solid #fff;
    height: auto;
    margin: 0 auto;
    display: table;
    position: relative;
    background: none;
}
#close {
    display: inline-block;
    margin: -15px -25px 0px 0px;
    opacity: 1.0;
    cursor: pointer;
    z-index: 1;
}
#close:hover {
    opacity: 0.95
}
#close {
    display: inline-block;
    margin: -15px -25px 0px 0px;
    opacity: 1.0;
    cursor: pointer;
    z-index: 1;
    position: absolute;
}

Edited by MeMaBlue

2) then    open a new advertisement in the forums inbuilt system and 

ad this      into the first box 

you need to ADD 2 THINGS : 

a) the link url of the image that will have the close button X 

b) your ad code

{{if !isset(cookie.nbEnhAdsHeaderBanner)}}
	<script>
	$(function() {
		$( "#nbEnhAdsHeaderBanner" ).on( "click", ".nbEnhAdsHeaderBannerClose", function() {
			ips.utils.anim.go( "fadeOut", $( "#nbEnhAdsHeaderBanner" ) );
			
			var nbEnhAdvDate = new Date();
			nbEnhAdvDate.setTime(nbEnhAdvDate.getTime() + 50 * 60 * 1000);
			ips.utils.cookie.set('nbEnhAdsHeaderBanner', 1, nbEnhAdvDate.toUTCString());
		});
	});
	</script>
	<div id="nbEnhAdsHeaderBanner" class="avbxouter">
		<div class="avbxmain">
			<span id='close' class="nbEnhAdsHeaderBannerClose">
              
              <img src="CREATE and ADD IMAGE URL of the X  that will close the box here" width="25" height="25" alt=""/>
          </span>
			
        YOUR ADD CODE HERE! 
 
          
		</div>
	</div>
{{endif}}

3) you select  at the css selector simply 

image.png.8b9281f8a6b160e9bd20e003c4a96bac.png

 

The above code is for ALL forum , for the banner to appear after every 50 minutes

 

the code below is for specific forums only :

Edited by MeMaBlue

This code if for banner to appear in SELECTED forums only. you can see the many numbers -there are the forum ids you need to put. 

:   (109,30,11,10,65,27,165,60,61,118,181,30,11,46,138,159,19,15)   

This code is set to appear every 5 minutes 

 

{{$fid = 0;}}
{{if request.app == 'forums' and request.module == 'forums' and request.controller == 'topic' and request.id}}
	{{ try { $topic = \IPS\forums\Topic::loadAndCheckPerms(request.id); $fid = $topic->container()->_id; } catch(\Exception $e){} }}
{{elseif request.app=='forums' and request.module == 'forums' and request.controller == 'forums'}}
	{{$fid = 0;}}
{{endif}}

{{if $fid and in_array($fid, array(109,30,11,10,65,27,165,60,61,118,181,30,11,46,138,159,19,15))}}
	{{if !isset(cookie.nbEnhAdsHeaderBanner)}}
		<script>
		$(function() {
			$( "#nbEnhAdsHeaderBanner" ).on( "click", ".nbEnhAdsHeaderBannerClose", function() {
				ips.utils.anim.go( "fadeOut", $( "#nbEnhAdsHeaderBanner" ) );
				
              
              var nbEnhAdvDate = new Date();
nbEnhAdvDate.setTime(nbEnhAdvDate.getTime() + 5 * 60 * 1000);
ips.utils.cookie.set('nbEnhAdsHeaderBanner', 1, nbEnhAdvDate.toUTCString());
			});
         
		});
		</script>
		<div id="nbEnhAdsHeaderBanner" class="avbxouter">
			<div class="avbxmain">
				<span id='close' class="nbEnhAdsHeaderBannerClose"><img src="YOUR_IMAGE_URL_HERE_FOR_X_BUTTON" width="25" height="25" alt=""/></span>
				 
 YOUR AD CODE HERE



 
              
		</div>
	{{endif}}
{{endif}}

 

  • 3 weeks later...

No problems with 4.2?

  • Author
17 hours ago, sulervo said:

No problems with 4.2?

Hello,

 

  • 1 month later...

Hi @newbie LAC, thanks for creating this mod. After moving over from vbulletin, it's been a real struggle to replicate the ads I had before.

I've placed the banner ad below so that it appears above every topic in forum 38

1.thumb.png.f7d9d74fd8f969a1329d5607cf58477e.png

 

using this code which I found earlier on the thread.

{{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(38))}}
    code
{{endif}}

 

How can I also display it at the top of the page shown below (which displays all the topics in that forum)?

2.thumb.png.84cab67a87ae49f7551e41dd5b8cdcb3.png

 

Thanks, Rob

 

 

 

Edited by Robert Williams

  • Author

Hello,

3 hours ago, Robert Williams said:

How can I also display it at the top of the page shown below (which displays all the topics in that forum)?

{{if request.app == 'forums' and request.module == 'forums' and request.controller == 'forums' and request.id == 38}}
    Code
{{endif}}

 

3 hours ago, newbie LAC said:

Hello,


{{if request.app == 'forums' and request.module == 'forums' and request.controller == 'forums' and request.id == 38}}
    Code
{{endif}}

 

Thanks for that, one last question :thumbsup:, could you show me the code I'd use for the above, if I wanted the ad to display at the top of several forums eg 10, 16, 38, 40. I gather I'd need to use an array but I don't know the syntax. Thanks

  • Author
4 minutes ago, Robert Williams said:

Thanks for that, one last question :thumbsup:, could you show me the code I'd use for the above, if I wanted the ad to display at the top of several forums eg 10, 16, 38, 40. I gather I'd need to use an array but I don't know the syntax. Thanks

{{if request.app == 'forums' and request.module == 'forums' and request.controller == 'forums' and in_array(request.id, array(10, 16, 38, 40))}}
    Code
{{endif}}

 

  • 4 weeks later...

Hello @newbie LAC !

do you perhaps know  and maybe plan to help how to implement scroller ads? 

its those new ads that show underneath the content , and they have the blessing of users because you scroll over the ad, and therefor can stop if you like it, and it doesnt bother anyone with using the website. 

here is a link i found that describes them ! 

http://www.scrollerads.com/   I would very much like to use one of them!   

 

  • Author

Hello,

1 hour ago, MeMaBlue said:

http://www.scrollerads.com/   I would very much like to use one of them!   

I see how it works but I don't see any guides/faqs there

  • 2 weeks later...

Hi,

your app won't work correctly on 4.2.5.

  1. no icon in menu in ACPimage.png.8e0f5f7ffb46edcd406032dc194379f5.png
  2. stats generates error:
    Error: Cannot instantiate abstract class IPS\Helpers\Chart\Dynamic (0)
    #0 /var/www/forum.vw-passat.pl/httpdocs/system/Dispatcher/Controller.php(85): IPS\nbenhadverts\modules\admin\adverts\_adverts->stats()
    #1 /var/www/forum.vw-passat.pl/httpdocs/applications/nbenhadverts/modules/admin/adverts/adverts.php(27): IPS\Dispatcher\_Controller->execute()
    #2 /var/www/forum.vw-passat.pl/httpdocs/system/Dispatcher/Dispatcher.php(146): IPS\nbenhadverts\modules\admin\adverts\_adverts->execute()
    #3 /var/www/forum.vw-passat.pl/httpdocs/admin/index.php(13): IPS\_Dispatcher->run()
    #4 {main}

     

  • Author

Hello,

10 hours ago, Andrzej Pindor said:

your app won't work correctly on 4.2.5.

All fixed.

  • 2 weeks later...

Do you have a link to paypal payment?

  • Author

Hello,

13 hours ago, media said:

Do you have a link to paypal payment?

Why do you need this?

7 hours ago, newbie LAC said:

Hello,

Why do you need this?

Never mind I see I can purchase here :)

  • 2 weeks later...

Pre Sales Questions

Hi, I was going to buy the  ad after x posts & ad after x topics  but from what I can see this does all of that and more?

1 - A review mentions clickbombing protection. I use google adsense, does this app provide clickbombing protection for adsense?

2 - So can I add adverts anywhere? like ordered in my sidebars? I tend to have a 300x250 followed by 300x600 adverts and have different sets for forum sidebar, calendar sidebar, football sidebar etc. I currently use IP custom blocks to place these so will this give me the ability to replace those?

3 - I also name my ads for the location I place them so I know which ones are performing in adsense. Can I make sure for example, advert 1 in a forum / topic that is in position after 3rd topic / post is a specific advert, then the advert that is after position 5 in a topic post / forum is another specific advert?

Thanks in advance.

Recently Browsing 0

  • No registered users viewing this page.