Post by SubDevo on May 12, 2010 21:29:04 GMT -8
Reorder Member Group List by SubDevo
Tested in IE, FF, Opera, Safari and Chrome.
This was done as a request. Maybe you will find it useful.
This code does not alphabetize.
This code allows you to change the order of your member group list in the dropdown on the "Modify Profile", "Member Search" and "Modify Group" pages, to whatever order you wish.
This code will put the ID's in the order you specify and then, for the ones you leave out, it just puts them at the bottom of the jump under the "sorted" ID's.
Enjoy!!!
SubDevo
Only one line to edit:
var groupIDs=[1,2,3,4]; // Group ID's
Enter your group ID's in the order you wish for them to appear in the dropdowns.
Separate two or more ID's with a comma.
DO NOT put a comma after the last ID in the list!
How do I find my Group ID's?
If you are the main admin of your site, just go to the admin panel.
Click "Modify Group" in the "Member Groups" section.
The ID's will be listed in the dropdown on that page.
OR
If you are a mod with power to set "Member Group" on the "Modify Profile" page, go to a "Modify Profile" page.
Then copy/paste the following line of code into your address bar and hit ENTER.
javascript:var n=document.getElementsByName("membergroup")[0].options;var b="";for(x=2;x<n.length;x++){b+=n[x].value+" = "+n[x].text+"\n";}alert(b);
You will get an alert box with a list of all your member groups and IDs.
Location: Global Footer
<script type="text/javascript">
/* Reorder Member Group List by SubDevo */
/* Global Footer - Please leave this header intact. Do not repost. */
/* interoceandesigns.com or lsdp.proboards.com */
var groupIDs=[1,2,3,4]; // Group ID's
function rmg(){var loc=location.href,mf=document.modifyForm,ns,a,d,ng,n=[],m=[],b=-1;
if(loc.indexOf("=searchmembers")!=-1){a=document.getElementsByName("group")[0];}
else if(loc.indexOf("=membergroupmodify")!=-1){a=document.getElementsByName("id")[0];}
else if(mf&&mf.membergroup){ a=mf.membergroup;b=1;}
if(a){ ng=new RegExp("^("+groupIDs.toString().replace(/,/g,"|")+")$");i=-1;
while(groupIDs[++i]){ x=b;
while(a.options[++x]){d=a.options[x];
if(d.selected){ns=d.text;}
if(d.value==groupIDs){n.push([d.text,d.value]);}
}} x=b;
while(a.options[++x]){d=a.options[x];
if(!(ng).test(d.value)){m.push([d.text,d.value]);}
} n=n.concat(m);x=-1;
while(n[++x]){d=a.options[x+b+1];
d.text=n[x][0]; d.value=n[x][1]; if(d.text==ns){d.selected=true;}
}}} rmg();
</script>
Tested in IE, FF, Opera, Safari and Chrome.
This was done as a request. Maybe you will find it useful.
This code does not alphabetize.
This code allows you to change the order of your member group list in the dropdown on the "Modify Profile", "Member Search" and "Modify Group" pages, to whatever order you wish.
This code will put the ID's in the order you specify and then, for the ones you leave out, it just puts them at the bottom of the jump under the "sorted" ID's.
Enjoy!!!
SubDevo
Only one line to edit:
var groupIDs=[1,2,3,4]; // Group ID's
Enter your group ID's in the order you wish for them to appear in the dropdowns.
Separate two or more ID's with a comma.
DO NOT put a comma after the last ID in the list!
How do I find my Group ID's?
If you are the main admin of your site, just go to the admin panel.
Click "Modify Group" in the "Member Groups" section.
The ID's will be listed in the dropdown on that page.
OR
If you are a mod with power to set "Member Group" on the "Modify Profile" page, go to a "Modify Profile" page.
Then copy/paste the following line of code into your address bar and hit ENTER.
javascript:var n=document.getElementsByName("membergroup")[0].options;var b="";for(x=2;x<n.length;x++){b+=n[x].value+" = "+n[x].text+"\n";}alert(b);
You will get an alert box with a list of all your member groups and IDs.
Location: Global Footer
<script type="text/javascript">
/* Reorder Member Group List by SubDevo */
/* Global Footer - Please leave this header intact. Do not repost. */
/* interoceandesigns.com or lsdp.proboards.com */
var groupIDs=[1,2,3,4]; // Group ID's
function rmg(){var loc=location.href,mf=document.modifyForm,ns,a,d,ng,n=[],m=[],b=-1;
if(loc.indexOf("=searchmembers")!=-1){a=document.getElementsByName("group")[0];}
else if(loc.indexOf("=membergroupmodify")!=-1){a=document.getElementsByName("id")[0];}
else if(mf&&mf.membergroup){ a=mf.membergroup;b=1;}
if(a){ ng=new RegExp("^("+groupIDs.toString().replace(/,/g,"|")+")$");i=-1;
while(groupIDs[++i]){ x=b;
while(a.options[++x]){d=a.options[x];
if(d.selected){ns=d.text;}
if(d.value==groupIDs){n.push([d.text,d.value]);}
}} x=b;
while(a.options[++x]){d=a.options[x];
if(!(ng).test(d.value)){m.push([d.text,d.value]);}
} n=n.concat(m);x=-1;
while(n[++x]){d=a.options[x+b+1];
d.text=n[x][0]; d.value=n[x][1]; if(d.text==ns){d.selected=true;}
}}} rmg();
</script>