Web Hosting Talk







View Full Version : Adding random HTML into a phpbb header? Please help a n00b out!


Z400Central
11-09-2002, 02:11 AM
Hello-
I want to add a random image rotator in my forums. Meaning, everyime you visit the forum, a different image (or banner in my case) loads each time...heres the codes, but I dont know where to instert it at. Thanks!

Script of the random generator:
script language="JavaScript">
<!--



<!--hide this script from non-javascript-enabled browsers

/* Functions that swaps images. */

/* Functions that handle preload. */

// stop hiding -->//-->
</script>

<script language="JavaScript">
<!--if (document.images)

function changeImages()
{
if (document.images)
{
for (var i=0; i<changeImages.arguments.length; i+=2)
{ document[changeImages.arguments[i]].src = eval(changeImages.arguments[i+1] + ".src");
}
}
}
// -->

imglist=new Array()

imglist[0] ="./splashimages/2002sep/01.jpg"
imglist[1] ="./splashimages/2002sep/02.jpg"



rndnum=Math.round(Math.random() * (2-0))+0
img=imglist[rndnum]


</script>







My phpbb header script:
<!-- DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" -->
<!-- <html xmlns="http://www.w3.org/1999/xhtml"> -->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset={S_CONTENT_ENCODING}">
<meta http-equiv="Content-Style-Type" content="text/css">
<title>{SITENAME} -- {PAGE_TITLE}</title>
<link rel="stylesheet" href="templates/MissionImpossible/MissionImpossible.css" type="text/css">
<!-- BEGIN switch_enable_pm_popup -->
<script language="Javascript" type="text/javascript">
<!--
var new_pm_flag = {PRIVATE_MESSAGE_NEW_FLAG};

if( new_pm_flag )
{
window.open('{U_PRIVATEMSGS_POPUP}', '_phpbbprivmsg', 'HEIGHT=225,resizable=yes,WIDTH=400');;
}
//-->
</script>
<!-- END switch_enable_pm_popup -->
<style>
TD.toprow
{
color: E6C2C2;
font-weight: bold;
height: 30px;
background-image: url(templates/MissionImpossible/images/_cellpic_red.gif);
}
TD.catrow
{
color: 272727;
font-weight: bold;
height: 23px;
background-image: url(templates/MissionImpossible/images/_cellpic_yellow.gif);
}

</style>
</head>
<BODY bgcolor=#373737 marginwidth="0" marginheight="0" topmargin="0" leftmargin="0" rightmargin="0">
{META} {NAV_LINKS}
<TABLE width="100%" border="0" cellspacing="0" cellpadding="0">
<TR>
<TD background="templates/MissionImpossible/images/_head_bg.gif" height="94" align="left" valign="top"><A href="http://www.z400central.com"><IMG src="templates/MissionImpossible/images/_head_logo.gif" width="500" height="260" border="0"></A></TD>
<TD background="templates/MissionImpossible/images/_head_bg.gif" height="94" align="center" valign="middle"><a href="http://www.quadshopatv.com"><IMG src="http://www.z400central.com/images/quadshop2.gif" border="0"></a></TD>
</TR>
<TR>
<TD align="right" bgcolor="2C2C2C" colspan="2"><IMG src="templates/MissionImpossible/images/_map_top.gif" width="406" height="24" hspace="5" usemap="#Map" border="0"></TD>
</TR>
<TR>
<TD bgcolor="2C2C2C" colspan="2">
<TABLE width="100%" border="0" cellspacing="0" cellpadding="10">
<TR>
<TD>




*****part in bold is the banner that is there now......Thank you soooooooo much!!!!!!!!!!!!!:)