vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 4.x Template Modifications (https://vborg.vbsupport.ru/forumdisplay.php?f=246)
-   -   Integration with vBulletin - A perfectly centered Adsense banner below the navbar that is loaded AFTER other ADs (https://vborg.vbsupport.ru/showthread.php?t=239396)

StarBuG 03-29-2010 10:00 PM

A perfectly centered Adsense banner below the navbar that is loaded AFTER other ADs
 
1 Attachment(s)
Hello everyone.

I had the following problem:
I want to show a leaderboard banner below the navigation centered.
My leaderboard was clicked only half as often as the banners I showed in the thread as 2nd post.
So I wanted to load my leaderboard banner AFTER the 2nd post banners so that they get the highest paying keywords.

I found a complex but perfect solution for this:

The settings for my forum:
vBulletin 4.0.2
Fixed width for the forum and the forum is centered.
The banner position is exactly 253px from the top.

In Template ad_global_below_navbar add:

Code:

<div id="ads_navbar_container"></div>
Click Save

The ads_navbar_container creates an empty "box" that spans from left to right and has a hight of 100px.
This is the background box on which I will display the adsense banner.

In Template ad_footer_end add:

Code:

<div id="ads_navbar_container_2">
 <div id="ads_navbar">
  YOUR ADSENSE CODE HERE
 </div>
</div>

Click Save

This is the actual Adsense Leaderboard.
It is wraped inside a container (ads_navbar_container_2) that is positioned from the top to fit inside the box we created before (in this case 253px from the top).

After that we define the AD in ads_navbar and center it within the previous container.
If you use other banner formats change the width to fit the banner width.

In Template additional.css add:

Code:

#ads_navbar_container {
    border: 1px solid #CECECE;
        background: #EBEDF0;
        width:100%;
        height:100px;
        margin-left: auto;
    margin-right: auto;
}

#ads_navbar_container_2 {
    position: absolute;
    top: 253px;
    left: 0px;
    width: 100%;

}

#ads_navbar {
    position: absolute;
    width: 728px; 
    left: 0;
    right: 0;
    margin-left: auto;
    margin-right: auto;
}

Change the colors of the background box to colors that fit your theme.
Adjust the top position to fit your layout.
Change the banner width and box height if you use other formats then a leaderboard.

Click Save

E voila, a perfectly centered banner that is loaded last (displays the lowest paying keywords).

If you want to load it in between 2 other ads, simply search for an ad template that is loaded after the first and before the second and put the ad code there instead of the footer ad template.

In my case I only did this "trick" for banners that are shown to guests which are viewing a thread.
That is done via conditionals.

Instead of the above add the following to your ad_global_below_navbar template:

Code:

<vb:if condition="THIS_SCRIPT != 'showthread'">
 <div class="ads_navbar_container">
  <div class="ads_navbar">
  YOUR AD CODE HERE
  </div>
 </div>
<vb:else />
 <vb:if condition="THIS_SCRIPT == 'showthread' AND $show['guest']">
  <div id="ads_navbar_container_guests"></div>
 </vb:if>
 <vb:if condition="THIS_SCRIPT == 'showthread' AND $show['member']">
  <div class="ads_navbar_container">
  <div class="ads_navbar">
    YOUR AD CODE HERE
  </div>
  </div>
 </vb:if>
</vb:if>

In Template ad_footer_end add:

Code:

<vb:if condition="THIS_SCRIPT == 'showthread' AND $show['guest']">
<div id="ads_navbar_container_2_guests">
 <div id="ads_navbar_guests">
  YOUR ADSENSE CODE HERE
 </div>
</div>
</vb:if>

Click Save

In Template additional.css add:

Code:

.ads_navbar_container {
    border: 1px solid #CECECE;
        background: #EBEDF0;
        width:100%;
        margin-left: auto;
    margin-right: auto;
}

.ads_navbar {
        position: relative;
        width: 728px;
        margin-left: auto;
    margin-right: auto;
}

#ads_navbar_container_guests {
    border: 1px solid #CECECE;
        background: #EBEDF0;
        width:100%;
        height:100px;
        margin-left: auto;
    margin-right: auto;
}

#ads_navbar_container_2_guests {
    position: absolute;
    top: 253px;
    left: 0px;
    width: 100%;

}

#ads_navbar_guests {
    position: absolute;
    width: 728px; 
    left: 0;
    right: 0;
    margin-left: auto;
    margin-right: auto;
}

Best regards

StarBuG

https://vborg.vbsupport.ru/

Google isn't paying you enough money! Discover WHY!

Da-Vinci 03-30-2010 01:52 PM

Demo?

StarBuG 03-30-2010 03:09 PM

Currently only on my vB construction Forum so no public access.

But besides that you simply see a leaderboard banner below the
navigation that is always centered there is nothing more there to see

tafreeh 03-31-2010 03:54 AM

What about a screenshot then :)

StarBuG 03-31-2010 06:46 AM

A screenshot from an Adsense Banner?

Ok, added to the first post.

sKippah 03-31-2010 01:38 PM

Could u add a refresh timer. That it refresh itself?

StarBuG 03-31-2010 07:59 PM

That is against Google Adsense TOS

reteep 04-01-2010 09:06 AM

I just checked your forum, did you use a plugin for the AdSense Banners between the posts? Furthermore I believe adding those images besides the AdSense Banners is against the TOS, too. Please correct me if I'm wrong.

Cheers,
Andreas

StarBuG 04-01-2010 09:29 AM

The modification I posted here is for the leaderboard below the navigation.
It loads after the 2 rectangle banners in the 2nd post.
Yes I use it on Patientenfragen.net too.

I currently have an inquiry for the image placements.
Did not get an answer from google yet though.
So I can't really tell

StarBuG

woffie 04-02-2010 11:47 AM

Why use this when it is built into the software?


All times are GMT. The time now is 02:10 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01132 seconds
  • Memory Usage 1,751KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (6)bbcode_code_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete