MyBB Community Forums

Full Version: Get PM's Complete Message With PM Subject
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
This is useful if you want to know the PM's message before clicking and opening the PM to read.

Open ./global.php and find;
	$query = $db->query("
		SELECT pm.subject, pm.icon, 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 1
	");

and change it to;
	$query = $db->query("
		SELECT pm.subject, pm.message, pm.icon, 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 1
	");

Now find the following within the same global.php file;
	else
	{
		$user_text = build_profile_link($pm['fromusername'], $pm['fromuid']);
	}

and add the following code just below that;
	$pmmessage = htmlspecialchars_uni($pm['message']);

Save the file.

Now Go to: ACP > Templates > Your theme's templates > Edit [Options] > Global Templates > global_pm_alert > and find;
<div title="{$pmmessage}">{$privatemessage_text}</div>

and change it to;
<div title="{$pmmessage}">{$privatemessage_text}</div>

Save template. Now when you receive a PM, you just have to Hover your mouse over the PM Notice area. There you should see all the PM's message rather then to go inside and read it.

One of the usefulness of this modification is that you can dismiss the PM (using that button [Image: dismiss_notice.gif]) if you don't want to reply Wink
amazing