Back to vBulletin 3.0 Add-Ons

PM Preview v1
Mod Version: 1.00, by BluPhoenix

This modification is in the archives.
vB Version: 3.0.7 Rating: (0 vote - 0 average) Installs: 4
Released: 30 Mar 2005 Last Update: Never Downloads: 3
Not Supported  

What does this do then?
This adds a "tooltip" to your Private Message Inbox showing a preview of the pm's in your list. It aids in the removal of old pm's as you can see at a glance which messages you are deleting and also you can get a preview for unread messages to see if it's worth reading now or you can save it for later.. It's a handy little extra and I was actually quite suprised to see it wasn't a default feature of vB.

The Hack

In private.php find:
Code:
	// query private messages
		$pms = $DB_site->query("
			SELECT pm.*, pmtext.*
				" . iif($vboptions['privallowicons'], ", icon.title AS icontitle, icon.iconpath") . "
			FROM " . TABLE_PREFIX . "pm AS pm
			LEFT JOIN " . TABLE_PREFIX . "pmtext AS pmtext ON(pmtext.pmtextid = pm.pmtextid)
			" . iif($vboptions['privallowicons'], "LEFT JOIN " . TABLE_PREFIX . "icon AS icon ON(icon.iconid = pmtext.iconid)") . "
			WHERE pm.userid=$bbuserinfo[userid] AND pm.folderid=$folderid
			ORDER BY pmtext.dateline DESC
			LIMIT $startat, $perpage
		");
REPLACE that code with:
Code:
	// query private messages
		$pms = $DB_site->query("
			SELECT pm.*, pmtext.*,pmtext.message as pmpreview
				" . iif($vboptions['privallowicons'], ", icon.title AS icontitle, icon.iconpath") . "
			FROM " . TABLE_PREFIX . "pm AS pm
			LEFT JOIN " . TABLE_PREFIX . "pmtext AS pmtext ON(pmtext.pmtextid = pm.pmtextid)
			" . iif($vboptions['privallowicons'], "LEFT JOIN " . TABLE_PREFIX . "icon AS icon ON(icon.iconid = pmtext.iconid)") . "
			WHERE pm.userid=$bbuserinfo[userid] AND pm.folderid=$folderid
			ORDER BY pmtext.dateline DESC
			LIMIT $startat, $perpage
		");
(for those that don't like changing whole queries, you are effectively just adding the highlighted bit to the query)

{still in private.php} find:
Code:
	eval('$messagelistbits .= "' . fetch_template('pm_messagelistbit') . '";');
And BEFORE it add:
Code:
	$pm['pmpreview'] = strip_quotes($pm['pmpreview']); 
	$pm['pmpreview'] = htmlspecialchars_uni(fetch_trimmed_title(strip_bbcode(fetch_censored_text($pm['pmpreview']), false, true), $vboptions['threadpreview']));
(again we have the important bit highlighted, this is the limit for the size of the preview, here it uses the same value set for threads in the admincp, but you can replace this with a numerical value to make pm previews, shorter or longer than that depending on your preferfence. I'd say leave them the same but that's just me )

=============================================
We've now finished with the fileedits, now onto the templates..
=============================================

In your pm_messagelistbit template find:
Code:
	<td class="alt1Active" id="m$pm[pmid]" width="100%">

And REPLACE it with:
Code:
	<td class="alt1Active" id="m$pm[pmid]" width="100%" title="$pm[pmpreview]">
.....
and now you are all done, screenshot added for those who couldn't understand my lame explination (names removed to protect the guilty so that's why it looks a bit odd) and text instructions added for those that like to archive them..

Thanks for looking at (and hopefully installing) a BluPhoenix vB Hack :tired:

Download

This modification is archived and cannot be downloaded.

Screenshots

 

Similar Mods

New Posting Features Make poll preview a REAL preview vBulletin 3.7 Add-ons
Private Messages Enhancements PM Preview vBulletin 3.6 Add-ons
PM preview vBulletin 2.x Full Releases

vblts.ru supports vBulletin®, 2022-2024