Go Back   vb.org Archive > vBulletin 4 Discussion > vB4 General Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 09-02-2012, 06:01 PM
znightmare znightmare is offline
 
Join Date: Aug 2012
Posts: 20
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Help with fitting logo to other resolutions

So I made my logo to fit the resolution that I use (1366x768), it fits perfectly at that resolution but it get all messed up on any other screen resolution. The way I put my banner on my site was to just add a picture to the very top of the header template, so is there a code I can use before the picture to make it expand or get smaller depending on the resolution?

Here's a pic of it on 1440x900


my url is http://anime-forum.net
Reply With Quote
  #2  
Old 09-02-2012, 08:49 PM
John Lester John Lester is offline
 
Join Date: Nov 2004
Posts: 543
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Try putting the two images/links into a <div> (crude example below)

Code:
<div>
a href="http://anime-forum.net/forum.php"><img src="http://i150.photobucket.com/albums/s118/beefsalad1/derff.jpg">


</a>
<a href="http://anime-forum.net/forum.php">
<img src="http://i150.photobucket.com/albums/s118/beefsalad1/piotuiymtnrgbef.jpg">


</a>
</div>
Reply With Quote
  #3  
Old 09-02-2012, 09:03 PM
znightmare znightmare is offline
 
Join Date: Aug 2012
Posts: 20
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

No I don't think it worked, thanks though, hmmm I don't know what I could do :/
Reply With Quote
  #4  
Old 09-02-2012, 09:20 PM
Stefan118 Stefan118 is offline
 
Join Date: Dec 2010
Location: Vaassen (Netherlands)
Posts: 299
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I used this on my ads.
This script is for resolution under 1100 pixels <> (1024x768)
and for a resolution above 1100 pixels <> (1280x1024)

It eighter places a banner with a width of 350 or 430 pixels.

HTML Code:
<script language="javascript" type="text/javascript" src="/templates/high_javascript.js">
<!--
//var iWidth = 0;
//var iHeight = 0;
//-->
</script>
 <center>
<script type="text/Javascript">
<!--
/*initialization for IE! Leave this funtion after the body tag */
 /*if(!window.Width && document.body && document.body.offsetWidth)
  {
   //window.onresize = recal;
 	 //alert("line114!");
   Width = windowWidth();
   Height = windowHeight();
   //alert(Width + "<br>" + Height);
   //alert("width");
 }
 */
//-->
var iWidth, iHeight, sRes;
if (window.innerWidth != null) {
	//alert("first");
	iWidth = window.innerWidth;
	iHeight = window.innerHeight; 
}
else if (document.body.clientWidth != null) {
	//alert("second");
	iWidth = document.body.clientWidth;
	iHeight=document.body.clientHeight;
} else {
	//alert("third");
	}

var imgPath = "banner.jpg";
var imgAlt = "Alt text.";

if (iWidth <= 1100) {
     document.write("<a href=http://www.google.comenter a site url target=_new><img src='enter image sourcepath WITHOUT image name!" + imgPath + "' alt='" + imgAlt + "' width='350'></a>");

	}

else

 {
     document.write("<a href=http://www.google.com target=_new><img src='enter image sourcepath WITHOUT image name!" + imgPath + "' alt='" + imgAlt + "' width='430'></a>");
  }
Reply With Quote
  #5  
Old 09-02-2012, 09:36 PM
znightmare znightmare is offline
 
Join Date: Aug 2012
Posts: 20
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Oh nice, so this will work for my banner? Will it work for resolution of 1440x900? and where exactly do I put it, sorry I'm not all that great with coding.
Reply With Quote
  #6  
Old 09-02-2012, 09:47 PM
Stefan118 Stefan118 is offline
 
Join Date: Dec 2010
Location: Vaassen (Netherlands)
Posts: 299
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

In the ACP, goto Styles and templates --> Style maneger
In the right screen select: Edit templates.
In the Header template you see the folowing code:

HTML Code:
<div class="above_body"> <!-- closing tag is in template navbar -->
<div id="header" class="floatcontainer doc_header">
After that your banner / logo is loaded.

I have edited my template, so i don't know anymore what the original code is what follows under the code above here...

But everithing between
HTML Code:
<div class="above_body"> <!-- closing tag is in template navbar -->
<div id="header" class="floatcontainer doc_header">
and
HTML Code:
    <div id="toplinks" class="toplinks">
        <vb:if condition="$show['member']">
            <ul class="isuser">
can be edited for your banner if i'm correct.

To be sure, you can copy and past the whole template to a textfile so if it doesn't work you can put the file back.

--------------- Added [DATE]1346626923[/DATE] at [TIME]1346626923[/TIME] ---------------

I just found out that it doesn't work...
Tried it in my testforum, and it doesn't show my banner.

Working on it....

--------------- Added [DATE]1346627529[/DATE] at [TIME]1346627529[/TIME] ---------------

it works... I forgot 2 closing tags lol.

This is what you have to do...

Find in the Header template:
HTML Code:
<div class="above_body"> <!-- closing tag is in template navbar -->
<div id="header" class="floatcontainer doc_header">
and replace EVERYTHING between that and
HTML Code:
    <div id="toplinks" class="toplinks">
        <vb:if condition="$show['member']">
            <ul class="isuser">
with this:

HTML Code:
<script language="javascript" type="text/javascript" src="/templates/high_javascript.js">
<!--
//var iWidth = 0;
//var iHeight = 0;
//-->
</script>
 <center>
<script type="text/Javascript">
<!--
/*initialization for IE! Leave this funtion after the body tag */
 /*if(!window.Width && document.body && document.body.offsetWidth)
  {
   //window.onresize = recal;
 	 //alert("line114!");
   Width = windowWidth();
   Height = windowHeight();
   //alert(Width + "<br>" + Height);
   //alert("width");
 }
 */
//-->
var iWidth, iHeight, sRes;
if (window.innerWidth != null) {
	//alert("first");
	iWidth = window.innerWidth;
	iHeight = window.innerHeight; 
}
else if (document.body.clientWidth != null) {
	//alert("second");
	iWidth = document.body.clientWidth;
	iHeight=document.body.clientHeight;
} else {
	//alert("third");
	}

var imgPath = "banner.jpg";
var imgAlt = "Alt text.";

if (iWidth <= 1100) {
     document.write("<a href=http://www.google.com target=_new><img src='/enter image sourcepath WITHOUT image name!/" + imgPath + "' alt='" + imgAlt + "' width='350'></a>");

	}

else

 {
     document.write("<a href=http://www.google.com target=_new><img src='/enter image sourcepath WITHOUT image name!/" + imgPath + "' alt='" + imgAlt + "' width='430'></a>");
  }
</script>

</center>
Note:
Replace google.com for your own URL
Replace the name of the banner
Replace the imagepath like this: /images/logo/
Resize the width of your logo (1440 and a lower resolution) where i have 350 and 430
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 06:13 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.07354 seconds
  • Memory Usage 2,225KB
  • Queries Executed 11 (?)
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
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)bbcode_code
  • (7)bbcode_html
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (6)post_thanks_box
  • (6)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (6)post_thanks_postbit_info
  • (6)postbit
  • (6)postbit_onlinestatus
  • (6)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_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete