News:

Join the Facebook Fan Page.

Main Menu

if user is a global mod?

Started by kaamaru, February 17, 2010, 01:14:32 PM

Previous topic - Next topic

kaamaru

I am using the following code:
if($context['user']['is_admin'] || $context['user']['is_mod'])

echo '<h2>Topic Options</h2>
<div class="profile">
<div class="calumks2"><pcolour>
<div id="moderationbuttons">', template_button_strip($mod_buttons, 'bottom'), '</div>
<div class="nav floatleft">', template_button_strip($normal_buttons, 'top'), '</div></div></pcolour></div>';


This will not display to users who are a global mod. How can I get this to display to global mods too?

YogiBear

Hi Calumks,

Hmm, yes, I see why you want to do this but it strikes me there could be an easier way.

From the Global Moderator group, create similar groups eg. Global Moderator1, Global Moderator2, and so on.

The Global Mods would all appear in the Regular Members group but their powers given them by using Additional Membergroup. Thus Fred is Global Moderator1, Sue is Global Moderator2, and so on.

Make sure they cannot manage, and therefore see who's in what, membergroups in the permissions.

Would that solve it?
SMF v2.1.3  Mods : Snow & Garland v1.4,  PHP  v.7.4.33

Matthew K.

if ($context['user']['group_id'] == 2 || $context['user']['is_admin'])

kaamaru

Quote from: Labradoodle-360 on February 17, 2010, 01:30:33 PM
if ($context['user']['group_id'] == 2 || $context['user']['is_admin'])

This does not seem to work.

Nick Whetstone

Try...

global $user_settings;

if (in_array($user_settings['id_group'], array(1,2)))

echo '<h2>Topic Options</h2>
<div class="profile">
<div class="calumks2"><pcolour>
<div id="moderationbuttons">', template_button_strip($mod_buttons, 'bottom'), '</div>
<div class="nav floatleft">', template_button_strip($normal_buttons, 'top'), '</div></div></pcolour></div>';


The artist formerly known as (Ha)²

Former Support Specialist

Please do not solicit support via PM. Here's why!

kaamaru

#5
Thanks!

if (in_array($user_settings['id_group'], array(1,2)) || $context['user']['is_mod'])
{
echo '<h2>Topic Options</h2>
<div class="profile">
<div class="calumks2"><pcolour>
<div id="moderationbuttons">', template_button_strip($mod_buttons, 'bottom'), '</div>
<div class="nav floatleft">', template_button_strip($normal_buttons, 'top'), '</div></div></pcolour></div>';
}

Matthew K.

Marking topic as resolved, unless you have further questions?

Advertisement: