I have the following JavaScript in my overall_header.tpl on my phpBB board to simply rotate two of my sponsor’s banners, and more if required. Everything works, but what I also want is some text under the banner with the company’s name, hyperlinked that changes when a new banner is displayed? Is it fontface= or something? I can't remember.
Any help would be great.
PHP Code:
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
var how_many_ads = 2;
var now = new Date()
var sec = now.getSeconds()
var ad = sec % how_many_ads;
ad +=1;
if (ad==1) {
url="http://www.mydomain.com";
alt="Advertise with Company Name";
banner="http://mydomain.com/images/ads/advertise.jpg";
width="466";
height="60";
}
if (ad==2) {
url="http://www.mydomain.com";
alt="Advertise with Company Name";
banner="http://mydomain.com/images/ads/advertise.jpg";
width="466";
height="60";
}
document.write('<center>');
document.write('<a href=\"' + url + '\" target=\"_top\">');
document.write('<img src=\"' + banner + '\" width=')
document.write(width + ' height=' + height + ' ');
document.write('alt=\"' + alt + '\" border=0><br>');
document.write('<small>' + txt + '</small></a>');
document.write('</center>');
// End -->
</SCRIPT>
Last edited by J.C; 03-21-2007 at 12:57 PM..
|