The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
A Neater Google Adsense After First Post Details »» | |||||||||||||||||||||||||||
Ok, so i haven't found any google adsence products for vb 4 yet that sit neatly under your first post only, on every page. Credits to Miko and my self for a few tiny edits.
How To Install Step.1: GoTo Postbit Templates>>open postbit_legacy and add at the very bottom: Code:
<vb:if condition="$post['isfirstshown']"> <li class="firstpost_advert_container"><div class="firstpost_advert"> REPLACE THIS WITH YOUR ADSENSE CODE HERE </div> </li> </vb:if> Step.2: GoTo CSS Templates>>open additional.css and add this code: Code:
.firstpost_advert_container { clear: both; display: block; float: left; margin-bottom: 12px; position: relative; width: 100%; border: 1px solid #E5E6F4; } .firstpost_advert { with: 100%; background: #F1F1FA; border: 1px solid #fff; min-height: 90px; margin: 0; padding: 7px; text-align: center; vertical-align: middle; } DEMO: Teen Forums Please Note: im not a coder, i just wanted to share this with others, its VERY easy to add to your styles and looks neat. Good Luck. This coding is also different than Mod Version: 1.00, by Allan. You shouldn't have any problems with this and it will do you till a product version comes out. Screenshots
Show Your Support
|
5 благодарности(ей) от: | ||
acmalin927, farru, sodasusu, SolidSnakeLive, StormBreaker |
Comments |
#82
|
|||
|
|||
Quote:
Quote:
Until now, I have not used plugins in this manner. I've tested this in a thread, and have verified that if there were less than 3 posts only the single ad was shown. For anyone else considering making their ads work the way mine here, here's the complete code below. These are my conditions: 1) The ads will ONLY be shown to unregistered / guest users and a couple other groups - as indicated by the <vb:if condition="is_member_of($bbuserinfo,1,3,4,8) section 2) There are TWO Google AdSense ads created, "vBulletin Forum Ad after First Post" which is shown after the opening post and "vBulletin Forum Ad Before Last Post" which is shown ONLY in a thread if there are 3 posts. In postbit_legacy: HTML Code:
<vb:if condition="is_member_of($bbuserinfo,1,3,4,8) AND $post['isfirstshown']"> <li class="firstpost_advert_container"><div class="firstpost_advert"> <vb:literal> <script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script> <!-- vBulletin Forum Ad after First Post --> <ins class="adsbygoogle" style="display:inline-block;width:728px;height:90px" data-ad-client="ca-pub-***************" data-ad-slot="**********2"></ins> <script> (adsbygoogle = window.adsbygoogle || []).push({}); </script> </vb:literal> </div> </li> </vb:if> <vb:if condition="is_member_of($bbuserinfo,1,3,4,8) AND $post['islastshown'] AND $tbworld_postbit_postcount >= 3"> <li class="lastpost_advert_container"><div class="lastpost_advert"> <vb:literal> <script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script> <!-- vBulletin Forum Ad Before Last Post --> <ins class="adsbygoogle" style="display:inline-block;width:728px;height:90px" data-ad-client="ca-pub-************" data-ad-slot="*************"></ins> <script> (adsbygoogle = window.adsbygoogle || []).push({}); </script> </vb:literal> </div> </li> </vb:if> HTML Code:
.firstpost_advert_container { clear: both; display: block; float: left; margin-bottom: 12px; position: relative; width: 100%; border: 1px solid #666666; } .firstpost_advert { with: 100%; background: #666666; border: 1px solid #666666; min-height: 90px; margin: 0; padding: 7px; text-align: center; vertical-align: middle; } .lastpost_advert_container { clear: both; display: block; float: left; margin-bottom: 12px; position: relative; width: 100%; border: 1px solid #666666; } .lastpost_advert { with: 100%; background: #666666; border: 1px solid #666666; min-height: 90px; margin: 0; padding: 7px; text-align: center; vertical-align: middle; } |
#83
|
|||
|
|||
Good evening [mornig]
I love the mod greatly however i have a problem with it .. It dispaly the same AD after every single post. Can anybidy help with that ...THx in advance ! |
#84
|
|||
|
|||
Quote:
Content > Ad units > New ad unit |
#85
|
|||
|
|||
I do have different Ad untis, what I am saying...The AD banner is displaying after each and every single post... I thought it was for One time AFTER the frist post ??
|
#86
|
|||
|
|||
Refer this post https://vborg.vbsupport.ru/showpost....8&postcount=74
ads are showed only in 1 post of a page |
#87
|
|||
|
|||
Yeah it should just be a single ad after the first post. Double check the code in postbit_legacy and additional.css
|
#88
|
|||
|
|||
Just in case anyone else is having trouble like I was with this on vbulletin 4.2.2, this wasn't working for me and I spent a good while trying to figure out why. Turns out the problem was I was using the wrong template.
I was using "postbit_legacy" as all instructions said to use. but I needed to just use "postbit". After adding the code to "postbit" template, and then also changing the plugin mentioned above to reflect the same template - it now works brilliantly for me. So, if your having trouble, try using the "postbit" template instead. |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|