MyBB Community Forums

Full Version: Groups that can see forum when closed.
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I posted a plugin request for this but because its quite urgent I thought ill just post it here because it might not actually require a plugin.

Im looking for a way of allowing other groups other than Admins to view the boards when they are closed. For Example, Mods or Super Mods.

Thanks in advance.
Thanks Omar

http://mods.mybb.com/view/extra-groups-t...ing-off-li
The quick way: edit "global.php" file from your forum root and find this code (line 596 in default "global.php" file of MyBB 1.6.5):
// If the board is closed, the user is not an administrator and they're not trying to login, show the board closed message
if($mybb->settings['boardclosed'] == 1 && $mybb->usergroup['cancp'] != 1 && !in_array($current_page, $closed_bypass) && (!is_array($closed_bypass[$current_page]) || !in_array($mybb->input['action'], $closed_bypass[$current_page])))
{
	// Show error
	$lang->error_boardclosed .= "<blockquote>{$mybb->settings['boardclosed_reason']}</blockquote>";
	error($lang->error_boardclosed);
	exit;
}

You can change:
&& $mybb->usergroup['cancp'] != 1
with
&& $mybb->usergroup['cancp'] != 1 && $mybb->usergroup['cancp'] != ALLOW THIS GID USER GROUPS
where ALLOW THIS GID USER GROUPS is id of user groups you want to be allowed to see your forum, even that is closed.

Example: If your administrators have gid = 4 and moderators have gid = 6 and want to be allowed to use your forum, even is closed, change to:
&& $mybb->usergroup['cancp'] != 1 && $mybb->usergroup['cancp'] != 4 && $mybb->usergroup['cancp'] != 6

// Later edit:
But... it's much better to do that with a plugin !!!
I will recommend the edit if you use Patches Smile