MyBB Community Forums

Full Version: Rank "Registered" in PHP
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello, I want to know, what "name" rank "registered" has got in PHP. Example:
if($mybb->user['isuser'])
if($mybb->user['uid']) {
  //User is logged in, do something
}

if($mybb->user['uid'] && $mybb->user['usergroup'] == 2) {
 //User is logged in and is a member of registered group, do something
}
This is not work on registered users nor on administrators. I will show code of my plugin:
	if($mybb->user['uid'] & $mybb->user['usergroup'] == 2)
		if($mybb->settings['reminder_enabled'] == 1)
		if($mybb->settings['reminder_quantity'] == 1)
				{
			$reminder = '
				<table border="0" cellspacing="0" cellpadding="0" class="tborder">
					<tr>
						<td style="word-break: break-all;" class="thead"><p align="center">'.$mybb->settings['reminder_name'].'</p></td>
					</tr>
					<tr>
	<td style="word-break: break-all; padding: 10px;" class="trow1"> <p align="center">'.$mybb->settings['reminder_user_text'].'</p></td>
				</table><br /><br />
					<table border="0" cellspacing="0" cellpadding="0" class="tborder">
					<tr>
						<td style="word-break: break-all;" class="thead"><p align="center">'.$mybb->settings['reminder_name'].'</p></td>
					</tr>
					<tr>
	<td style="word-break: break-all; padding: 10px;" class="trow1"> <p align="center">'.$mybb->settings['reminder_text'].'</p></td>
				</table><br /><br />';
		}	
I forgot to include second & symbol. Try again.
Now is error:
Quote:Parse error: syntax error, unexpected '&' in /virtual/t/e/testoweforumcez.ugu.pl/inc/plugins/reminder.php on line 279
		if($mybb->user['uid'] & & $mybb->user['usergroup'] == 2)
		if($mybb->settings['reminder_enabled'] == 1)
		if($mybb->settings['reminder_quantity'] == 1)
				{
			$reminder = '
				<table border="0" cellspacing="0" cellpadding="0" class="tborder">
					<tr>
						<td style="word-break: break-all;" class="thead"><p align="center">'.$mybb->settings['reminder_name'].'</p></td>
					</tr>
					<tr>
	<td style="word-break: break-all; padding: 10px;" class="trow1"> <p align="center">'.$mybb->settings['reminder_user_text'].'</p></td>
				</table><br /><br />
					<table border="0" cellspacing="0" cellpadding="0" class="tborder">
					<tr>
						<td style="word-break: break-all;" class="thead"><p align="center">'.$mybb->settings['reminder_name'].'</p></td>
					</tr>
					<tr>
	<td style="word-break: break-all; padding: 10px;" class="trow1"> <p align="center">'.$mybb->settings['reminder_text'].'</p></td>
				</table><br /><br />';
		}	
}
Without spaces. Take a look at my edited code above again.
Thank you for help