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.
Maybe you can explain what's the problem ?
There are still no mindreaders here.
:) 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.
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
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.
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.
bump
Oke, you had to wait some time but try to use this:
$context['can_mod']
it's an boolean.
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?
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 :)
it doesn't work
how about $user_info['is_mod']
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 :)
try this
$context['user']['is_admin'] && $context['can_moderate_forum']