Ross
eCreations Staff
Posts: 1,768
|
Post by Ross on Aug 12, 2005 19:17:05 GMT
Global FooterThis will select a random avatar to display. <script type="text/javascript"> <!-- /* random avatars by elindir do not edit or redistribute without permission*/
var avatar=[ ["admin","av1","av2","av3"], ["user1","av1","av2","av3","av4"], ["user2","av1","av2"] ];
for (r=0;r<avatar.length;r++){ var td=document.getElementsByTagName('td'); for (m=0;m<td.length;m++) if (td[m].className.match(/window(bg|bg2)/i) && td[m].width=="20%" && td[m].innerHTML.match('user='+avatar[r][0])){ var img=td[m].getElementsByTagName('img'); for (j=0;j<img.length;j++) if(img[j].alt=="[avatar]"){ var a = Math.floor(Math.random()*avatar[r].length); if(a==0){a=1} img[j].src=avatar[r]; } } } //--> </script>Edit these lines: [" admin","av1" ,"av2" ,"av3"], The red is the members username. The "av1","av2" etc are the URLs of their avatars. There can use as many as they like. Make sure you do not leave any spaces inside the " quotes and that each avatar is seperated by a comma. Note, do not leave a hanging comma at the end of the last [ bracket. Look at how I've done it in the example (in orange)
|
|