Jump to content

(NB41) Enhanced Advertisements

Featured Replies

3 hours ago, newbie LAC said:

Hello,

Do you mean Pages blocks?

If so you can do it

Yes Pages blocks. Can you show me the syntax please?

  • 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

Thanks yes, I did that, but it wasn't working. I assumed I was doing something wrong. I will try again. Thank you.

  • 2 weeks later...

Hi newbie -

Is there anyway to block the ads from showing to bots?  The issue that I am running into is that the Indexing crawler is set to Googlebot Smartphone.  However for some reason the ads don't render the mobile version of the ads so Google is penalizing the site for not being mobile friendly when really it is. 

I see two solutions here if possible.

1.)  Allow us to disable ads when bots are crawling the site

2.)  Update to code to check for bots and render the mobile ads for them.

Thanks for any ideas/support you can offer here.

Chad

  • Author

Hello,

9 hours ago, BlueEye said:

ideas/support you can offer here.

You can check the bots using 

\IPS\Session::i()->userAgent->spider

Example

{{if \IPS\Session::i()->userAgent->spider}}
	Show code for bots
{{else}}
	Show code for others
{{endif}}

 

Thank you very much newbie LAC!  Per your example, I know there is also an "Extra condition" area where you could return some value (string, number) to display an advert.  Could your code in the if statement be altered slightly to ready NOT A SPIDER?  In this case I would simply add that one line to the extra condition area vs. wrapping each advert in an if/else statement.

{{if \IPS\Session::i()->userAgent->spider}}
  • Author
15 hours ago, BlueEye said:

Per your example, I know there is also an "Extra condition" area where you could return some value (string, number) to display an advert.  Could your code in the if statement be altered slightly to ready NOT A SPIDER?

{{if !\IPS\Session::i()->userAgent->spider}}1{{endif}}

 

You are so good!  Thanks newbie!  Works perfect and seems cleaner to me. 👍

One last question Newbie - if I enable Lazy Loading of media content on the site, will this lazy load the ads?  If not, is there a way to enable an option to lazy load ads?

Thank you!

Chad 

  • Author

Hello,

13 hours ago, BlueEye said:

One last question Newbie - if I enable Lazy Loading of media content on the site, will this lazy load the ads?  If not, is there a way to enable an option to lazy load ads?

Do you mean images?

images.jpg.46dfb0d1a1499079be99e0739b589ced.jpg

If so they don't support lazy load

Ok, thanks for clarification.  I typically use HTML code.

  • Author
7 minutes ago, BlueEye said:

I typically use HTML code.

22 hours ago, BlueEye said:

if I enable Lazy Loading

Anyway you should to add additional code

This code works in adverts

<img {{if settings.lazy_load_enabled}}src="{expression="\IPS\Text\Parser::blankImage()"}" data-{{endif}}src='https://dne4i5cb88590.cloudfront.net/invisionpower-com/profile/photo-thumb-293560.gif' alt='newbie-lac'>

Compatibility with PHP 7.4.2? @newbie LAC

  • Author

Hello,

11 hours ago, sulervo said:

Compatibility with PHP 7.4.2? @newbie LAC

It should be OK

 

Dear Newbie LAC

I am now using your plugin again.

It still works fine there is just one small problem. When I try to restrict an ad for just desktop and then in the settings I will tick that option, after saving that option will not be saved. When I go back into the settings then, it always shows "All devices". So I am not able to only show a certain ad only on desktop devices which is a big problem because some of my affiliate ads are not responsive and so they will be therefore cut badly on phone devices.

How can I solve this? Would be amazing if you could help me with that!

Best,

Marcel

  • Author

Hello,

3 minutes ago, Marcel Iseli said:

When I try to restrict an ad for just desktop and then in the settings I will tick that option, after saving that option will not be saved. When I go back into the settings then, it always shows "All devices".

I can not reproduce on the latest version.

 

