Back to vBulletin 3.6 Template Modifications

Adsense as second post. 2 Sizes - Big for guests, small for members
Mod Version: 1.15, by StarBuG

This modification is in the archives.
vB Version: 3.6.7 Rating: (4 votes - 4.75 average) Installs: 79
Released: 17 Jan 2007 Last Update: 22 Jul 2007 Downloads: 352
Not Supported Template Edits  

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 standard Postbit Template

If you use the postbit_legacy 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 large rectangle as post content. Members only 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 search:

Code:
<!-- / post $post[postid] popup menu -->
Add below:

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 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="currentPost">
   <div class="normal">
        <!-- status icon and date -->
         <img title="Alt" class="inlineimg" src="images/statusicon/post_old.gif" alt="Alt" border="0"></a> Today
        <!-- / status icon and date -->
     </div>
    </td>
</tr>
<tr>
    <td class="alt2" style="padding: 0px;">
        <!-- user info -->
        <table border="0" cellpadding="0" cellspacing="6" width="100%">
        <tbody>
         <tr>
      <td class="alt2">
       <!-- Adsense Referal 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 Referal Code end-->
      </td>
            <td nowrap="nowrap">
       <span class="bigusername"><u>Advertising</u></span><br />
       <span class="smallfont">Google Adsense</span>
            </td>
            <td width="100%">&nbsp;</td>
            <td valign="top" nowrap="nowrap">
       <div class="smallfont">
        <div>This advertising will not be shown</div>
        <div>in this way to registered members.</div>
        <div><a href="register.php">Register</a> your free account today</div>
        <div>and become a member on</a></div>
        <div>$vboptions[bbtitle]</div>
       </div>
            </td>
        </tr>
        </tbody></table>
        <!-- / user info -->
    </td>
</tr>
<tr>
    <td class="alt1" id="td_post_$post[postid]">
    <!-- message, attachments, sig -->
            <!-- icon and title -->
            <div class="smallfont">
                <img title="Standard" class="inlineimg" src="images/icons/icon14.gif" alt="Standard" border="0">
                <strong>Sponsored Links</strong>
            </div>
            <hr style="color: rgb(134, 134, 134);" size="1">
            <!-- / icon and title -->
        <!-- message -->
        <div>
        <!-- Adsense large rectangle start -->
         <script type="text/javascript"><!--
         google_ad_client = "YOUR PUB ID HERE";
       google_ad_width = 336;
         google_ad_height = 280;
         google_ad_format = "336x280_as";
         google_ad_type = "text";
     //--></script>
     <script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
        <!-- Adsense large rectangle end -->
        </div>
        <!-- / message -->
    <!-- message, attachments, sig -->
    </td>
</tr>
</tbody></table>
<!-- / post $post[postid] popup menu -->
</if>
<!-- / Google AdSense in Posts for Guests End-->
<!-- 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">
        &nbsp;
     </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 end-->
ADD-ON:

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">
        &nbsp;
     </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 -->
You now just need to customize the adsense code marked with:
<!-- 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: http://www.elternfragen.net 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.

If you want more good placements for adsense then 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.

Download

This modification is archived, downloads are still allowed.

File Type: %1$s install_postbit.txt (8.4 KB, 174 downloads)

Screenshots

Click image for larger version
Name:	2nd_post_guests.jpg
Views:	2344
Size:	44.0 KB
ID:	59206   Click image for larger version
Name:	2nd_post_members.jpg
Views:	1857
Size:	20.6 KB
ID:	59207   Click image for larger version
Name:	last_post_linkunit.jpg
Views:	926
Size:	19.6 KB
ID:	65505  

Similar Mods

Show Thread Enhancements Adsense as second post. 2 Sizes - Big for guests, small for members - Legacy Version vBulletin 3.6 Template Modifications
Adsense, different sizes for visitors to members vBulletin 3.6 Template Modifications
Adsense, different sizes for visitors to members – under last post vBulletin 3.5 Template Modifications

vblts.ru supports vBulletin®, 2022-2024