MyBB Community Forums

Full Version: Modify this block guests, so that it blocks awaiting activation users as well?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Here's the function:

function registeredlinks_process(&$message)
{
	global $lang, $mybb;
	

	if ($mybb->user['uid'] == 0)
	{
		$lang->load('registeredlinks');
		
		$lang->reglinks_text = str_replace("{bburl}",$mybb->settings['bburl'],$lang->reglinks_text);
		
		$message = preg_replace('#<a href="(.*?)</a>#i', $lang->reglinks_text, $message);
		

	}
	
	
	return $message;

}

I want to block gid 1,5,7,12 from seeing links in the forum.

I assume I need to change 'if ($mybb->user['uid'] == 0)'

But I'm not sure of the proper syntax.

Any help appreciated
you can try using below code in place of if ($mybb->user['uid'] == 0)
if (in_array($mybb->usergroup['gid'], array('1', '5', '7', '12'))) 
Okay. Good. That works excellent. Thanks .m.