|
Post by Wormopolis on Dec 19, 2008 15:54:02 GMT -8
Browsers tested: IE and FF placement: Main Footer
Lets you hide a skin selection from the drop down menu under a user profile. Helpful if you dont want someone to see a skin until its ready.
<script type="text/javascript"> <!-- // hide skins from specific user - v2.0 // by Wormopolis - wormocodes.proboards.com // do not repost, keep header intact
var checkthem = [ ['test2',/^(3|4|5|9|10|6|11)$/], //seperate skinIDs by | ['ALL',/^(3|6)$/], ['fred',/^(1)$/], ['GROUP 1',/^(10|11|8)$/], ['james',/^(2|4|6)$/] //no comma ]; // use username, GROUP #, or ALL in first part of array elements. // second part of array element starts with /^( and ends with )$/ // seperate skinIDs by | for the same entry var excludeAdmin = true; //set true if you want admin to not be affected
// No need to edit below
// get usergroup lnks=document.getElementsByTagName('a'); rgx =new RegExp("user="+pb_username,'i'); for (l=0; l<lnks.length; l++) { if (lnks[l].href.match(/action=viewprofile/i) && lnks[l].href.match(rgx)) { document.cookie="pb_usergroup="+lnks[l].className; break; } }
if (location.href.match(/action=modifyprofile/i) && !(pb_username=='admin' && excludeAdmin)) { sel=document.getElementsByTagName('select'); for (a=0; a<sel.length; a++) { if (sel[a].name=='skin') { vict=sel[a]; break; } } ug=document.cookie.match(/pb_usergroup=group(\d+?)/) ? RegExp.$1 : '-1'; for (c=0;c<checkthem.length;c++) { if (pb_username==checkthem[c][0] || checkthem[c][0]=="ALL" || checkthem[c][0]==("GROUP "+ug)) { for (b=0; b<vict.options.length; b++) { murk=new RegExp(checkthem[c][1]); if (vict.options[b].value.match(murk)) { vict.remove(b); --b; } } } } }
// --> </script>
preview: self explanatory
|
|
|
Post by Wormopolis on Mar 12, 2009 8:54:50 GMT -8
Updated code to allow restriction based on a member's usergroup. uses cookie value to store group ID.
|
|
|
Post by Wormopolis on Apr 25, 2009 16:57:27 GMT -8
if using group id, you have to put "GROUP n" where n is the number. just putting the number doesnt work.
|
|