SMF Support > SMF 2.0.x Support

What is moderator link?

(1/4) > >>

Angelotus:
Hi, i'm rebuilding my website and want to add the moderator link, if the logged in person is a moderator (or admin)

For admin I use this code


--- Code: ---// Is the user allowed to administrate at all? ([admin])
   if ($context['allow_admin'])
      echo '<li><a href="', $scripturl, '?action=admin">administratie</a></li>';

--- End code ---

What code to use for the moderator link?

Angelotus:
Bumping this thread. Anyone familiar with this?

TiReDsOuL:

--- Quote from: Angelotus on July 09, 2008, 05:41:36 AM ---Hi, i'm rebuilding my website and want to add the moderator link, if the logged in person is a moderator (or admin)

For admin I use this code


--- Code: ---// Is the user allowed to administrate at all? ([admin])
   if ($context['allow_admin'])
      echo '<li><a href="', $scripturl, '?action=admin">administratie</a></li>';

--- End code ---

What code to use for the moderator link?

--- End quote ---

are u sure your website 2.x ?? that's admin code for 1.1.x :S

karlbenson:
$context['user']['is_admin']
$context['user']['is_mod'] OR allowedTo('moderate_forum')
I forget which one is per-board mods, and which is for global forum mods.

$context['user']['is_logged']
$context['user']['is_guest']

Angelotus:
I have tried to create such a link with:


--- Code: --- 
// Is the user allowed to moderate at all? ([mod])
   if ($context['user']['is_mod'])
      echo '<li><a href="', $scripturl, '?action=moderate">moderatie</a></li>';

--- End code ---

What is wrong?

But moderators can not see the link when logged in.

Navigation

[0] Message Index

[#] Next page

Go to full version