Jump to content

(NB41) Enhanced Advertisements


Recommended Posts

Posted
2 minutes ago, gavpedz said:

Thank you but the code doesnt seem any different. 

Before

{{if isset($forumId) and in_array($forumId, array(1,2,3))}}

after

{{if !(isset($forumId) and in_array($forumId, array(1,2,3)))}}

 

Posted
2 minutes ago, gavpedz said:

Sorry i edited my post i tried this but ads are still showing in those particular forums and the topics within them. 

Show me the code from extra condition field

Posted (edited)
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
Posted
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}}

 

Posted
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! 

Posted

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?

Posted
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?

Posted (edited)

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

 

  • 1 month later...
Posted
4 hours ago, BomAle said:

It work also for commerce app "selling advertisements"?

Hello,

When someone bought the advert that advert will be displayed on adverts page. You can edit that advert.

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

 

Posted (edited)

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
Posted

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.

Posted
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.
 

Posted (edited)

@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
Posted
11 hours ago, ramm said:

Anyway I have this error:

Where (page/location) and when (after installation/during installation) you get that error?

Do you have the missing file?

Posted

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.

 
Posted
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.

 

Posted

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?

 

  • Recently Browsing   0 members

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