|
Post by Wormopolis on Sept 1, 2010 16:14:33 GMT -8
Browser Tested: IE and FF placement: Global Footer
Forces every member to have a specific avatar based on whatever group they are in. overrides whatever avatar they currently have picked, and adds in the avatar if they dont have one.
code:
<script type="text/javascript"> <!-- // Avatar forced by usergroup // v 1.1 // By Wormo - requested by anakins88 // keep header intact
var AVdefaultwidth=80; var AVdefaultheight=80; var replaceDefaultAv=true; //set false if you just want to add it below
var forceAvatarArray=new Array(); forceAvatarArray['group0']="http://i197.photobucket.com/albums/aa250/WORMOPOLIS/bug.jpg"; forceAvatarArray['group1']="http://i197.photobucket.com/albums/aa250/WORMOPOLIS/king.jpg"; forceAvatarArray['group3']="http://i197.photobucket.com/albums/aa250/WORMOPOLIS/convict.jpg"; // add more for each group you have
// no need to edit below unless you know what you are doing.
if (pb_action.match(/display|search2|viewprofile/)) { //MANLC approved for (tds=document.getElementsByTagName('td'), m=0; m<tds.length; m++) { uname=tds[m].getElementsByTagName('b')[0]; if (tds[m].width=='20%' && tds[m].className.match(/windowbg/) && uname && uname.getElementsByTagName('a')[0] && uname.getElementsByTagName('a')[0].className.match(/group/)) { groupid=uname.getElementsByTagName('a')[0].className; if (forceAvatarArray[groupid]) { if (!tds[m].getElementsByTagName('center')[0].firstChild.nodeName.match(/img/i)) { tds[m].getElementsByTagName('center')[0].insertBefore(document.createElement('img'), tds[m].getElementsByTagName('center')[0].firstChild); } Av=tds[m].getElementsByTagName('center')[0].getElementsByTagName('img')[0]; if (!replaceDefaultAv) { nwAv=document.createElement('img'); Av.parentNode.insertBefore(document.createElement('br'), Av.nextSibling); Av.parentNode.insertBefore(nwAv, Av.nextSibling); Av=nwAv; } Av.src=forceAvatarArray[groupid]; Av.height=AVdefaultheight; Av.width=AVdefaultwidth; } } } }
// --> </script>
Preview: just replaces avatar, use your imagination.
|
|
|
Post by Wormopolis on Mar 5, 2011 22:06:29 GMT -8
version update 1.1: new variable for replacing or adding additional
|
|