Go Back   Webmaster Forum > Development > Programming > JavaScript
REMOVE the ads below !
Reply
 
LinkBack Thread Tools
  # 1 (permalink)
Old
Junior Geek
Posts: 65
Join Date: Feb 2007
iTrader: (0)
Active groups legend - 10-19-2007

Written for IPB1.3 / invisionfree

well this is some sort of automated member legend,
you dont have to add in colors and groupnames,
they get all information they need from tags around the name of members of the group

go to manage usergroups and add in the prefix something like <span gname='Admin' style='color:red'>
and in the suffix something like </span>

this will add Admin (red text) to the member legend when theres an admin online

WARNING: the gname='groupname' must be in the first tag around the name of the groups members in order to work!

PREVIEW: http://img250.imageshack.us/img250/6983/ac...erlegenddy6.png

Quote:
Originally Posted by footers
<script>
/* Active Groups Legend (public version),
By Godkillah of:
z3.invisionfree.com/UG_Net & phantom-designs.net */
var groups=[];a=document.getElementsByTagName("td");
for(i=0;i<a.length;i++){if(a[i].innerHTML.match(/Show detailed list by:/i) && a[i].className=="row4" && a[i].width=='95%'){
aa=a[i].getElementsByTagName("div")[0].getElementsByTagName("a");
for(ii=0;ii<aa.length;ii++){if(aa[ii].firstChild.getAttribute("gname")!=null){
groups[aa[ii].firstChild.getAttribute("gname")]=aa[ii].innerHTML;name=aa[ii].innerHTML;
while(name.match(/>(?!<)(.+?)<\//i)){name=RegExp.$1;}
groups[aa[ii].firstChild.getAttribute("gname")]=groups[aa[ii].firstChild.getAttribute("gname")].split(name)[0]+aa[ii].firstChild.getAttribute("gname")+groups[aa[ii].firstChild.getAttribute("gname")].split(name)[1]
}}a[i].innerHTML=a[i].innerHTML.replace("Show detailed list by:","Active groups Legend: <span id='TehLegend' onclick='location.href=\"http://z3.invisionfree.com/UG_Net/index.php?act=idx\"'>[ None ]</span><hr>Show detailed list by:");t=0;
for(blah in groups){if(t==0){document.getElementById("TehLegen d").innerHTML="";t++;}
document.getElementById("TehLegend").innerHTML+="["+groups[blah]+"] ";}}}
</script>
it whas originally made as a custom code for the board of a friend of me, (z3.invisionfree.com/UG_Net/index.php)
as i liked it pretty much we came up with the idea to make this public version of it,
they're pretty much the same though

enjoy
Reply With Quote
Reply


Thread Tools



Advertise Here for just $6 per month

vBulletin®, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd. | SEO by vBSEO | Skin developed by vBStyles.com