1 minute ago, newbie LAC said:

Hello,

I can not reproduce on the latest version.

 

Maybe I haven't the last version then. Let me check this. Thanks a lot for the quick reply. I think I have 1.0.8.

oh I did not yet pay the renewal fee. I just did that. and will now try with the latest version!

you are right, this does now work like a charm! Thanks Newbie LAC!

  • 3 weeks later...

Hi there - a while back I purchased (NB40) Ads After X Posts and (NB40) Ads After X Topics. Are these plugins outdated? Do I need to buy this one instead and disable the others? @newbie LAC

3 hours ago, breatheheavy said:

Hi there - a while back I purchased (NB40) Ads After X Posts and (NB40) Ads After X Topics. Are these plugins outdated? Do I need to buy this one instead and disable the others? @newbie LAC

Also, if it's possible to still use those plugins I mentioned above... can someone please help me understand how to shows ads based on defined locations.

Specifically, where in the theme can I display an ad after every 10 posts in a thread or every 10 topics in a forum. It would be greatly appreciated!

  • Author

Hello,

10 hours ago, breatheheavy said:

a while back I purchased (NB40) Ads After X Posts and (NB40) Ads After X Topics. Are these plugins outdated?

Those plugins work fine.

10 hours ago, breatheheavy said:

Do I need to buy this one instead and disable the others

Why?

7 hours ago, breatheheavy said:

Also, if it's possible to still use those plugins I mentioned above... can someone please help me understand how to shows ads based on defined locations.

Specifically, where in the theme can I display an ad after every 10 posts in a thread or every 10 topics in a forum. It would be greatly appreciated!

Please post issues in the proper topics

https://invisioncommunity.com/forums/topic/421457-nb40-ads-after-x-posts/

https://invisioncommunity.com/forums/topic/421955-nb40-ads-after-x-topics/

 

  • 2 months later...

Hello,

Is there any way to place an ad on all threads and sub-categories under a category?

  • Author
On 5/9/2020 at 5:22 PM, Jirinex said:

Hello,

Is there any way to place an ad on all threads and sub-categories under a category?

Hello,

You can use conditions

{{if isset(\IPS\Output::i()->hiddenElements['nbenhadverts_node_class']) and \IPS\Output::i()->hiddenElements['nbenhadverts_node_class'] == 'IPS\forums\Forum' and $forum = \IPS\Output::i()->hiddenElements['nbenhadverts_node_node']}}
{{ try { $category = \IPS\forums\Forum::load(12345); } catch (\OutOfRangeException $e){} }}
{{if $category and $forum->isChildOf($category)}}
1
{{endif}}
{{endif}}

Change the 12345 on category ID

Edited by newbie LAC

On 5/10/2020 at 8:44 AM, newbie LAC said:

Hello,

You can use conditions


{{if isset(\IPS\Output::i()->hiddenElements['nbenhadverts_node_class']) and \IPS\Output::i()->hiddenElements['nbenhadverts_node_class'] == 'IPS\forums\Forum' and $forum == \IPS\Output::i()->hiddenElements['nbenhadverts_node_node']}}
{{ try { $category = \IPS\forums\Forum::load(12345); } catch (\OutOfRangeException $e){} }}
{{if $category and $forum->isChildOf($category))}}
1
{{endif}}
{{endif}}

Change the 12345 on category ID

Hello,

Unfortunately it's not working :sad:
The ad displaying everywhere in the forum, even on the new content feed. We want the ad to display only under all Gaming threads and all the forum gaming sub-categories.

For example:

  • Gaming
    • PC
      • Thread 1
      • Thread 2
    • PlayStation
      • Thread 1
      • Thread 2
    • Xbox
      • Thread 1
      • Thread 2
  • Hardware (not here)
  • Author

Hello,

11 hours ago, Jirinex said:

Unfortunately it's not working :sad:

I fixed the code.

Recently Browsing 0

  • No registered users viewing this page.