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

Reply
 
Thread Tools Display Modes
  #1  
Old 03-01-2011, 12:21 AM
Stefan118 Stefan118 is offline
 
Join Date: Dec 2010
Location: Vaassen (Netherlands)
Posts: 299
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default SOLVED can't link to site from banner

Hello,

I want to place 3 banners on my forum.
The banners have to resize depending on the screen resolution of the user.
Choices are 1024x768 and 1280x1024.

This works all well.
But I also want to redirect the member to the website of the banner in an other screen.
I can't figure out how to do this.
I tried the usual <a href="................."> on different places but nothing works.

Who can help me?

I have placed the folowing script in the advertising area.

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 imgPath1 = "left.jpg";
var imgPath2 = "center.jpg";
var imgPath3 = "right.jpg";
var imgAlt = "Click here to go to the website of the sponsor.";


if (iWidth <= 1100) {
     document.write("<img src='/images/advertenties/" + imgPath1 + "' vspace='20' alt='" + imgAlt + "' width='190'>");
     document.write("&nbsp;&nbsp;");
     document.write("<img src='/images/advertenties/" + imgPath2 + "' vspace='20' alt='" + imgAlt + "' width='250'>");
     document.write("&nbsp;&nbsp;");
     document.write("<img src='/images/advertenties/" + imgPath3 + "' vspace='20' alt='" + imgAlt + "' width='190'>");
	}

else {
     document.write("<img src='/images/advertenties/" + imgPath1 + "' vspace='20' alt='" + imgAlt + "' width='250'>");
     document.write("&nbsp;&nbsp;&nbsp;&nbsp;");
     document.write("<img src='/images/advertenties/" + imgPath2 + "' vspace='20' alt='" + imgAlt + "' width='400'>");
     document.write("&nbsp;&nbsp;&nbsp;&nbsp;");
     document.write("<img src='/images/advertenties/" + imgPath3 + "' vspace='20' alt='" + imgAlt + "' width='250'>");
	}

</script>
</center>
Reply With Quote
  #2  
Old 03-01-2011, 01:50 AM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Can you post your code with the URL in it that you tried to add so we can see what was wrong?
Reply With Quote
  #3  
Old 03-01-2011, 01:04 PM
Stefan118 Stefan118 is offline
 
Join Date: Dec 2010
Location: Vaassen (Netherlands)
Posts: 299
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I fixed it.

What i did was this:
HTML Code:
document.write("<a href="http://www.hondaciviccrewapeldoorn.nl"><img src='/images/advertenties/" + imgPath1 + " alt='" + imgAlt + "' width='250'></a>");
What i had to do was this:
HTML Code:
document.write("<a href=http://www.hondaciviccrewapeldoorn.nl><img src='/images/advertenties/" + imgPath1 + "' alt='" + imgAlt + "' width='190'></a>");
The only diffrence between them are the " " infront and after the link.
<a href="http://www.hondaciviccrewapeldoorn.nl">
<a href=http://www.hondaciviccrewapeldoorn.nl>

Took me only more than 2 days!
Reply With Quote
  #4  
Old 03-01-2011, 03:33 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Did you try just escaping the quotes?
HTML Code:
document.write("<a href=\"http://www.hondaciviccrewapeldoorn.nl\"><img src='/images/advertenties/" + imgPath1 + " alt='" + imgAlt + "' width='250'></a>");
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 10:56 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.03575 seconds
  • Memory Usage 2,192KB
  • 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
  • (4)bbcode_html
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (4)post_thanks_box
  • (4)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (4)post_thanks_postbit_info
  • (4)postbit
  • (4)postbit_onlinestatus
  • (4)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