News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

Ignoring Admins & Moderators issue

Started by poolhall, August 12, 2010, 11:14:59 AM

Previous topic - Next topic

poolhall

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.

CapadY

Maybe you can explain what's the problem ?

There are still no mindreaders here.
Please, don't PM me for support unless invited.
If you don't understand this, you will be blacklisted.

poolhall

:) 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.


CapadY

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
Please, don't PM me for support unless invited.
If you don't understand this, you will be blacklisted.

poolhall

#4
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.

poolhall

#5
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.


CapadY

Oke, you had to wait some time but try to use this:

$context['can_mod']

it's an boolean.
Please, don't PM me for support unless invited.
If you don't understand this, you will be blacklisted.

poolhall

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?

Deaks

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 :)
~~~~
Former SMF Project Manager
Former SMF Customizer

"For as lang as hunner o us is in life, in nae wey
will we thole the Soothron tae owergang us. In truth it isna for glory, or wealth, or
honours that we fecht, but for freedom alane, that nae honest cheil gies up but wi life
itsel."

poolhall


Oya


poolhall

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 :)

Joker™

try this
$context['user']['is_admin'] && $context['can_moderate_forum']
Github Profile
Android apps
Medium

How to enable Post Moderation

"For the wise man looks into space and he knows there is no limited dimensions." - Laozi

All support seeking PM's get microwaved

Advertisement: