Ross
eCreations Staff
Posts: 1,768
|
Post by Ross on Sept 15, 2006 8:56:30 GMT
Main Footer
What this code does is that it will show extra member groups (like X staff online) in the info center. Edit/repeat the bold (being careful of the commas) for each member group to add. The number refers to the group ID.
<script type="text/javascript"> <!-- /* Extra Member Groups in Info Center - ross */
var groups = [ [3, 'Group Name'], [5, 'Group Name'] // No Comma on Last Line ];
if(location.href.match(/\.com\/?(index.cgi)?\??(&?action=home)?(#\w+)?$/)) { var table = document.getElementsByTagName('table'); for(i=table.length-1; i>-1; i--) { if(table.item(i).width == '98%' && table.item(i).cellPadding == '3' && table.item(i).innerHTML.match(/(, |>)(\d+) Members?,/i)) { var total_members = parseInt(RegExp.$2); var target = table.item(i).getElementsByTagName('font').item(0); var links = table.item(i).getElementsByTagName('a'); for(g=0; g<groups.length; g++) { var users_online = 0; for(l=0; l<links.length; l++) { if(links.item(l).className.match(new RegExp('group' + groups[g][0]))) { users_online++; total_members--; } } if(users_online != 1) { groups[g][1] += 's'; } target.innerHTML = target.innerHTML.replace(/(, |>)(\d+) Member(s)?,/, '$1' + users_online + ' ' + groups[g][1] + ', ' + total_members + ' Member$3,'); } } } } //--> </script>
|
|