Post by SubDevo on May 16, 2009 12:47:25 GMT -8
Customize "Modify Profile" Combo by SubDevo
Tested in IE, FF, Opera and Safari.
Ok everyone, I decided to write this code after seeing all the many "one line" codes out there to disable certain options on the "Modify Profile" page. Why use multiple codes, when you can accomplish the same thing with one code?
This code allows you to disable any single option, multiple options or completely disable profile modifications for either all members or individual members! Staff still has full access to all options. You can also limit your staff's powers by disabling certain staff only options in the "Modify Profile" page! Read on!
First, here is the code:
Location: Main Footer
<script type="text/javascript">
/* Customize "Modify Profile" Combo By SubDevo */
/* Main Footer - Please leave this header intact. Do not repost. */
/* interoceandesigns.com or lsdp.proboards.com */
var disOption=[]; // DO NOT EDIT THIS LINE
var forumStaff=/^(admin|staffname)$/i; // Forum staff user names.
var allUsers=["DISABLED OPTION"]; // Disabled Options for ALL Members.
disOption[0]=["USERNAME","DISABLED OPTION"]; // Per Member Disabled Options.
function killOption(nOpt,n){
if(nOpt[n]=="alloptions"){document.getElementsByName("profileaction")[0].style.display="none";}
else{
for(x=n;x<nOpt.length;x++){ var nc=document.getElementsByName(nOpt[x])[0];
if(nc){nc.parentNode.parentNode.parentNode.style.display="none";}
}}}
if(document.modifyForm){ var i=0;
if(allUsers[0]&& !pb_username.match(forumStaff)){killOption(allUsers,0);}
while(i<disOption.length){
if(disOption[0]&&pb_username==disOption[0]){killOption(disOption,1);}i++;
}}
</script>
Instructions:
Edit the portions in Maroon.
var forumStaff=/^(admin|staffname)$/i; // Forum staff user names.
Any names listed here, will always see all options on the "Modify Profile" page.
(This does NOT give you the power to MODIFY if you haven't been given this power from your admin). Separate the staff names (NOT display names) with a "|". Do not put anything after the last name!
These options will be disabled for all users except for staff.
disOption[0]=["USERNAME","DISABLED OPTION"]; // Per User Disabled Options.
These disable options on a per user basis. Put the user name (NOT display name) in first. Then the options you would like to disable following the user name. These are in addition to disabled options for "All Users".
Add more users to the list, using the following format:
disOption[0]=["USERNAME","DISABLED OPTION"]; // Per User Disabled Options.
disOption[1]=["USERNAME","DISABLED OPTION"];
disOption[2]=["USERNAME","DISABLED OPTION"];
disOption[3]=["USERNAME","DISABLED OPTION"];
Attention Administrators!
Let's say you have a global moderator who has the power to modify member profiles. And this GMOD has a bad habit of changing user's karma. Just put the "bad" GMOD user name in "forumstaff" AND ALSO put their user name in the "normal" user list and disable karma! Problem solved! ;D
Only karma, in this case, is disabled. All other options are still available, since user is forumstaff.
Enjoy!
SubDevo
Tested in IE, FF, Opera and Safari.
Ok everyone, I decided to write this code after seeing all the many "one line" codes out there to disable certain options on the "Modify Profile" page. Why use multiple codes, when you can accomplish the same thing with one code?
This code allows you to disable any single option, multiple options or completely disable profile modifications for either all members or individual members! Staff still has full access to all options. You can also limit your staff's powers by disabling certain staff only options in the "Modify Profile" page! Read on!
First, here is the code:
Location: Main Footer
<script type="text/javascript">
/* Customize "Modify Profile" Combo By SubDevo */
/* Main Footer - Please leave this header intact. Do not repost. */
/* interoceandesigns.com or lsdp.proboards.com */
var disOption=[]; // DO NOT EDIT THIS LINE
var forumStaff=/^(admin|staffname)$/i; // Forum staff user names.
var allUsers=["DISABLED OPTION"]; // Disabled Options for ALL Members.
disOption[0]=["USERNAME","DISABLED OPTION"]; // Per Member Disabled Options.
function killOption(nOpt,n){
if(nOpt[n]=="alloptions"){document.getElementsByName("profileaction")[0].style.display="none";}
else{
for(x=n;x<nOpt.length;x++){ var nc=document.getElementsByName(nOpt[x])[0];
if(nc){nc.parentNode.parentNode.parentNode.style.display="none";}
}}}
if(document.modifyForm){ var i=0;
if(allUsers[0]&& !pb_username.match(forumStaff)){killOption(allUsers,0);}
while(i<disOption.length){
if(disOption[0]&&pb_username==disOption[0]){killOption(disOption,1);}i++;
}}
</script>
Instructions:
Edit the portions in Maroon.
var forumStaff=/^(admin|staffname)$/i; // Forum staff user names.
Any names listed here, will always see all options on the "Modify Profile" page.
(This does NOT give you the power to MODIFY if you haven't been given this power from your admin). Separate the staff names (NOT display names) with a "|". Do not put anything after the last name!
var allUsers=["DISABLED OPTION","DISABLED OPTION"]; // Disabled Options for ALL Users.All of the following options must be surrounded with Quotes and separated with a comma. Do not put a comma after the last option.
All usernames and option names must be lowercase.
Replace "DISABLED OPTION" with the corresponding value from the table following these instructions.
These options will be disabled for all users except for staff.
disOption[0]=["USERNAME","DISABLED OPTION"]; // Per User Disabled Options.
These disable options on a per user basis. Put the user name (NOT display name) in first. Then the options you would like to disable following the user name. These are in addition to disabled options for "All Users".
Add more users to the list, using the following format:
disOption[0]=["USERNAME","DISABLED OPTION"]; // Per User Disabled Options.
disOption[1]=["USERNAME","DISABLED OPTION"];
disOption[2]=["USERNAME","DISABLED OPTION"];
disOption[3]=["USERNAME","DISABLED OPTION"];
If you wish to completely disable ANY profile modification, simply replace the first "DISABLED OPTION" with "alloptions". (Lower Case)
This will remove the "Modify" button on the "Modify Profile" page.
Example:
var allUsers=["alloptions","DISABLED OPTION"]; // Disabled Options for ALL Users.
disOption[0]=["USERNAME","alloptions"]; // Per User Disabled Options.
OPTION TO DISABLE | DISABLED OPTION |
Password: Password (again): Email Address: Display Name: Gender: Hide Gender: Location: Web Site Name: Web Site URL: Avatar: Avatar URL: Avatar Width: Avatar Height: Personal Text: Signature: User Notes: AIM: ICQ: YIM: MSN: Show Age: Hide Email: Mass Emails: Stay Invisible: Show Signatures: Show Avatars: Show Images: Select Skin: Expand Sub-Boards: Hide Sub-Boards: Time Format: Date Format: Month Format: Time Zone: Currently Observing DST: | password password2 name gender hidesex location websitename websiteurl avatar avatarurl avatarwidth avatarheight personaltext signature usernotes aim icq yim msn showage hideemail disablemassemail invisible showsigs showavatars showimages skin combinesubs hidesubs timeformat dateformat monthformat timezone summertime |
Attention Administrators!
Let's say you have a global moderator who has the power to modify member profiles. And this GMOD has a bad habit of changing user's karma. Just put the "bad" GMOD user name in "forumstaff" AND ALSO put their user name in the "normal" user list and disable karma! Problem solved! ;D
Only karma, in this case, is disabled. All other options are still available, since user is forumstaff.
Example:You may also limit other powers according to the following table:
var forumStaff=/^(admin|BAD GMOD)$/i; // Forum staff user names.
disOption[0]=["BAD GMOD","karma"]; // Per User Disabled Options.
OPTION TO DISABLE | DISABLED OPTION |
Member Group: Custom Title: Warning Level: Warning Notes: Posts: Karma: Disable Account: Disable For: Account Notes: | membergroup customtitle warninglevel warningnote posts karma accountenabled disableaccountdays notes |
Enjoy!
SubDevo