Post by iAlex on Dec 19, 2007 17:10:31 GMT -5
This will place a roll-over user legend in your Info Centre.
Preview: Click
Main Footer.
Cross Browser.
Open Source.
<script type="text/javascript">
<!--
/*Info Center User Legend - By iAlex - Open Source*/
var iLegend=[
["Administrator", "FF0000"],
["Global Moderator", "00FF00"],
["Moderator", "0000FF"],
["Member", "FFFF00"] //No comma on last line
];
if(window.location.href.match(/action=home/) || !window.location.href.match(/action/) && !document.modifyForm && !document.postForm){
iLegHold='<div style="float: right; width: 200px;"><font size="1"><b>User Legend</b></font><table cellspacing="2"><tr>';
for(var a=0;a<iLegend.length;a++){
iLegHold+='<td bgcolor="'+iLegend[1]+'" height="14px" width="13px" style="cursor: pointer;" onmouseover="this.parentNode.parentNode.parentNode.previousSibling.firstChild.innerHTML=\'<font color='+iLegend[1]+'>'+iLegend[0]+'</font>\'" onmouseout="this.parentNode.parentNode.parentNode.previousSibling.firstChild.innerHTML=\'User Legend\'"></td>';
}
iLegHold+='</tr></table></div>';
var iLegSpan=document.createElement('span');
iLegSpan.innerHTML=iLegHold;
var iTd=document.getElementsByTagName('td');
var i=iTd.length;
while(--i){
if(iTd.item(i).className=="catbg" && iTd.item(i).colSpan=="2" && iTd.item(i).innerHTML.match(/>Users Online</)){
iTd.item(i+2).appendChild(iLegSpan);
break;
}
}
}
//-->
</script>
You simply need to edit the red text at the top of the code:
["Administrator", "FF0000"],
The text on the left is the group name, and the other is the colour that you wish that group box to be displayed in.
If you want more groups, just add more of this line:
["Group Name", "Group Colour"],
Preview: Click
Main Footer.
Cross Browser.
Open Source.
<script type="text/javascript">
<!--
/*Info Center User Legend - By iAlex - Open Source*/
var iLegend=[
["Administrator", "FF0000"],
["Global Moderator", "00FF00"],
["Moderator", "0000FF"],
["Member", "FFFF00"] //No comma on last line
];
if(window.location.href.match(/action=home/) || !window.location.href.match(/action/) && !document.modifyForm && !document.postForm){
iLegHold='<div style="float: right; width: 200px;"><font size="1"><b>User Legend</b></font><table cellspacing="2"><tr>';
for(var a=0;a<iLegend.length;a++){
iLegHold+='<td bgcolor="'+iLegend[1]+'" height="14px" width="13px" style="cursor: pointer;" onmouseover="this.parentNode.parentNode.parentNode.previousSibling.firstChild.innerHTML=\'<font color='+iLegend[1]+'>'+iLegend[0]+'</font>\'" onmouseout="this.parentNode.parentNode.parentNode.previousSibling.firstChild.innerHTML=\'User Legend\'"></td>';
}
iLegHold+='</tr></table></div>';
var iLegSpan=document.createElement('span');
iLegSpan.innerHTML=iLegHold;
var iTd=document.getElementsByTagName('td');
var i=iTd.length;
while(--i){
if(iTd.item(i).className=="catbg" && iTd.item(i).colSpan=="2" && iTd.item(i).innerHTML.match(/>Users Online</)){
iTd.item(i+2).appendChild(iLegSpan);
break;
}
}
}
//-->
</script>
You simply need to edit the red text at the top of the code:
["Administrator", "FF0000"],
The text on the left is the group name, and the other is the colour that you wish that group box to be displayed in.
If you want more groups, just add more of this line:
["Group Name", "Group Colour"],