newbie LAC Posted March 20, 2017 Author Posted March 20, 2017 Hello, 14 hours ago, sulervo said: Can I insert ads after 1st post in specified categories? Yes 14 hours ago, sulervo said: How this will act with ads in "After the first post in each topic" location? Both ads will be displayed sulervo 1
sulervo Posted March 22, 2017 Posted March 22, 2017 (edited) Just purchased this. Works perfectly with selector+position examples but I have no idea how to publish ads after 1st post in specified categories.. Could you please give me selector and position? And how I solve category ID? www.foo.bar/forum/2-common/ Thought it's "2" but it's not.. Edited March 22, 2017 by sulervo
sulervo Posted March 22, 2017 Posted March 22, 2017 Like this way? {{if \IPS\Request::i()->app == 'forums' and \IPS\Request::i()->module == 'forums' and \IPS\Request::i()->controller == 'topic'}} {{$forumId = 0; try { $topic = \IPS\forums\Topic::loadAndCheckPerms( \IPS\Request::i()->id ); $forumId = $topic->forum_id; } catch( \Exception $e ) {};}} {{endif}} {{if in_array($forumId, array(3, 4))}}code {{endif}} 4 hours ago, sulervo said: And how I solve category ID? www.foo.bar/forum/2-common/ Thought it's "2" but it's not.. Actually this number is category ID?
newbie LAC Posted March 23, 2017 Author Posted March 23, 2017 Hello, 9 hours ago, sulervo said: Like this way? Yes. + - Selector article.cPost:eq(0) - Position Insert advert after the chosen element(s) sulervo 1
sulervo Posted March 23, 2017 Posted March 23, 2017 If I would like to upload banners to the system then category based targeting is not possible? I mean that other option if you don't want to use HTML code.
newbie LAC Posted March 24, 2017 Author Posted March 24, 2017 13 hours ago, sulervo said: If I would like to upload banners to the system then category based targeting is not possible? I mean that other option if you don't want to use HTML code. Use the setting "Extra condition" {{if \IPS\Request::i()->app == 'forums' and \IPS\Request::i()->module == 'forums' and \IPS\Request::i()->controller == 'topic'}} {{$forumId = 0; try { $topic = \IPS\forums\Topic::loadAndCheckPerms( \IPS\Request::i()->id ); $forumId = $topic->forum_id; } catch( \Exception $e ) {};}} {{endif}} {{if in_array($forumId, array(3, 4))}} 1 {{endif}} sulervo 1
Darek_Hugo Posted April 13, 2017 Posted April 13, 2017 Hello. Please help. How to insert an ad after the second search result. In this view https://invisionpower.com/search/?&q=test . Thank you and best regards.
newbie LAC Posted April 14, 2017 Author Posted April 14, 2017 13 hours ago, Hugo_S4 said: Hello. Please help. How to insert an ad after the second search result. In this view https://invisionpower.com/search/?&q=test . Thank you and best regards. Hello, CSS selector #elSearch_main [data-role="resultsContents"] .ipsStreamItem:eq(1) Position Insert advert after the chosen element(s) MeMaBlue 1
Darek_Hugo Posted April 14, 2017 Posted April 14, 2017 Thank you for your help. It works great. Regards
sulervo Posted April 26, 2017 Posted April 26, 2017 On 24.3.2017 at 7:06 AM, newbie LAC said: Use the setting "Extra condition" {{if \IPS\Request::i()->app == 'forums' and \IPS\Request::i()->module == 'forums' and \IPS\Request::i()->controller == 'topic'}} {{$forumId = 0; try { $topic = \IPS\forums\Topic::loadAndCheckPerms( \IPS\Request::i()->id ); $forumId = $topic->forum_id; } catch( \Exception $e ) {};}} {{endif}} {{if in_array($forumId, array(3, 4))}} 1 {{endif}} If system select ad which condition is false it shows nothing? Is there possible to determine backup ad which shows if condition doesn't match?
newbie LAC Posted April 26, 2017 Author Posted April 26, 2017 (edited) Hello, 20 minutes ago, sulervo said: If system select ad which condition is false it shows nothing? Yes 20 minutes ago, sulervo said: Is there possible to determine backup ad which shows if condition doesn't match? Currently no. Edited April 26, 2017 by newbie LAC
PCHelpforumBE Posted May 2, 2017 Posted May 2, 2017 hi @newbie LAC Can you advise how i can put a banner at the Right Side of the Second NavBar please? I tried insert CSS Selector - add inside at the end: ipsNavBar_secondary But it doesn't appear. Please kindly advise, Karel
newbie LAC Posted May 3, 2017 Author Posted May 3, 2017 Hello, 11 hours ago, Karel Beuckelaere said: Can you advise how i can put a banner at the Right Side of the Second NavBar please? Selector #elNavSecondary_1 .ipsNavBar_secondary Position Insert advert inside the chosen element(s), at the end MeMaBlue 1
PCHelpforumBE Posted May 3, 2017 Posted May 3, 2017 5 minutes ago, newbie LAC said: Hello, Selector #elNavSecondary_1 .ipsNavBar_secondary Position Insert advert inside the chosen element(s), at the end Thanks, however seems that due to design it looks a bit strange :-) also due to the different tabs, its a bit moving arround now :-) If you re-look at my example, maybe its better to put it on the left side of the Seach bar, right alinged? (at main navbar) Thanks again for your great support :-)
newbie LAC Posted May 3, 2017 Author Posted May 3, 2017 1 minute ago, Karel Beuckelaere said: Thanks, however seems that due to design it looks a bit strange :-) also due to the different tabs, its a bit moving arround now :-) I gave you selector and position. Other things are css. See my example <span class="ipsPos_right" style="margin: 10px;">Right Side of the Second NavBar</span> Result PCHelpforumBE 1
Bluto Posted May 11, 2017 Posted May 11, 2017 (edited) I wonder if you could put an advert in the search input? Instead of it saying Search... it says "Eat at Joes Pizza". Great plugin BTW. Edited May 11, 2017 by Bluto
newbie LAC Posted May 12, 2017 Author Posted May 12, 2017 (edited) Hello, 11 hours ago, Bluto said: I wonder if you could put an advert in the search input? Instead of it saying Search... it says "Eat at Joes Pizza". You can do it via js $("#elSearchField").attr("placeholder", "Eat at Joes Pizza"); Edited May 12, 2017 by newbie LAC Bluto and CB_Pam 1 1
Bluto Posted May 16, 2017 Posted May 16, 2017 Is there a way to use the css selector and have ads rotate in a position? Right now, both ads are showing up. Would love to sell multiple ads in specific spots using the css selector, but not really sure how to do it.
newbie LAC Posted May 17, 2017 Author Posted May 17, 2017 (edited) 12 hours ago, Bluto said: Is there a way to use the css selector and have ads rotate in a position? Right now, both ads are showing up. Would love to sell multiple ads in specific spots using the css selector, but not really sure how to do it. Hello, I don't know how you will set up your ads for this. Therefore I propose my solution HTML {{$r = mt_rand(1,3);}} {{if $r == 1}} <div class="ipsMessage ipsMessage_error"> This is an error message. </div> {{elseif $r == 2}} <div class="ipsMessage ipsMessage_success"> This message indicates something happened successfully. </div> {{else}} <div class="ipsMessage ipsMessage_warning"> This message warns the user of something terrible (or not so terrible). </div> {{endif}} Selector #elContent Position Insert advert before the chosen element(s) Result (I refresh the page) Edited May 17, 2017 by newbie LAC Bluto 1
Bluto Posted May 17, 2017 Posted May 17, 2017 (edited) Thanks for the previous code! I'm also trying to figure out how to create an if statement = if an advertisement key is disabled it will show something else. In my case I'm using links in my footer in a list and I don't want the lines of links to be blank if no one is advertising. {advertisement="footer_text_advert_1"} Trying a bunch of thing to get this setup. Below is the last code I tested. What would be the if part of the statement? I've tried = NULL, = 0, empty, isset, !=, figured you might know since you deal with all the variables. I don't code IPB enough to know what I'm supposed to use. {{if advertisement.footer_text_advert_1 > 0}} {advertisement="footer_text_advert_1"} {{else}} Some other link. {{endif}} I appreciate any help you can give me. Got it, I believe. {{if empty( \IPS\core\Advertisement::loadByLocation( 'ad_key' ))}} Nothing Here {{else}} {advertisement="ad_key"} {{endif}} Edited May 18, 2017 by Bluto
newbie LAC Posted May 18, 2017 Author Posted May 18, 2017 6 hours ago, Bluto said: Trying a bunch of thing to get this setup. Below is the last code I tested. {{if $advert = \IPS\core\Advertisement::loadByLocation('footer_text_advert_1')}} {$advert|raw} {{else}} Some other link. {{endif}} Bluto 1
Bluto Posted May 18, 2017 Posted May 18, 2017 (edited) Thanks for the code. The code I put in above, I copied from one of the IPS premade spots. This is going to work great for text links in the footer (or anywhere else on the site) which can be sold in the store. If some links aren't purchased, I have a default ads created called filler ads to fill in the non-sold spots. Edited May 18, 2017 by Bluto
Darek_Hugo Posted May 18, 2017 Posted May 18, 2017 Hello, @newbie LAC please help. How to insert ads in these views?: https://invisionpower.com/search/ and https://invisionpower.com/search/?&q=ads Thank you and best regards.
newbie LAC Posted May 19, 2017 Author Posted May 19, 2017 Hello, 13 hours ago, Hugo_S4 said: How to insert ads in these views?: Is this for 4.1.9 or for 4.2?
Recommended Posts