The forum of the forums
Welcome to the Official Support Forum of Forumotion!

To take full advantage of everything offered by our forum, please log in if you are already a member, or join our community if you've not yet.



Create a free forum like this one.

Javascript issue with ad banner rotator

View previous topic View next topic Go down

Javascript issue with ad banner rotator

Post by Raine Tensai on June 11th 2010, 11:47 am

Hello!
I'm having two problems:

1)I'm using a javascript code to have rotating adbanners on my forum. It all looks right, but when I click on the banners to go to the web pages they are linked to, it just brings me back to my forum homepage.

See here: http://yaoiverse.lovediscussion.net/index.htm

Is there anyway to fix this? In the code I clearly have the banners pointing elsewhere.

2) My second problem. I've got the code for the banner in the homepage message HTML box. Where would I move it to to have it show on all pages, not just the homepage?


I have attached the code I'm using. Also, I'm using phbb version 2, and no, I won't change to one of the other versions, because they have major pitfalls.

Thank you in advance for any help!

Raine Tensai
New Member

Female Posts : 8
Reputation : 0
Language : English
Location : New York

http://yaoiverse.lovediscussion.net/index.htm

Back to top Go down

Re: Javascript issue with ad banner rotator

Post by RoNo on June 11th 2010, 7:57 pm

Banner 1 is linked to your homepage.
You need to edit the links[1] address.

Banner 2 is linked to Google and works fine.
(this includes a Google image for demonstration)
Code:
<!--
// == This script Free To Use Providing This Notice Remains == //                                                             
// == This script Has Been In The http://www.DesignerWiz.com Javascript Public Archive Library == //
// == NOTICE: Though This Material May Have Been In A Public Depository, Certain Author Copyright Restrictions May Apply == //
--><script language="Javascript" type="text/javascript">
<!-- Hide from old browsers
var i = 1;
banner1= new Image();
banner1.src = "http://i871.photobucket.com/albums/ab280/RaineTensai/Temp/Untitled-2.jpg";
banner2 = new Image();
banner2.src = "http://www.google.com/logos/worldcupopen10-hp.gif"; //you may add as many as needed
links = new Array
links[1] = "http://www.Yaoiverse.com"
links[2] = "http://www.google.com" //be sure to ad numbers consecutively
description = new Array
description[1] = "Yaoiverse Home"
description[2] = "Google" //be sure to ad message numbers consecutively
function startTime(){
var time= new Date();
hours= time.getHours();
mins= time.getMinutes();
secs= time.getSeconds();
closeTime=hours*3600+mins*60+secs;
closeTime+=15;  // How many seconds until the next banner rotation
Timer();
}
function Timer(){
var time= new Date();
hours= time.getHours();
mins= time.getMinutes();
secs= time.getSeconds();
curTime=hours*3600+mins*60+secs
if (curTime>=closeTime){
if (i < 2){  // The number 2 is the amount of banners that you have above - adjust accordingly
i++;
document.banner.src = eval("banner" + i + ".src");
}
else{
i = 1;
document.banner.src = eval("banner" + i + ".src");
}
startTime();
}
else{
window.setTimeout("Timer()",1000)}
}
function clickLink(){
top.location = links[i]
}
function descript(){
window.status = description[i]
}
// -->
</script>


<center>
<body onLoad="startTime();">
<a href="" onClick="clickLink(); return false;" onMouseOver="descript(); return true;" onMouseOut="window.status=''"><img src="http://i871.photobucket.com/albums/ab280/RaineTensai/Temp/Untitled-2.jpg" border=0 name="banner"></a>
</center>

RoNo
Active Poster

Male Posts : 1270
Reputation : 135
Language : English
Location : Laguna Beach, California

http://bf2mercenaries.forumotion.com/

Back to top Go down

Re: Javascript issue with ad banner rotator

Post by Raine Tensai on June 12th 2010, 2:40 pm

No, banner 1 is linked to "http://www.yaoiverse.com" which is actually just a 404 error page at the moment because I haven't put anything up yet, but instead, when I click on banner 1 it takes me back to my forum. Just now I tried changing links[1] to www.myspace.com and it STILL takes me back to the forum. Mad I don't see any errors in the code, so I don't get it!

Thanks for the help though, I appreciate you taking the time, and yes, banner 2 is working now, though I changed nothing, and it definitely wasn't working before.

Any clue how to get it to show on all pages and not just the homepage?

Raine Tensai
New Member

Female Posts : 8
Reputation : 0
Language : English
Location : New York

http://yaoiverse.lovediscussion.net/index.htm

Back to top Go down

Re: Javascript issue with ad banner rotator

Post by Raine Tensai on June 26th 2010, 6:43 pm

Okay, I found a code that appears to work. Now I still need to know how to get it to show on all pages not just the homepage. Thanks in advance.

Raine Tensai
New Member

Female Posts : 8
Reputation : 0
Language : English
Location : New York

http://yaoiverse.lovediscussion.net/index.htm

Back to top Go down

View previous topic View next topic Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum