SMF Support > SMF 1.1.x Support

How to tell if someone's a moderator WITHOUT an extra db hit?

(1/2) > >>

nietzsche:
I'd like to make a link (under menu_template() in index.php - that's SLICK, BTW) that only admins and moderators can see.

However, the problem I'm running into is this:  a moderator is a normal user, as there is no "moderator" usergroup (that I'm aware of).

Right now, this is what I've got:

--- Quote ---   // Petfish email login (mods and admins only)
        if ( ($context['user']['is_admin']) or ($context['user']['is_moderator']) )
        {
            echo $context['menu_separator'] . '<a href=http://petfish.net/squirrelmail/src/login.php>Check your petfish email</a>';
        }
--- End quote ---
the $context['user']['is_moderator'] is a shot in the dark ...

UPDATE:  I've just noticed something:  it does work, but only after the moderator visits a board that they are a mod on.  So - is that flag set per-board, then?  I ask this because admins can see that menu item the whole time.

nietzsche:
Yeah.  I think this is EXACTLY what's going on.

Okay, so is there any way to look at a person's status from the home page before they check out a board?

[Unknown]:
A moderator is only a moderator of the board they moderate.  They are not moderators of other boards, or the entire forum. If you want, you can create a group for moderators and stick your moderators in that group.... then check if they are in that group.

Please post future support requests in the Charter Member only boards until public release.

-[Unknown]

pulpitfire:
muhuhuaha...so there's a menu template option in index.php.   8)

why don't those guys show as charter members?

[Unknown]:
Hmm... this is interesting.  I'm too tired for this.

-[Unknown]

Navigation

[0] Message Index

[#] Next page

Go to full version