Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.0 > vBulletin 3.0 Full Releases
PM Preview v1 Details »»
PM Preview v1
Version: 1.00, by BluPhoenix BluPhoenix is offline
Developer Last Online: Jan 2006 Show Printable Version Email this Page

Version: 3.0.7 Rating:
Released: 03-29-2005 Last Update: Never Installs: 4
 
No support by the author.

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:

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #2  
Old 03-30-2005, 12:42 PM
T3MEDIA T3MEDIA is offline
 
Join Date: Dec 2004
Posts: 944
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Do you know how many more quries this will make? Just asking.
BTW nice hack. Hucked it up.
Reply With Quote
  #3  
Old 03-30-2005, 12:50 PM
Oblivion Knight's Avatar
Oblivion Knight Oblivion Knight is offline
 
Join Date: May 2002
Location: Sheffield, UK
Posts: 1,757
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by T3MEDIA
Do you know how many more quries this will make? Just asking.
0, it's editing an existing query..
Reply With Quote
  #4  
Old 03-30-2005, 01:17 PM
BluPhoenix BluPhoenix is offline
 
Join Date: Nov 2004
Location: Wirral Peninsula
Posts: 50
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Oblivion Knight
0, it's editing an existing query..
Yep as the wise Knight says.. Zero added queries, little extra load when viewing the pm list, as it loads all the extra text into the title tags. but as long as you keep the pm listings at their vb default or lower it shouldn't cause too much of a noticable lag to the loading of the pm listings.
Reply With Quote
  #5  
Old 03-30-2005, 01:58 PM
Marco van Herwaarden Marco van Herwaarden is offline
 
Join Date: Jul 2004
Posts: 25,415
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Looks nice, but that query modification is not really needed i think. The message column is already fetched.

Just change:
PHP Code:
    $pm['pmpreview'] = strip_quotes($pm['pmpreview']); 
into
PHP Code:
    $pm['pmpreview'] = strip_quotes($pm['message']); 
and remove the query edit.

PS Not tried it myself
Reply With Quote
  #6  
Old 03-30-2005, 02:24 PM
BluPhoenix BluPhoenix is offline
 
Join Date: Nov 2004
Location: Wirral Peninsula
Posts: 50
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Although I think that'll work Marco, I prefer to define just incase that becomes the norm in future, ergo futureproofing the hack somewhat (or at least that's my excuse *g*)
Reply With Quote
  #7  
Old 03-30-2005, 02:29 PM
Marco van Herwaarden Marco van Herwaarden is offline
 
Join Date: Jul 2004
Posts: 25,415
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

excuses, excuses, excuses, excuses, excuses, excuses, excuses, excuses, excuses, excuses

But serious, every edit less is one less to worry about, and 1 less possibility to make a mistake.
Reply With Quote
  #8  
Old 03-30-2005, 03:32 PM
BluPhoenix BluPhoenix is offline
 
Join Date: Nov 2004
Location: Wirral Peninsula
Posts: 50
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by MarcoH64
excuses, excuses, excuses, excuses, excuses, excuses, excuses, excuses, excuses, excuses

But serious, every edit less is one less to worry about, and 1 less possibility to make a mistake.
Thought you were going to start up with a rendition of..

"Spam spam spam spam. Lovely spam! Wonderful spam! Spam spa-a-a-a-a-am spam spa-a-a-a-a-am spam. Lovely spam! Lovely spam! Lovely spam! Lovely spam! Lovely spam! Spam spam spam spam!"

the way you were going then

True, I guess.. but I dunno, there's just something almost "leaving it to chance" about not defining it, call it controlfreakish if you will
Reply With Quote
  #9  
Old 05-09-2005, 04:25 AM
Megareus Rex's Avatar
Megareus Rex Megareus Rex is offline
 
Join Date: Feb 2004
Location: Pennsylvania, USA
Posts: 243
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Great hack! I've been waiting for this for a while. And I agree it should be a vB standard. (The preview tooltips are awesome. Saved me HOURS of thread loading, lol)
Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 04:13 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04211 seconds
  • Memory Usage 2,287KB
  • Queries Executed 22 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (6)bbcode_code
  • (2)bbcode_php
  • (3)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (9)post_thanks_box
  • (9)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (9)post_thanks_postbit_info
  • (8)postbit
  • (9)postbit_onlinestatus
  • (9)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete