Jump to content

(NB41) Enhanced Advertisements


Recommended Posts

1 minute ago, newbie LAC said:

Show me the code from extra condition field

This is what i have. I tried clearing the cache as well just in case but no change. This is for an Adsense ad that is using a customer header position just under the built in header position

 

{{if \IPS\Request::i()->app == 'forums' and \IPS\Request::i()->module == 'forums' and \IPS\Request::i()->controller == 'forums'}}
    {{$forumId = \IPS\Request::i()->id;}}
{{elseif \IPS\Request::i()->app == 'forums' and \IPS\Request::i()->module == 'forums' and \IPS\Request::i()->controller == 'topic'}}
    {{try { $topic = \IPS\forums\Topic::loadAndCheckPerms( \IPS\Request::i()->id ); $forumId = $topic->forum_id; } catch( \Exception $e ) {};}}
{{endif}}
{{if !(isset($forumId) and in_array($forumId, array(5,2,21)))}}
1
{{endif}}
{{if 1==1 and !isset(\IPS\Output::i()->hiddenElements['nbenhadverts_error_page'])}}1{{endif}}      

 

Edited by gavpedz
Link to comment
Just now, gavpedz said:

This is what i have.

{{if \IPS\Request::i()->app == 'forums' and \IPS\Request::i()->module == 'forums' and \IPS\Request::i()->controller == 'forums'}}
    {{$forumId = \IPS\Request::i()->id;}}
{{elseif \IPS\Request::i()->app == 'forums' and \IPS\Request::i()->module == 'forums' and \IPS\Request::i()->controller == 'topic'}}
    {{try { $topic = \IPS\forums\Topic::loadAndCheckPerms( \IPS\Request::i()->id ); $forumId = $topic->forum_id; } catch( \Exception $e ) {};}}
{{endif}}
{{if !isset(\IPS\Output::i()->hiddenElements['nbenhadverts_error_page']) and !(isset($forumId) and in_array($forumId, array(5,2,21)))}}
1
{{endif}}

 

Link to comment
3 minutes ago, newbie LAC said:

{{if \IPS\Request::i()->app == 'forums' and \IPS\Request::i()->module == 'forums' and \IPS\Request::i()->controller == 'forums'}}
    {{$forumId = \IPS\Request::i()->id;}}
{{elseif \IPS\Request::i()->app == 'forums' and \IPS\Request::i()->module == 'forums' and \IPS\Request::i()->controller == 'topic'}}
    {{try { $topic = \IPS\forums\Topic::loadAndCheckPerms( \IPS\Request::i()->id ); $forumId = $topic->forum_id; } catch( \Exception $e ) {};}}
{{endif}}
{{if !isset(\IPS\Output::i()->hiddenElements['nbenhadverts_error_page']) and !(isset($forumId) and in_array($forumId, array(5,2,21)))}}
1
{{endif}}

 

Ah yes fantastic that works like a charm! 

Link to comment
1 minute ago, gavpedz said:

I have one particular ad that I need to adjust this code for slightly. 

It's an ad that shows in the sidebar. Is there a way to adjust the above code to stop showing this particular ad on the index page but will show in the sidebar on other pages?

Is this another advert? How you configured it?

Link to comment

So basically at the moment, it is just a simple Adsense ad which shows in the sidebar globally. I have the sidebar turned on globally. 

I am using your conditional above to ensure it doesn't show on error pages and in private forums which works great but I don't want it to show on the forum index as it's too long.

So in addition to the conditionals above i also want to stop it showing on the index page. 

 

Edited by gavpedz
Link to comment
6 minutes ago, gavpedz said:

So in addition to the conditionals above i also want to stop it showing on the index page. 

 

{{$indexPage = (\IPS\Request::i()->app == 'forums' and \IPS\Request::i()->module == 'forums' and \IPS\Request::i()->controller == 'index');}}
{{if \IPS\Request::i()->app == 'forums' and \IPS\Request::i()->module == 'forums' and \IPS\Request::i()->controller == 'forums'}}
    {{$forumId = \IPS\Request::i()->id;}}
{{elseif \IPS\Request::i()->app == 'forums' and \IPS\Request::i()->module == 'forums' and \IPS\Request::i()->controller == 'topic'}}
    {{try { $topic = \IPS\forums\Topic::loadAndCheckPerms( \IPS\Request::i()->id ); $forumId = $topic->forum_id; } catch( \Exception $e ) {};}}
{{endif}}
{{if !$indexPage and !isset(\IPS\Output::i()->hiddenElements['nbenhadverts_error_page']) and !(isset($forumId) and in_array($forumId, array(5,2,21)))}}
1
{{endif}}

 

Link to comment
  • 1 month later...
  • 3 weeks later...
  • 3 weeks later...
On 2/14/2018 at 1:24 PM, newbie LAC said:

Hello,

There is per advert setting

showon.jpg.fd474a70bbd6af0cdd75f9677e702

Hello Newbie Lac! 

I just got advice from support saying this method only works for images but not for code tags.  They referred me to you ?

can you give me directions how to best  implement 

code a  for desktop

code b for tablet

code c for mobile  ? 

for the same placement ?   ) 

am now just testing it on "After post 1 " placement but at a later time will want to implement this also on other placements via your app and plugin

 

Link to comment

Hello,

23 minutes ago, MeMaBlue said:

I just got advice from support saying this method only works for images but not for code tags.  They referred me to you

This should also works for code.

Show me the advert settings.

Anyway if you work with code you can use 

 

23 minutes ago, MeMaBlue said:

for the same placement ?   ) 

Not sure what you mean

Edited by newbie LAC
Link to comment

How to install this plugin? There's no manual anywhere.

I downloaded the file and it's .tar not .xml. So I cannot upload it via administrator panel. I tried to unzip and upload to the /plugins/ folder via FTP but it doesn't work too.

Link to comment
20 minutes ago, ramm said:

How to install this plugin? There's no manual anywhere.

I downloaded the file and it's .tar not .xml. So I cannot upload it via administrator panel. I tried to unzip and upload to the /plugins/ folder via FTP but it doesn't work too.

Hello,

It's an application

Go to AdminCP -> System -> Applications -> Install.
Select .tar file and then click Install button.
 

Link to comment

@newbie LACthank you!

I thought it's plugin, not application.

 

Anyway I have this error:

blad-instalowanie-wtyczki.thumb.jpg.0beeec1e404bdcf11807af9dce5745eb.jpg

I guess something is wrong with my server? 

 

 

I downloaded the newest version (for 4.3) and my forum is 4.2.9. Is it a problem?

Edited by ramm
Link to comment

Administrator panel -> applications 

It's during installation.

 

I checked on my server via FTP and yes. The "missing" file is there.

 

Now I have another error when I click "install":

305075748_aplikacjeforum.thumb.jpg.2600840199d5392e65d7dbbde6e8d8a8.jpg

 

 

2C133/4 The application you are attempting to install appears to be installed already. To reinstall the application you must first uninstall it.

 
Link to comment
18 minutes ago, ramm said:

2C133/4 The application you are attempting to install appears to be installed already. To reinstall the application you must first uninstall it.

 

1. Try delete the app using direct link

domain.tld/admin/?adsess=2g062ahjjsl8sh501jfsi24na4&app=core&module=applications&controller=applications&do=delete&id=nbenhadverts

2. Delete the folder nbenhadverts from applications directory (use ftp)

3. Install the app

Quote

Go to AdminCP -> System -> Applications -> Install.
Select .tar file and then click Install button.

 

Link to comment

After I have upgraded to 4.2.9 from 4.1.19 I see a strange behavior with advertisement. 

I set up advertisement, and they dispayed ok in all locations, but then after 1-2 days they stop showing, and only resume is I clear the cache via ACP. Then they again resume for 1-2 days.

on 4.1.19 everything worked fine. Do you have idea why this could happend?

 

Link to comment
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...