Go Back   vb.org Archive > vBulletin Modifications > vBulletin 4.x Modifications > vBulletin 4.x Template Modifications
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Align Logo with Header Advert 2 (No Drop) Details »»
Align Logo with Header Advert 2 (No Drop)
Version: 1.00, by syrus.xl syrus.xl is offline
Developer Last Online: Apr 2016 Show Printable Version Email this Page

Category: Forum Home Enhancements - Version: 4.0.0 Rating:
Released: 01-05-2010 Last Update: 01-05-2010 Installs: 50
Template Edits
Code Changes  
No support by the author.

I originally coded this for my vBulletin 4.0, but so many people have been asking on vBulletin.com how to do this - so I thought I would release it on here, as well.

What it does:

By default if you add any advertisement to the header, you will find that your header logo is 'pushed' upwards. Many people prefer that logo is aligned with the advert and not placed above. ** See attached screenshot **

DEMO:
http://www.digitalport.co.uk
I have coded this little modification so that if you place an advert in ad area 2 of the header it will appear next to your logo, and will not affect your logo's position whatsoever. It is coded to accept a standard banner size of 468x60 in the header ad 2 section. You can adjust this to suit other banner sizes as required.

In the #logo_main adjust the width and height values to suit your own logo. The margin-top value adjusts the distance between the top of your logo and the top of the toplinks. margin-left I have set to 20px, but you can adjust this to suit where you want the logo to be from the left side.

The best way is to adjust the values gradually if you are not sure about CSS coding.

Installation:

In the vbulletin.css template find:
Code:
.body_wrapper {
    padding: 0 {vb:math 2 * {vb:stylevar padding}} {vb:math {vb:stylevar padding}*2};
    background: {vb:stylevar body_background};
    -moz-border-radius: {vb:stylevar border_radius};
    -webkit-border-radius: {vb:stylevar border_radius};
    _display: inline;
}
Add after:
Code:
/* Replacement Header CSS */

#header_wrapper {
    width:100%;
    height:140px;
} 
#logo_main {
    float:left;
    display:inline-block;
    width:274px;
    height:98px;
    margin-top:20px;
    margin-left:20px;
    position:relative;
}  
#banner_ad_top {
     float:right;
     display:inline-block;
     margin-right:20px;
     margin-top:50px;
     width:468px;
     height:60px; 
}

In the header template find and remove:

Code:
{vb:raw ad_location.global_header2}

In the header template find and remove:

Code:
    <div><a name="top" href="{vb:raw vboptions.forumhome}.php{vb:raw session.sessionurl_q}" class="logo-image"><img src="{vb:stylevar titleimage}" alt="Powered by vBulletin" /></a></div>

Replace with this code:

Code:
<!-- Start Custom Header -->
<div id="header_wrapper">
     <div id="logo_main">
     <a name="top" href="{vb:raw vboptions.site_tab_url}{vb:raw session.sessionurl_q}" class="logo-image"><img src="{vb:stylevar titleimage}" alt="{vb:rawphrase x_powered_by_vbulletin, {vb:raw vboptions.bbtitle}}" /></a>
     </div>
     <div id="banner_ad_top">
     {vb:raw ad_location.global_header2}
     </div>
</div>
<!-- End Custom Header -->

Important:

One additional StyleVar you will need to change is the doc_minWidth to around 800px or more depending on your layout width. This will stop the advert div from dropping below your logo in the header, if someone is using a low resolution to view your website.

Download Now

File Type: txt install_instructions.txt (2.9 KB, 263 views)

Screenshots

File Type: jpg Capture6.JPG (73.5 KB, 0 views)

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #32  
Old 02-05-2010, 09:54 AM
Sax on the Web Sax on the Web is offline
 
Join Date: Feb 2006
Posts: 14
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by syrus.xl View Post
Hi,

You will need to edit your front page, and where it says Style select Inherit - this will then inherit the correct style site-wide.

HTH
Thanks a lot,
in the matter of fact I changed it to "vb4 default" and that did the trick. (It was set as "vB3 incompatible" before).

Follow-up question: I would like to create a separate style for the front page which would be a sub-set of the forum header. (I.e. only one out of four banners.) How to get started?

thnx in advance,
Reply With Quote
  #33  
Old 02-07-2010, 05:36 PM
HRCHOSTING HRCHOSTING is offline
 
Join Date: May 2009
Posts: 32
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Installed but its pushing the image half way off the side of my page. Any idea's?
Reply With Quote
  #34  
Old 02-12-2010, 02:48 AM
RedTrinity's Avatar
RedTrinity RedTrinity is offline
 
Join Date: Mar 2008
Location: QLD, Australia
Posts: 265
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by HRCHOSTING View Post
Installed but its pushing the image half way off the side of my page. Any idea's?
Happening on our forum too VB4.0.1, using Firefox 3.5.
Reply With Quote
  #35  
