|
Post by Bradley on Sept 2, 2005 15:18:37 GMT -5
Live Preview: ccwtest123.proboards29.com/index.cgi?board=unlranaff<script type="text/javascript"> <!--
var affilates = [ ['http://tommyhuynh.net/ggdaffiliate.gif', 'http://swg.proboards4.com/'], ['SOME IMAGE URL', 'SOME FOURM URL'] ]
var random; var toReturn; function getRandomAff(){ if (affilates.length >= 1){ random = Math.floor(Math.random() * (affilates.length)) toReturn = "<a href=\""+affilates[random][1]+"\"><img src=\""+affilates[random][0]+"\" border=\"0\" /></a>"; affilates.splice(random, 1); return toReturn; } else { return "ERROR! Not enough affialtes!"; } } //--> </script>The URL to an affilate's imageThe URL to an affilate's forum/stieTo add more affialtes add another one of these lines: ['http://tommyhuynh.net/ggdaffiliate.gif', 'http://swg.proboards4.com/'],IMPORTANT NOTES: Make sure that all of the above type of lines end in a comma EXCEPT the last one. The code to write out affialtes must be after the main code. Use this to write out an affialte: <script>document.write(getRandomAff());</script>You can use this to write out two next to each other <script>document.write(getRandomAff()+getRandomAff());</script>You can use this to write out two next one above the other <script>document.write(getRandomAff()+"<br />"+getRandomAff());</script>
|
|