inherit
123128
0
Feb 3, 2020 13:53:38 GMT -8
Malagrond
Remember, remember the 5th of November.
813
April 2008
malagrond
|
Post by Malagrond on Jun 14, 2009 16:53:49 GMT -8
Code Name: [CB] Filter Staff list Description:Allow your users to filter the staff list by group. (e.g. view only Administrators, or only Global Moderators) Preview: ClickMain Header <div id="staffBoxLol" align="center"></div>
Main Footer <script> <!-- /* Filter Staff List by Malagrond */
// Only edit this. To put them in order, you need the group ID. // Go to the Modify Groups page to find this. var groupsList = new Array("Administrators","Global Moderators","Moderators"); // In order of ID
// No need to edit below if(location.href.match(/action=members&view=staff/gi)){ var ssB = document.createElement("select"); ssB.id = "ssbBox"; ssB.options[0] = new Option("Filter Staff", "", true, false); for (var i=0;i<groupsList.length;i++){ ssB.options[i+1] = new Option(groupsList[i], "group"+(i+1), false, false); } document.getElementById("staffBoxLol").appendChild(ssB);
function filterStaffList(){ var allLinks = document.getElementsByTagName("a"); for(var i=0;i<allLinks.length;i++){ var mstr = ssB.options[ssB.selectedIndex].value; if(!allLinks[i].className.match(mstr) && allLinks[i].href.match(/viewprofile&user=/gi)){ allLinks[i].parentNode.parentNode.parentNode.style.display = "none"; } else if(allLinks[i].className.match(mstr) && allLinks[i].href.match(/viewprofile&user=/gi)) { allLinks[i].parentNode.parentNode.parentNode.style.display = ""; } } }
ssB.onchange = filterStaffList; } --> </script>
|
|