Customizing SMF > SMF Coding Discussion

Local Time / Last Active Restricted to Admin Only

(1/1)

Dr. Horrible:
Apologies if this has already been asked repeatedly, but I was wondering if there was a way to restrict viewing of local time and last active status in the profile template for SMF 1.1.16 to administrator view only for specific usergroups?

I have presently hidden the local time for the administrator group from all other users, which works just fine. However, I've found that when I hide it for another usergroup, it hides it from the administrator as well as everyone else. Ideally, what I need is a way to hide the local time and last active status from all users with the exception of administrators. This is to protect the privacy of a selected usergroup, while also allowing administrators to keep track of users where necessary.

If anyone would be able to assist, I'd be very much obliged. I can provide a copy of the code that I used to hide the time if necessary, but I think it's been in common use for quite a while!

Many thanks.

Orangine:
I can help you with that

in your Profile.template.php find:

--- Code: ---   echo '
               <dt>', $txt['local_time'], ':</dt>
               <dd>', $context['member']['local_time'], '</dd>';
--- End code ---
and replace it with:

--- Code: ---   if ($context['user']['is_admin']){ echo '
               <dt>', $txt['local_time'], ':</dt>
               <dd>', $context['member']['local_time'], '</dd>';}
--- End code ---

Navigation

[0] Message Index

Go to full version