newbie LAC Posted February 23, 2018 Author Posted February 23, 2018 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)))}}
gavpedz Posted February 23, 2018 Posted February 23, 2018 Sorry i edited my post i tried this but ads are still showing in those particular forums and the topics within them.
newbie LAC Posted February 23, 2018 Author Posted February 23, 2018 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
gavpedz Posted February 23, 2018 Posted February 23, 2018 (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 February 23, 2018 by gavpedz
newbie LAC Posted February 23, 2018 Author Posted February 23, 2018 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}}
gavpedz Posted February 23, 2018 Posted February 23, 2018 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!
gavpedz Posted February 23, 2018 Posted February 23, 2018 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?
newbie LAC Posted February 23, 2018 Author Posted February 23, 2018 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?
gavpedz Posted February 23, 2018 Posted February 23, 2018 (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 February 23, 2018 by gavpedz
newbie LAC Posted February 23, 2018 Author Posted February 23, 2018 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}} gavpedz 1
BomAle Posted March 29, 2018 Posted March 29, 2018 I like your work, one question before add into my wishlist ? It work also for commerce app "selling advertisements"?
newbie LAC Posted March 29, 2018 Author Posted March 29, 2018 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. BomAle 1
newbie LAC Posted April 20, 2018 Author Posted April 20, 2018 Hello, 4 hours ago, media said: 4.3 compatible or not? Use vesion 1.0.7 DSystem and media 1 1
MeMaBlue Posted May 10, 2018 Posted May 10, 2018 On 2/14/2018 at 1:24 PM, newbie LAC said: Hello, There is per advert setting 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
newbie LAC Posted May 10, 2018 Author Posted May 10, 2018 (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 May 10, 2018 by newbie LAC
MeMaBlue Posted May 11, 2018 Posted May 11, 2018 thank you very much @newbie LAC for resolving this so fast! U the best! all done!
ramm Posted May 15, 2018 Posted May 15, 2018 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.
newbie LAC Posted May 15, 2018 Author Posted May 15, 2018 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. ramm 1
ramm Posted May 15, 2018 Posted May 15, 2018 (edited) @newbie LACthank you! I thought it's plugin, not application. Anyway I have this error: 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 May 15, 2018 by ramm
newbie LAC Posted May 16, 2018 Author Posted May 16, 2018 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?
ramm Posted May 16, 2018 Posted May 16, 2018 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": 2C133/4 The application you are attempting to install appears to be installed already. To reinstall the application you must first uninstall it.
newbie LAC Posted May 16, 2018 Author Posted May 16, 2018 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.
Sergey_SV Posted May 17, 2018 Posted May 17, 2018 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?
Recommended Posts