Customizing SMF > SMF Coding Discussion
Looking for $context['user'] information
Norty:
Thanks guys. I will test this tonight.
Norty:
I am using SMF 1.1.14
$context['user']['is_mod'] does not return true for Global Moderator.
Array
(
[id] => 2
[is_logged] => 1
[is_guest] =>
[is_admin] =>
[is_mod] =>
.....
Kindred:
global moderators are not "moderators" in the proper sense.
A moderator is a special "group" which is not assigned in the usual way. Moderators are only assigned in the BOARD settings (and on a per-board basis) are are only moderators in that board. Even admins should not flag the "is_mod" setting unless they are also marked as a moderator in that board.
You would have to check if the user's groups contain the global mod group ID.
Norty:
Thanks Kindred.
I was looking for a shortcut :-[
The security model works perfectly if an admin explicitly adds the fine-grained control to authorised groups.
One extra group (Global Mods) isn't going to be the end of the world.
iMav:
I'm trying to use this context in my Display.template.php file. Basically, I want to display "Thread Starter" verbage under the avatar of the user that has started the thread. I am using the context as follows:
--- Code: --- if ($context['user']['started'])
echo '
<li class="threadstarter">
<b>', $txt['thread_starter'], '</b>
</li>';
--- End code ---
Unfortunately, it does not seem to identify any user...included the desired target of the thread starter. If I negate the if, the desired text will show up for everybody...including the thread starter.
I'm at a loss...
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version