The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
|
Adsense as second post. 2 Sizes - Big for guests, small for members - Legacy Version Details »» | |||||||||||||||||||||||||||
Adsense as second post. 2 Sizes - Big for guests, small for members - Legacy Version
Developer Last Online: Nov 2022
Hi
I made this template mod for my medical Forum and I decided to share this with you This hack is for forums that use the Postbit_legacy Template If you use the standard postbit template >> click here << What this hack does: This modification displays adsense as second post in every thread. Guest see a post like adsense with a product Referral (firefox in this code) and a leaderboard as post content. Registered Members see a standard banner so they don't get annoyed by the big advertising. I also included an information for guests, that they see a different not so disturbing ad if they register. This serves to purposes, one is to get more members to register of course the second purpose is to blend the advertising better into the post layout. ADD-ON: In addition you can add a Google Adsense link unit as last post of a thread on any page for members and guests. This advertising will only show if the thread has more then one post so that it does not show 2 advertisings directly below each other in case that the thread has no replies yet. Google Adsense has updated its ToS so that you are now allowed to use up to three link units on one page. So if you already use my "Adsense Link Unit in Navbar" Mod there woun't be a problem. See screenshots How to install: In template postbit (legacy version) search: Code:
<if condition="$post['userid'] AND $show['member']"> <tr><td class="vbmenu_option"><a href="profile.php?$session[sessionurl]do=addlist&userlist=buddy&u=$post[userid]"><phrase 1="$post[username]">$vbphrase[add_x_to_buddy_list]</phrase></a></td></tr> </if> </table> </div> Code:
<!-- Google AdSense in Posts for Guests --> <if condition="THIS_SCRIPT == 'showthread' AND !$GLOBALS['FIRSTPOSTID'] AND (!$show[member])"> <if condition="$show['spacer']"> </div> $spacer_close </if> <if condition="$show['spacer']"> $spacer_open <div id="edit$post[postid]" style="padding:0px 0px $stylevar[cellpadding]px 0px"> </if> <!-- BEGIN TEMPLATE: postbit --> <table id="post$post[postid]" class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="0" border="0" width="100%" align="center"> <tbody> <tr> <td class="thead" style="font-weight:normal; border: $stylevar[cellspacing]px solid $stylevar[tborder_bgcolor]; border-right: 0px" $post[scrolltothis]> <!-- status icon and date --> <img title="Alt" class="inlineimg" src="images/statusicon/post_old.gif" alt="Alt" border="0"> Today <!-- / status icon and date --> </td> <td class="thead" style="font-weight:normal; border: $stylevar[cellspacing]px solid $stylevar[tborder_bgcolor]; border-left: 0px" align="$stylevar[right]"> </td> </tr> <tr valign="top"> <td class="alt2" width="175" style="border: $stylevar[cellspacing]px solid $stylevar[tborder_bgcolor]; border-top: 0px; border-bottom: 0px"> <div id="postmenu_$post[postid]"> <span class="bigusername"><u><font color="#373737">Advertising</font></u></span> <br><br> <!-- Adsense Referral Code start --> <script type="text/javascript"><!-- google_ad_client = "YOUR PUB ID HERE"; google_ad_width = 125; google_ad_height = 125; google_ad_format = "125x125_as_rimg"; google_cpa_choice = "CAAQ0f2XhAIaCA6IC4oIlz0_KK2293M"; //--></script> <script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script> <!-- Adsense Referral Code end--> </div> </td> <td class="alt1" id="td_post_$post[postid]" style="border-right: $stylevar[cellspacing]px solid $stylevar[tborder_bgcolor]"> <!-- icon and title --> <div class="smallfont"> <img title="Post" class="inlineimg" src="images/icons/icon1.gif" alt="Beitrag" border="0"> <strong>Sponsored Links</strong> </div> <hr size="1" style="color:$stylevar[tborder_bgcolor]" /> <!-- / icon and title --> <!-- message --> <div> <!-- Adsense leaderboard start --> <script type="text/javascript"><!-- google_ad_client = "YOUR PUB ID HERE"; google_ad_width = 728; google_ad_height = 90; google_ad_format = "728x90_as"; google_ad_type = "text"; //--></script> <script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> </script> <!-- Adsense leaderboard end --> </div> <!-- / message --> <!-- sig --> <div>__________________<br> <i>This advertising will not be shown in this way to registered members.<br /> <a href="register.php">Register</a> your free account today and become a member on $vboptions[bbtitle]</i> </div> <!-- / sig --> </div> <!-- / message --> </td> </tr> <tr> <td class="alt2" style="border: $stylevar[cellspacing]px solid $stylevar[tborder_bgcolor]; border-top: 0px"> </td> <td class="alt1" align="$stylevar[right]" style="border: $stylevar[cellspacing]px solid $stylevar[tborder_bgcolor]; border-left: 0px; border-top: 0px"> </td> </tr> </tbody></table> <!-- / post $post[postid] popup menu --> </if> <!-- / Google AdSense in Posts for Guests--> <!-- Google AdSense in Posts for Members --> <if condition="THIS_SCRIPT == 'showthread' AND !$GLOBALS['FIRSTPOSTID'] AND ($show[member])"> <if condition="$show['spacer']"> </div> $spacer_close </if> <if condition="$show['spacer']"> $spacer_open <div id="edit$post[postid]" style="padding:0px 0px $stylevar[cellpadding]px 0px"> <if condition="!$post['islastshown']"><!-- this is not the last post shown on the page --></if> </if> <table class="tborder" id="post$post[postid]" align="center" border="0" cellpadding="6" cellspacing="1" width="100%"> <tbody><tr> <td class="thead" id="td_post_$post[postid]"> <div class="normal"> </div> </td> </tr> <tr> <td class="alt1" align="center"> <div> <!-- Adsense standard banner start --> <script type="text/javascript"><!-- google_ad_client = "YOUR PUB ID HERE"; google_ad_width = 468; google_ad_height = 60; google_ad_format = "468x60_as"; google_ad_type = "text"; //--></script> <script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script> <!-- Adsense standard banner End --> </div> </td> </tr> </tbody> </table> </if> <!-- / Google AdSense in Posts for Members--> Add this code below the last line of my above code: Code:
<!-- Google AdSense Link unit as last post for all --> <if condition="THIS_SCRIPT == 'showthread' AND $post['islastshown'] and !$GLOBALS['vbulletin']->GPC['ajax'] AND $post[postcount]!=1"> <if condition="$show['spacer']"> </div> $spacer_close </if> <if condition="$show['spacer']"> $spacer_open <div id="edit$post[postid]" style="padding:0px 0px $stylevar[cellpadding]px 0px"> <if condition="!$post['islastshown']"><!-- this is not the last post shown on the page --></if> </if> <table class="tborder" id="post$post[postid]" align="center" border="0" cellpadding="6" cellspacing="1" width="100%"> <tbody><tr> <td class="thead" id="td_post_$post[postid]"> <div class="normal"> </div> </td> </tr> <tr> <td class="alt1" align="center"> <div> <!-- Adsense Link Unit start --> <script type="text/javascript"><!-- google_ad_client = "YOUR PUB ID HERE"; google_alternate_color = "F5F5FF"; google_ad_width = 728; google_ad_height = 15; google_ad_format = "728x15_0ads_al_s"; google_color_border = "F5F5FF"; google_color_bg = "F5F5FF"; google_color_link = "000000"; google_color_text = "000000"; google_color_url = "000000"; //--> </script> <script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> </script> <!-- Adsense Link Unit end --> </div> </td> </tr> </tbody> </table> </if> <!-- Google AdSense Link unit as last post for all --> <!-- Adsense Referal Code start --> <!-- Adsense large rectangle start --> <!-- Adsense standard banner start --> Add-on: <!-- Adsense Link Unit start --> replace "YOUR PUB ID HERE" with your pub-ID and fit the colors of adsense to your color scheme Demo: Elternfragen.net - Das Forum f?r Eltern mit (medizinischen) Fragen Just go into any thread. I hope you like it and if you do, don't forget to mark es installed Changelog: v1.15 - 2007/07/22: NO CHANGES, just removed my Pub-ID from the hack! v1.15 - 2007/06/11: Add-on - Google Adsense Link unit as last post of every thread for guests and members. v1.1 - 2007/05/06: Condition altered to show advertising as second post on every page, not just the first. v1.0 - 2007/03/01: Changed a few German phrases to English, removed an unneccessary condition If you want more good placements for adsense code, check out my newest mod: Adsense Link Unit in Navbar StarBuG If you did not register for an Adsense account yet but you plan to, feel free to contact me. If you register via my referral I am willing to help you get the most out of your adsense placement by assisting you during the setup process and implementing the best adsense modifications. Just write me a Private message. Show Your Support
|
Comments |
#12
|
||||
|
||||
@jmw: heute means "Today" and you don't need to create a user for this hack. I simply missed to translate the german phrase (it's fixed now )
@Volvoholic: 1) no it should work in the child style if you changed it in that postbit. Did you switch your forum view to that specific style? 2) yes. Google adsense is content based and it will show different ads for different threads. read google help or visit webmaster communities like www.theadminzone.com or www.digitalpoint.com for more infos and tips about adsense 3) that is generaly a bad idea because google is a guest too. If you block guest views google can't index your forum (you lose new visitors) and can't deliver targeted ads (you lose money). replace the condition at the beginning of my code with: Code:
<if condition="THIS_SCRIPT == 'showthread' AND $post[postid] == $GLOBALS['qrfirstpostid'] AND ($show[member]) AND $bbuserinfo['usergroupid'] == 'X'"> |
#13
|
|||
|
|||
StarBug
thanks, i was not getting google targeted ads because my forum view is closed for guests. Thanks for that info. Cheers V |
#14
|
||||
|
||||
Thanks........
|
#15
|
|||
|
|||
nice thank you so much
|
#16
|
|||
|
|||
I don't know if this is because I have some other modifications installed, but this breaks the multiquote feature on my boards for the posts below the AdSense ad. Can anyone else with it installed check to see if it's just on my board?
Edit: Nevermind. I managed to fix it - It had something to do with my postbit_wrapper template being screwed, but I figured it out |
#17
|
|||
|
|||
lol, thanks Starbug. What if I want to show the same ads to all users? To members and guests...
|
#18
|
|||
|
|||
starbug can you help me?
|
#19
|
|||
|
|||
*Installs* ...and good working StarBug :up:
|
#20
|
|||
|
|||
can i see how your looks?
|
#21
|
||||
|
||||
@Mrdby: That totally depends on your problem. First step would be to tell me where I should help you
Edit: Wrong thread. Check my reply in the other thread @jmw: remove the condition "AND (!$show[member])" and the whole 2nd part (either the member or guest part), depending on which advertising you want to show. |
Thread Tools | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|