Former Member
inherit
guest@proboards.com
131621
0
Nov 26, 2024 13:32:19 GMT -8
Former Member
0
January 1970
Former Member
|
Post by Former Member on Feb 10, 2014 4:18:45 GMT -8
Alright so I figured out the code to remove a user's ability to change their display group in Edit Profile > Settings. However, I can't figure out how to remove the description ("Select which group you want displayed in your profile."), it can be bypassed if they disable javascript, and it removes it for everyone not just regular members, also staff. So rather than post in one of the libraries, I figured I'd put it here and see if anyone wants to contribute to fix some of its shortcomings
Remove the title-- put this in Global Header
<script type="text/javascript"> $(document).ready(function(){ if(proboards.data('route').name == "edit_user_settings") { $('.container.edit-user label').each(function(){ if($(this).text().indexOf('Display Group') != -1) { $(this).prev().hide(); $(this).hide(); }});}}); </script>
Remove the drop down box-- put this in Edit User Profile layout template
<script type="text/javascript"> $(document).ready(function(){ if(proboards.data('route').name == "edit_user_settings"){
$('.display-group-id').css('display','none');
} }); </script>
|
|
inherit
The Dream Crusher (Ret.)
164921
0
Apr 1, 2014 11:00:25 GMT -8
Tim Camara
Teach a man to fish, etc., etc.
1,721
March 2011
tcamara
|
Post by Tim Camara on Feb 10, 2014 9:52:05 GMT -8
This is a little more succinct way of doing it (and also allows staff to still edit their group):
<script type="text/javascript"> $(document).ready(function(){ if(pb.data('route').name == "edit_user_settings" && pb.data('user').is_staff == 0) { $('.display-group-id').hide() // Hides select menu .prev().hide() // Hides description .prev().hide() // Hides title .prev().hide().prev().hide();// Hides <br /> tags } }); </script>
|
|
Former Member
inherit
guest@proboards.com
131621
0
Nov 26, 2024 13:32:19 GMT -8
Former Member
0
January 1970
Former Member
|
Post by Former Member on Feb 10, 2014 14:40:26 GMT -8
This is a little more succinct way of doing it (and also allows staff to still edit their group): <script type="text/javascript"> $(document).ready(function(){ if(pb.data('route').name == "edit_user_settings" && pb.data('user').is_staff == 0) { $('.display-group-id').hide() // Hides select menu .prev().hide() // Hides description .prev().hide() // Hides title .prev().hide().prev().hide();// Hides <br /> tags } }); </script> Thank you! Much appreciated!
|
|
Former Member
inherit
guest@proboards.com
131621
0
Nov 26, 2024 13:32:19 GMT -8
Former Member
0
January 1970
Former Member
|
Post by Former Member on Apr 17, 2014 19:34:03 GMT -8
Hey Tim Camara, would there be a way to do this to remove the ability for users to pick and choose what gives them notifications? We rely heavily on tagging to alert people and it's mandatory per our rules, so if possible I'd like to ensure no one turns off that notification, so I figured removing it is the only way possible.
|
|
inherit
The Dream Crusher (Ret.)
164921
0
Apr 1, 2014 11:00:25 GMT -8
Tim Camara
Teach a man to fish, etc., etc.
1,721
March 2011
tcamara
|
Post by Tim Camara on Apr 18, 2014 8:07:00 GMT -8
<script type="text/javascript"> $(document).ready(function(){ if(pb.data('route').name == "edit_user_notifications" && pb.data('user').is_staff == 0) { $('input[name="tags"]').attr('disabled', 'disabled'); } }); </script> Will disable the checkbox, while leaving it in place so the page is more visually pleasing. If you just want it removed, replace .attr('disabled', 'disabled') with .remove().
|
|
Former Member
inherit
guest@proboards.com
131621
0
Nov 26, 2024 13:32:19 GMT -8
Former Member
0
January 1970
Former Member
|
Post by Former Member on Apr 18, 2014 10:36:57 GMT -8
Thank you very much, I really appreciate the help, I wouldn't have known where to even start with it.
|
|
Former Member
inherit
guest@proboards.com
131621
0
Nov 26, 2024 13:32:19 GMT -8
Former Member
0
January 1970
Former Member
|
Post by Former Member on Apr 18, 2014 13:24:53 GMT -8
I might be a dunce but it doesn't appear to be working. I put it first in the Edit User Profile layout template and it didn't work, so then I tried the global header. At least, when I go to edit my profile > notifications and uncheck the box, it lets me, and then lets me save it, and then upon refreshing the page it is still unchecked. Did I do anything wrong? Somewhere else I should add it, perhaps, Tim Camara? I'm so sorry to be bothering you again when you're busy as heck with the forums.net and getting tagged all over
|
|
inherit
The Dream Crusher (Ret.)
164921
0
Apr 1, 2014 11:00:25 GMT -8
Tim Camara
Teach a man to fish, etc., etc.
1,721
March 2011
tcamara
|
Post by Tim Camara on Apr 18, 2014 15:09:29 GMT -8
Are you trying it as a staff member? There's an is_staff check on it (just like with the original code) so that it won't be enforced for staff members. Just remove the " && pb.data('user').is_staff == 0" if you want it for every member, staff or not.
|
|
Former Member
inherit
guest@proboards.com
131621
0
Nov 26, 2024 13:32:19 GMT -8
Former Member
0
January 1970
Former Member
|
Post by Former Member on Apr 18, 2014 15:19:27 GMT -8
Hah, shoulda figured. Thank you so much!
Working!
|
|
inherit
The Dream Crusher (Ret.)
164921
0
Apr 1, 2014 11:00:25 GMT -8
Tim Camara
Teach a man to fish, etc., etc.
1,721
March 2011
tcamara
|
Post by Tim Camara on Apr 18, 2014 15:22:48 GMT -8
No problem.
|
|