Jump to content

Community

(NB41) Enhanced Advertisements


newbie LAC

Recommended Posts

2 hours ago, christopher-w said:

Can you show me the syntax please?

https://invisioncommunity.com/4guides/suite-applications/pages/core-concepts/blocks-r151/

Quote

On pages built using custom HTML (or if you want to insert the block in an IPS4 template), a special tag is used to insert the block:


{block="block_id"}
Link to comment
Share on other sites

  • 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

Link to comment
Share on other sites

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}}
Link to comment
Share on other sites

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

 

Link to comment
Share on other sites

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'>
Link to comment
Share on other sites

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

Link to comment
Share on other sites

  • 3 weeks later...
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!

Link to comment
Share on other sites

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/

 

Link to comment
Share on other sites

  • 2 months later...
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
Link to comment
Share on other sites

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)
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...

Important Information

We use technologies, such as cookies, to customise content and advertising, to provide social media features and to analyse traffic to the site. We also share information about your use of our site with our trusted social media, advertising and analytics partners. See more about cookies and our Privacy Policy