MyBB Community Forums

Full Version: Show more MP in than one global alert ..?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Well I want to show more than one MP warning that just below the header .. As I leave this guide.

[Image: 550373-108201253622pm.png]

But it appears more of a bar if more MP.

I leave also modify the code in the file global.php still not working.

	$query = $db->query("
		SELECT pm.subject, pm.pmid, fu.username AS fromusername, fu.uid AS fromuid
		FROM ".TABLE_PREFIX."privatemessages pm
		LEFT JOIN ".TABLE_PREFIX."users fu ON (fu.uid=pm.fromid)
		WHERE pm.folder='1' AND pm.uid='{$mybb->user['uid']}' AND pm.status='0'
		ORDER BY pm.dateline DESC
		LIMIT 0,5
	");
	
	while($pm = $db->fetch_array($query))
	{
		$pm['subject'] = $parser->parse_badwords($pm['subject']);
	
		if($pm['fromuid'] == 0)
		{
			$pm['fromusername'] = $lang->mybb_engine;
			$user_text = $pm['fromusername'];
		}
		else
		{
			$user_text = build_profile_link($pm['fromusername'], $pm['fromuid']);
		}

		if($mybb->user['pms_unread'] == 1)
		{
			$privatemessage_text = $lang->sprintf($lang->newpm_notice_one, $user_text, $pm['pmid'], htmlspecialchars_uni($pm['subject']));
		}
		else
		{
			$privatemessage_text = $lang->sprintf($lang->newpm_notice_multiple, $mybb->user['pms_unread'], $user_text, $pm['pmid'], htmlspecialchars_uni($pm['subject']));
		}
		eval("\$pm_notice = \"".$templates->get("global_pm_alert")."\";");
	}

What can I do?
What do you want to do?
Hay says .. show more of a bar with the MP, ie not just one show, I put a limit of 5, but it does not work.
So you want more than one notification bar?
This:
eval("\$pm_notice = \"".$templates->get("global_pm_alert")."\";");

$pm_notice is being defined each time, it should be:
eval("\$pm_notice .= \"".$templates->get("global_pm_alert")."\";");

You will need to modify more that the LIMIT line to get this working smoothly.
Thanks Omar G. Big Grin
Thought they already inside while kept repeating variables and assigned well.