Archived Boards and Threads... > SMF Feedback and Discussion
How Can I Hide Info Center From MEMBERS?
Arantor:
Probably, but I need him to clarify since it changes how I write the code.
Labradoodle-360:
If you want it to be visible to only Admins, wrap the following context around the info center.
--- Code: ---if ($context['user']['is_logged'] && ['user']['group_id'] == 1){ INFO CENTER }
--- End code ---
That should be the proper context, not had to use something like that for quite a while now.
Labradoodle-360
Arantor:
if($context['user']['is_admin']) would be better.
Labradoodle-360:
Arantor - haha, very true. Got used to adding if global mod, etc. forgot about the context is_admin.
That's the better way to go definitely.
Arantor:
Don't forget that checking group_id is only good for their primary group.
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version