[GH#1825] Global Moderator to Local Moderator

Started by eric1234, June 13, 2014, 08:07:20 PM

Previous topic - Next topic

eric1234

Let's say that i got this particular member who is a global moderator and i wished to make him into local moderator of a particular board. However, i wish that his tag remain as 'global moderator' and got the GM's privilege.

In other word, i just want his name to be appeared at the bottom of the board's name, so that members know he is moderating that particular board.

Besides that, how can I add the word 'moderator' into the local moderator. So members able to see the word moderator and it is hyperlink to a page that shows a list of moderators. In other word, member able to click the word 'moderator' and it will open a new page where it shows a list of moderator.

br360

If you want the global moderator to show "moderated by:" in a specific board, go to Admin>>Forum>>Board>>Modify Boards.

Then go to the specific board, click the modify link of that board, and you will see a space that says "Moderators:". Just type in their name there.

To show a list of all of your moderators, admins, and other members groups go to Admin>>Configuration>>Current Theme. Where you see "Show group key on board index": Just check that and save changes.

Arantor

But that overrides the 'global moderator' group when in that board, which is what he doesn't want - and there's no way around that.

Instead, I'd suggest just putting his name in the board's description.

br360

I just tested it as admin and put my handle in the "moderated by" of a specific board, and have all my admin permissions still. So admin will still have all permissions, but a global mod will lose global permissions for that specific board?

Kindred

No, I don't believe so.

But he will lose his global admin badge.
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

br360

That's odd. I just created another account and made that account a global moderator. I then went to a specific board and put that global mod in as "moderated by"

Now logging in as that global mod, I have the exact same permissions in every board including the one I am now specifically moderating; and I still have my global mod badge when posting in that board (and all other boards as well).

Maybe I'm missing it, but I don't see any difference at all in the forum I am now "moderating" as opposed to all the others that I am a global mod in.

Arantor

Actually... let me explain what is going on.

When a local moderator is set up, when they are in that board, they gain group 3 on top of all the other groups they are in - no permissions are lost.

And a user in group 3 will also have that badge shown overriding whatever other badge they have. Unless they're in group 1 or 2 as a primary group (and only 1 or 2, not just any group with special moderator permissions!), in which case group 1 or 2's badge will override that.

Kindred

Actually, I don't think so.... Giving an admin the moderator position will override the admin badge
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Arantor

Load.php, line 1038 or thereabouts - this is in the heart of loadMemberData at this point. The same one that would be called in thread view ($set is 'normal' at this point, and $board_info['moderators'] would contain the moderators of the current board if there are any)

// Are we loading any moderators?  If so, fix their group data...
if (!empty($loaded_ids) && !empty($board_info['moderators']) && $set === 'normal' && count($temp_mods = array_intersect($loaded_ids, array_keys($board_info['moderators']))) !== 0)
{
if (($row = cache_get_data('moderator_group_info', 480)) == null)
{
$request = $smcFunc['db_query']('', '
SELECT group_name AS member_group, online_color AS member_group_color, stars
FROM {db_prefix}membergroups
WHERE id_group = {int:moderator_group}
LIMIT 1',
array(
'moderator_group' => 3,
)
);
$row = $smcFunc['db_fetch_assoc']($request);
$smcFunc['db_free_result']($request);

cache_put_data('moderator_group_info', $row, 480);
}

foreach ($temp_mods as $id)
{
// By popular demand, don't show admins or global moderators as moderators.
if ($user_profile[$id]['id_group'] != 1 && $user_profile[$id]['id_group'] != 2)
$user_profile[$id]['member_group'] = $row['member_group'];

// If the Moderator group has no color or stars, but their group does... don't overwrite.
if (!empty($row['stars']))
$user_profile[$id]['stars'] = $row['stars'];
if (!empty($row['member_group_color']))
$user_profile[$id]['member_group_color'] = $row['member_group_color'];
}
}


So... did we load some users, are there board moderators, are we doing the normal display list of user information and are any of the users that we just loaded part of the list of moderators.

If so, fetch the colour and badge of group 3, the moderator group, ideally from cache if possible.

Then for each one of the board moderators, check whether their primary group is group 1 or group 2 and if not, override their primary group for display purposes with group 3.

Kindred

Hmmm... That might be what that code says to do... I don't doubt your code reading abilities.    But I know that, on my forums if I put myself as a moderator, it replaces my admin badge with the green moderator one...
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Arantor


Kindred

I thought so....

Yup...   Askawitchcommunity.org...   I am the admin, group 1, red bubbles...   And in the technical help board, I am moderator...   Green bubbles
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Arantor

Because that's the only situation it should fire, is if your primary group isn't either 1 or 2 (for admin or global moderator respectively), no other groups are considered.

If it doesn't work as intended, it's a bug that's been around for years. Mind you, I doubt most people even knew it did that ;)

Kind of hard to know something is a bug if you don't know that it's actually expected behaviour.

Kindred

True dat...   Heck, I've been using the system for years and always thought that was fad
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

eric1234

So based on the discussion here, it is kinda no ways to accomplish what i actually want. Am I right? :)

Kindred

essentially no.
We have apparently just discovered a bug which has been around for a decade and no one noticed.

the (local) Moderator badge is displayed for any board in which the user has been flagged as the (local) moderator, regardless of the user's normal badge.

And there is no current way to make the badges into a link to the group list.
THAT would require a mod or other custom coding that I do not believe has been done.
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Dragooon

#16
Yeah but the code is still overriding the display badge and colour, so essentially only the group name remains same. If you wish to change that behaviour, open Load.php and

Code (Find) Select
foreach ($temp_mods as $id)
{
// By popular demand, don't show admins or global moderators as moderators.
if ($user_profile[$id]['id_group'] != 1 && $user_profile[$id]['id_group'] != 2)
$user_profile[$id]['member_group'] = $row['member_group'];

// If the Moderator group has no color or stars, but their group does... don't overwrite.
if (!empty($row['stars']))
$user_profile[$id]['stars'] = $row['stars'];
if (!empty($row['member_group_color']))
$user_profile[$id]['member_group_color'] = $row['member_group_color'];
}

Code (Replace) Select
foreach ($temp_mods as $id)
{
// By popular demand, don't show admins or global moderators as moderators.
if ($user_profile[$id]['id_group'] == 1 || $user_profile[$id]['id_group'] == 2)
continue;

$user_profile[$id]['member_group'] = $row['member_group'];

// If the Moderator group has no color or icons, but their group does... don't overwrite.
if (!empty($row['stars']))
$user_profile[$id]['stars'] = $row['strs'];
if (!empty($row['member_group_color']))
$user_profile[$id]['member_group_color'] = $row['member_group_color'];
}


This should retain their Global Moderator/Admin status including the badge.


eric1234

Quote from: Kindred on June 14, 2014, 07:54:55 AM
essentially no.
We have apparently just discovered a bug which has been around for a decade and no one noticed.

the (local) Moderator badge is displayed for any board in which the user has been flagged as the (local) moderator, regardless of the user's normal badge.

And there is no current way to make the badges into a link to the group list.
THAT would require a mod or other custom coding that I do not believe has been done.
I see. Proud to lead you guys to discovered an old bug which has been around for a decade ;)

Quote from: Dragooon on June 14, 2014, 08:09:46 AM

Thank you so much Dragoon, i will try it out when i am free. :)

Advertisement: