SimplePortal

Support => English Support => Topic started by: PokemonS on August 19, 2014, 10:52:26 AM

Title: A membergroup can see whisper
Post by: PokemonS on August 19, 2014, 10:52:26 AM
SMF 2.0.8
SP 2.3.5

Hi,

My current code in Subs-Portal.php:

Code: [Select]
if (preg_match('~^/(.+?)/~' . ($context['utf8'] ? 'u' : ''), $shout['text'], $target) && $smcFunc['strtolower']($target[1]) !== $smcFunc['strtolower']($user_info['name']) && $shout['author']['id'] != $user_info['id'] && !$user_info['is_admin'])
{
unset($shouts[$shout['id']]);
continue;
}
elseif (preg_match('~^/(.+?)/~' . ($context['utf8'] ? 'u' : ''), $shout['text'], $target))
$shouts[$shout['id']]['text'] = '<p style="background-color:#afa;padding:2px 4px;border:2px solid green">' . $shouts[$shout['id']]['text'] . '</p>';

I want a membergroup (for example, Global Moderator, id = 21) to see whispers. So, only admin and membergroup Global Moderator which can see whispers.

What code should I modify? And I don't need modify code out of Subs-Portal.php, such as ManageMembergroups.php
Title: Re: A membergroup can see whisper
Post by: [SiNaN] on October 11, 2014, 07:11:09 AM
Code: (Find) [Select]
&& !$user_info['is_admin'])
Code: (Replace) [Select]
&& !$user_info['is_admin'] && !in_array(21, $user_info['groups']))
SimplePortal 2.3.8 © 2008-2024, SimplePortal