Invision Community 4: SEO, prepare for v5 and dormant account notifications Matt November 11, 2024Nov 11
March 20, 20177 yr Author 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
March 22, 20177 yr 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, 20177 yr by sulervo
March 22, 20177 yr 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?
March 23, 20177 yr Author Hello, 9 hours ago, sulervo said: Like this way? Yes. + - Selector article.cPost:eq(0) - Position Insert advert after the chosen element(s)
March 23, 20177 yr 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.
March 24, 20177 yr Author 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}}
April 13, 20177 yr 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.
April 14, 20177 yr Author 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)
April 26, 20177 yr 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?
April 26, 20177 yr Author 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, 20177 yr by newbie LAC
May 2, 20177 yr 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
May 3, 20177 yr Author 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
May 3, 20177 yr 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 :-)
May 3, 20177 yr Author 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
May 11, 20177 yr 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, 20177 yr by Bluto
May 12, 20177 yr Author 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, 20177 yr by newbie LAC
May 16, 20177 yr 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.
May 17, 20177 yr Author 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, 20177 yr by newbie LAC
May 17, 20177 yr 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, 20177 yr by Bluto
May 18, 20177 yr Author 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}}
May 18, 20177 yr 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, 20177 yr by Bluto
May 18, 20177 yr 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.
May 19, 20177 yr Author Hello, 13 hours ago, Hugo_S4 said: How to insert ads in these views?: Is this for 4.1.9 or for 4.2?