Simple Machines Community Forum

SMF Support => SMF 2.0.x Support => Topic started by: poolhall on August 12, 2010, 11:14:59 AM

Title: Ignoring Admins & Moderators issue
Post by: poolhall on August 12, 2010, 11:14:59 AM
Quote from: Oldiesmann on December 05, 2008, 03:30:35 PM
Themes/default/Display.template.php

Find
if (in_array($message['member']['id'], $context['user']['ignoreusers']))

Replace
if (in_array($message['member']['id'], $context['user']['ignoreusers']) && !in_array($message['member']['group_id'], array(1, 2, 3)))

That will cover admins, global mods and local mods.

in SMF 2.0 RC2 I have in Themes/default/Display.template.php

if (!empty($options['posts_apply_ignore_list']) && in_array($message['member']['id'], $context['user']['ignoreusers']))
I replaced it with
if (!empty($options['posts_apply_ignore_list']) && in_array($message['member']['id'], $context['user']['ignoreusers']) && !in_array($message['member']['group_id'], array(1, 2, 3)))

Did I make a mistake? After this change, a member still can successfully ignore admins, global and local moderators.
Title: Re: Ignoring Admins & Modetators issue
Post by: CapadY on August 12, 2010, 01:08:16 PM
Maybe you can explain what's the problem ?

There are still no mindreaders here.
Title: Re: Ignoring Admins & Modetators issue
Post by: poolhall on August 12, 2010, 01:12:03 PM
:) Sorry for thinking it was obvious.

A member can add administrators and moderators to his ignored users list. I want to make it impossible on my board; a member should be able to ignore whoever he wants but admins, global and local moderators.

Title: Re: Ignoring Admins & Moderators issue
Post by: CapadY on August 12, 2010, 02:57:32 PM
What you want is clear.

What is going wrong with the solution you are using now ?
Any errormessage ?
Errors in log ?
What's happening ?

And believe me, thats absolutly not clear in your first message :s
Title: Re: Ignoring Admins & Moderators issue
Post by: poolhall on August 12, 2010, 03:09:11 PM
What's happening, when a member adds an administrator to the ignores users list, the administrator's posts are ignored. No errors in the logs.
Title: Re: Ignoring Admins & Moderators issue
Post by: poolhall on August 12, 2010, 08:37:30 PM
OK, I figured that out. The reason it didn't work was the administrator had another primary membergroup. I added thas membergroup ID to the array and, voila, the admin's post can't be ignored anymore, as well as global moderators' posts.

The problem, however, remains with local moderators. Apparently, local moderator is not a real membergroup, so in_array($message['member']['group_id'], array(1, 2, 3) returns false for local moderator regardless of where his/her post is, on a board which s/he moderates or on another board. A solution for this will still be appreciated :) Maybe a condition whether an ignored user isn't allowed to moderate a board should be used instead of membergroups array, I am not sure.
Title: Re: Ignoring Admins & Moderators issue
Post by: poolhall on August 20, 2010, 04:17:59 PM
bump
Title: Re: Ignoring Admins & Moderators issue
Post by: CapadY on August 24, 2010, 11:03:00 AM
Oke, you had to wait some time but try to use this:

$context['can_mod']

it's an boolean.
Title: Re: Ignoring Admins & Moderators issue
Post by: poolhall on August 25, 2010, 04:08:18 PM
Quote from: capady on August 24, 2010, 11:03:00 AM
Oke, you had to wait some time but try to use this:

$context['can_mod']

it's an boolean.
I guess you mean $context['user']['can_mod'] ?

Doesn't it check whether a user who is viewing a page can moderate?
Title: Re: Ignoring Admins & Moderators issue
Post by: Deaks on September 01, 2010, 01:34:40 PM
you could just add and see, if it works we will all have learnt something new if it doesnt then it will be easily fixed to remove the  code you added and to try something else :)
Title: Re: Ignoring Admins & Moderators issue
Post by: poolhall on September 01, 2010, 05:07:41 PM
it doesn't work
Title: Re: Ignoring Admins & Moderators issue
Post by: Oya on September 01, 2010, 07:26:39 PM
how about $user_info['is_mod']
Title: Re: Ignoring Admins & Moderators issue
Post by: poolhall on September 02, 2010, 07:59:32 PM
Quote from: Oya on September 01, 2010, 07:26:39 PM
how about $user_info['is_mod']
I guess it is the same, not going to work. This should be checking if the message that is about to be viewed by another member is posted by a moderator, should not be checking whether a member who is viewing a page is a moderator. I am not a programmer, though :)
Title: Re: Ignoring Admins & Moderators issue
Post by: Jokerâ„¢ on September 06, 2010, 01:27:27 PM
try this
$context['user']['is_admin'] && $context['can_moderate_forum']