Old 02-12-2010, 06:14 AM
syrus.xl's Avatar
syrus.xl syrus.xl is offline
 
Join Date: Jun 2005
Location: In a cyber world...
Posts: 999
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I coded this for version 4.0.0 - it does require updating, but this will not be done until vBulletin release 4.0.2, just in case they make further CSS changes to the header template.

Sorry about this...
Reply With Quote
  #36  
Old 02-12-2010, 05:08 PM
murekhalir murekhalir is offline
 
Join Date: Oct 2006
Posts: 254
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

its all good. I'll just have to wait then.

It is chrome compatible for sure.

ie7 no.

ie 8 yes.
Reply With Quote
  #37  
Old 02-13-2010, 08:01 AM
daveaite's Avatar
daveaite daveaite is offline
 
Join Date: Jul 2009
Location: Florida
Posts: 1,890
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by HRCHOSTING View Post
Installed but its pushing the image half way off the side of my page. Any idea's?
Adjust vbulletin.css

Edit this to perfection. Heres what I did below...

Code:
#logo_main {
    float:left;
    display:inline-block;
    width:274px;
    height:60px;
    margin-top:25px;
    margin-left:0px;
    position:relative;
}  
#banner_ad_top {
     float:right;
     display:inline-block;
     margin-right:260px;
     margin-top:50px;
     width:468px;
     height:60px;
Reply With Quote
  #38  
Old 02-13-2010, 10:31 AM
RedTrinity's Avatar
RedTrinity RedTrinity is offline
 
Join Date: Mar 2008
Location: QLD, Australia
Posts: 265
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by daveaite View Post
Adjust vbulletin.css

Edit this to perfection. Heres what I did below...
Thanks. Your advice helped me to get my banner back from wandering off the right side of the screen! Though still having issues with getting it to the right of the existing banner. Here's where I am at the moment (see attached image):

PHP Code:
#logo_main {
    
float:left;
    
display:inline-block;
    
width:400px;
    
height:100px;
    
margin-top:5px;
    
margin-left:0px;
    
position:relative;
}  
#banner_ad_top {
     
float:right;
     
display:inline-block;
     
margin-right:250px;
     
margin-top:0px;
     
width:400px;
     
height:100px

Any suggestions? I'm not sure how I can get the ad banner any further up whilst the margin-top is already set to 0 It seems to be aligning itself with 'the top' being distinguished as the bottom of the left banner, instead of the top of the header area.

Not sure how to fix this. Would appreciate further help.

Cheers

ETA: Just to add, apon further experimenting, raising that margin-right: amount with the ad banner does indeed fix the banner off the screen issue, but it also creates the big gap underneath the original logo banner (to which the ad banner is on the right of, as per the pic attached).

So whilst fixing the old problem, it seems to create a new one.
Attached Images
File Type: jpg bannersheader.JPG (45.5 KB, 0 views)
Reply With Quote
  #39  
Old 02-13-2010, 11:01 PM
RedTrinity's Avatar
RedTrinity RedTrinity is offline
 
Join Date: Mar 2008
Location: QLD, Australia
Posts: 265
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Ok so I managed to get the banners aligned in FF (my default browser) and looking good. But they are still coming up as misaligned for IE

Have tried adjusting the doc_minwidth value, but doesn't seem to be making much (if any) difference with this problem.

Starting to do my head in a bit
Attached Images
File Type: jpg bannersheaderFF.JPG (42.9 KB, 0 views)
File Type: jpg bannersheaderIE.JPG (57.6 KB, 0 views)
Reply With Quote
  #40  
Old 02-14-2010, 03:17 AM
HRCHOSTING HRCHOSTING is offline
 
Join Date: May 2009
Posts: 32
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by daveaite View Post
Adjust vbulletin.css

Edit this to perfection. Heres what I did below...

Code:
#logo_main {
    float:left;
    display:inline-block;
    width:274px;
    height:60px;
    margin-top:25px;
    margin-left:0px;
    position:relative;
}  
#banner_ad_top {
     float:right;
     display:inline-block;
     margin-right:260px;
     margin-top:50px;
     width:468px;
     height:60px;
worked like a charm, thanks
Reply With Quote
  #41  
Old 02-14-2010, 03:24 AM
RedTrinity's Avatar
RedTrinity RedTrinity is offline
 
Join Date: Mar 2008
Location: QLD, Australia
Posts: 265
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by HRCHOSTING View Post
worked like a charm, thanks
Just make sure its working properly in all browsers, as I found this fixed my problem in Firefox, but not IE.
Reply With Quote
Reply


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:42 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04858 seconds
  • Memory Usage 2,364KB
  • Queries Executed 26 (?)
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
  • (7)bbcode_code
  • (1)bbcode_php
  • (6)bbcode_quote
  • (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
  • (4)pagenav_pagelink
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (5)postbit_attachment
  • (11)postbit_onlinestatus
  • (11)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
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • 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