1 Script for a random banner with 3 images [phpBB2] 31/1/2010, 23:27
The templates are now crushed, so we have to host the script in HTML page as follows :
AP >> Modules >> HTML >> HTML pages management > Create new HTML page >
Title : banner_random >> No and No to the rest.
Copy-paste this script :
Now let's go in the templates > AP >> Desplay >> Templates >> General > overall_header_new and place before the tag "/head" the recall of script in the HTML page, like this :
Last step, in the same template search (Ctrl+F) for :
> save > publish
In the AP >> Desplay >> Homepage >> Headers & Navigation > Page headers > Logo positioning :
Make sure that the logo is in the same place as in the template.
AP >> Modules >> HTML >> HTML pages management > Create new HTML page >
Title : banner_random >> No and No to the rest.
Copy-paste this script :
- Spoiler:
- Code:
var nbimage= 30;
var width;
var height;
var url;
var alte;
function banniere()
{
numimage= Math.round(Math.random()*(nbimage-1)+1);
if (numimage <= 10)
{
gotosite = "http://url_site_page";
url = "image1.gif";
alte = "image 1";
}
if (numimage > 10 && numimage <= 20)
{
gotosite = "http://url_site_page";
url = "image2.gif";
alte = "image2";
}
if (numimage > 20)
{
gotosite = "http://url_site_page";
url = "image3.gif";
alte = "timage3";
}
if(gotosite != "")
{
document.write ('<A HREF="' + gotosite + '">');
}
document.write('<IMG SRC="' + url + '" ALT="' + alte + '" BORDER=0>')
if(gotosite != "")
{
document.write('</A>')
}
}
Now let's go in the templates > AP >> Desplay >> Templates >> General > overall_header_new and place before the tag "/head" the recall of script in the HTML page, like this :
- Code:
<script language="javascript" src="script-html_page_url"></script>
Last step, in the same template search (Ctrl+F) for :
- Code:
<!-- BEGIN switch_logo_center -->
<td align="center" width="100%" valign="middle">
<a href="{U_INDEX}"><img src="{LOGO}" id="i_logo" border="0" alt="{L_INDEX}" vspace="1" />
- Code:
<!-- BEGIN switch_logo_center -->
<td align="center" width="100%" valign="middle">
<a href="{U_INDEX}"><script language="javascript">banniere();</script>
> save > publish
In the AP >> Desplay >> Homepage >> Headers & Navigation > Page headers > Logo positioning :
Make sure that the logo is in the same place as in the template.