Post by Smangii on Apr 19, 2007 21:54:44 GMT -5
SI Random Affiliate table version 1
Live Preview
Goes in any header or footers. The HTML is editable, as long as you keep the same ID names.
- Display as many affiliates as you want
- No Repeating
- Option to "Show All Affiliates"
HTML Code:
BOLDED parts are some things you might want to edit.
Javascript Code (shortened version):
Javascript Code (long version):
Live Preview
Goes in any header or footers. The HTML is editable, as long as you keep the same ID names.
- Display as many affiliates as you want
- No Repeating
- Option to "Show All Affiliates"
HTML Code:
BOLDED parts are some things you might want to edit.
<table cellspacing="1" cellpadding="4" class="bordercolor" width="92%">
<tr>
<td class="titlebg">Affiliates <a href="javascript: hideshow('atable')">(Show All)</a></td>
</tr>
<tr>
<td class="windowbg">
<div id="artable" align="center"></div>
<div id="atable" align="center" style="display: none;"></div>
</td>
</tr>
</table>
Javascript Code (shortened version):
<script type="text/javascript">
<!--
/*
si.Random Affiliate Table v1 - By Smangii
http://smangii.proboards78.com
Do Not Repost or Remove This Header
*/
// Edit how many affiliates you want shown by default
var show = 5;
// Insert your affiliates below
var affiliates = [
['URL OF FORUM','URL OF IMAGE'],
['URL OF FORUM','URL OF IMAGE'],
['URL OF FORUM','URL OF IMAGE'],
['URL OF FORUM','URL OF IMAGE'],
['URL OF FORUM','URL OF IMAGE'],
];
// Do Not Edit Below
document.write('<script type="text/javascript" src="http://smangii.ifastnet.com/codes/sirandomaffs.js"></scr'+'ipt>');
//-->
</script>
Javascript Code (long version):
<script type="text/javascript">
<!--
/*
si.Random Affiliate Table v1 - By Smangii
http://smangii.proboards78.com
Do Not Repost or Remove This Header
*/
// Edit how many affiliates you want shown by default
var show = 5;
// Insert your affiliates below
var affiliates = [
['URL OF FORUM','URL OF IMAGE'],
['URL OF FORUM','URL OF IMAGE'],
['URL OF FORUM','URL OF IMAGE'],
['URL OF FORUM','URL OF IMAGE'],
['URL OF FORUM','URL OF IMAGE'],
];
// Do Not Edit Below
for(a=0;a<affiliates.length;a++){
document.getElementById("atable").innerHTML += '<a href="'+affiliates[a][0]+'"><img src="'+affiliates[a][1]+'" border="0"></a> ';
}
for(i=0;i<show;i++){
var randNumber = Math.floor(Math.random()*affiliates.length);
document.getElementById("artable").innerHTML += '<a href="'+affiliates[randNumber][0]+'"><img src="'+affiliates[randNumber][1]+'" border="0" /></a> ';
affiliates.splice(randNumber, 1);
}
function hideshow(id){
if(document.getElementById(id).style.display==""){
document.getElementById(id).style.display="none";
} else { document.getElementById(id).style.display="";
}
}
//-->
</script>