Go Back   vb.org Archive > vBulletin Modifications > vBulletin 4.x Modifications > vBulletin 4.x Template Modifications

Reply
 
Thread Tools
A perfectly centered Adsense banner below the navbar that is loaded AFTER other ADs Details »»
A perfectly centered Adsense banner below the navbar that is loaded AFTER other ADs
Version: 1.00, by StarBuG StarBuG is offline
Developer Last Online: Nov 2022 Show Printable Version Email this Page

Category: Integration with vBulletin - Version: 4.0.2 Rating:
Released: 03-29-2010 Last Update: Never Installs: 12
Template Edits
Re-useable Code  
No support by the author.

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



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

Screenshots

File Type: jpg screen_adsense.jpg (85.1 KB, 0 views)

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.
Благодарность от:
sodasusu

Comments
  #12  
Old 04-02-2010, 03:27 PM
StarBuG's Avatar
StarBuG StarBuG is offline
 
Join Date: Dec 2001
Location: Germany
Posts: 1,033
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Because it is not build into the software
Reply With Quote
  #13  
Old 04-13-2010, 09:49 PM
dankreiner dankreiner is offline
 
Join Date: Jun 2009
Posts: 57
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

this trick works! your other mod did not on 4.0.3
Reply With Quote
  #14  
Old 04-14-2010, 06:32 AM
StarBuG's Avatar
StarBuG StarBuG is offline
 
Join Date: Dec 2001
Location: Germany
Posts: 1,033
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

which other mod?

If it was released for vB4 it works on vB4 because I write all my Mods for my Forum and they are all implemented.
But if you use different settings then I describe at the beginning of the mod then you maybe need to alter the code.
Reply With Quote
  #15  
Old 05-02-2010, 06:27 PM
dankreiner dankreiner is offline
 
Join Date: Jun 2009
Posts: 57
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

i am having a problem... this mod does not work correctly on my arcade or my classifieds page (both mods).

The ads all show at the bottom of the page... Is there any way you could please fix this for me??? It is such a big deal and nobody else knows what i am talking about.
Reply With Quote
  #16  
Old 05-05-2010, 03:10 PM
StarBuG's Avatar
StarBuG StarBuG is offline
 
Join Date: Dec 2001
Location: Germany
Posts: 1,033
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I don't use these mods so sorry, can't fix it.

But modifing it shouldn't be that hard.
You maybe need to create different containers like in the ad_global_below_navbar and maybe copy, modify and rename the css settings

By the way, do you really need to switch the display order of your ads on these pages?
If not simply implement the banner as you did before.

This mod is NOT a mod to display a leaderboard below the navbar.
The main purpose is to switch the loading order of different ads!!
Reply With Quote
  #17  
Old 05-06-2010, 03:04 AM
ShawneyJ's Avatar
ShawneyJ ShawneyJ is offline
 
Join Date: Jul 2006
Location: Australia
Posts: 1,758
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

looks way better thank you. installed.
Reply With Quote
  #18  
Old 02-10-2011, 05:02 AM
Donatello Donatello is offline
 
Join Date: Jan 2011
Posts: 10
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

for me was easiest add after your AdSense Code in ad_global_below_navbar
<center> </center>
in scrip same this:

<center><script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script><vb:if condition="$adsshown[] = 1"></vb:if></div></center>
Reply With Quote
  #19  
Old 09-19-2016, 06:31 AM
tbellik tbellik is offline
 
Join Date: Jan 2015
Posts: 65
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks........
Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 04:50 PM.


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.04565 seconds
  • Memory Usage 2,306KB
  • Queries Executed 24 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (6)bbcode_code
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (4)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (9)post_thanks_box
  • (1)post_thanks_box_bit
  • (9)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit
  • (9)post_thanks_postbit_info
  • (8)postbit
  • (1)postbit_attachment
  • (9)postbit_onlinestatus
  • (9)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • fetch_musername
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • post_thanks_function_fetch_thanks_bit_start
  • post_thanks_function_show_thanks_date_start
  • post_thanks_function_show_thanks_date_end
  • post_thanks_function_fetch_thanks_bit_end
  • post_thanks_function_fetch_post_thanks_template_start
  • post_thanks_function_fetch_post_thanks_template_end
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_attachment
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete