Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.6 > vBulletin 3.6 Add-ons
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
View Unread PMs Details »»
View Unread PMs
Version: 1.00, by MPDev MPDev is offline
Developer Last Online: Dec 2016 Show Printable Version Email this Page

Category: Private Messages Enhancements - Version: 3.6.5 Rating:
Released: 04-07-2007 Last Update: Never Installs: 21
Code Changes Is in Beta Stage  
No support by the author.

As an admin I get a ton of PMs; and I don't always get around to them when I should. Finding old PMs I haven't read can be a pain. So I coded up some quick changes to allow me to have a "Unread PMs" system folder that let me quickly view all my unread PMs.

Now, before you go looking for a plug-in, I'll tell you now you have to make code modifications to two files because vBulletin hard codes system folders. In adding a new system folder the only option I was able to come up with involved a few code changes.

From the dropdown folder selector is an "Unread PMs" option.

I also modified my USERCP_SHELL to include a link to the Unread PMs options.

Code:
            <if condition="$show['showunread']">            
            <tr>
                <td class="$navclass[pm_messagelist]" nowrap="nowrap"><a class="smallfont" href="private.php?$session[sessionurl]folderid=-2">Unread PMs</a></td>
            </tr>
            </if>
Version 1.0 - April 7th, 2007
. Initial release

Show Your Support

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

Comments
  #2  
Old 04-08-2007, 12:26 AM
MPDev's Avatar
MPDev MPDev is offline
 
Join Date: Oct 2003
Location: Virginia
Posts: 885
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Reserved for some screen shots....
Reply With Quote
  #3  
Old 04-08-2007, 01:24 AM
blogtorank's Avatar
blogtorank blogtorank is offline
 
Join Date: Jan 2006
Posts: 450
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

First install and kicks butt!
Reply With Quote
  #4  
Old 04-08-2007, 02:16 PM
Jeordie015 Jeordie015 is offline
 
Join Date: Nov 2002
Location: Illinois, USA
Posts: 125
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Is there a way to include a link to the unread PMs in the popup menu that is below the folder jump menu?
Reply With Quote
  #5  
Old 04-09-2007, 10:58 AM
MPDev's Avatar
MPDev MPDev is offline
 
Join Date: Oct 2003
Location: Virginia
Posts: 885
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You mean the dropdown folder list? That's covered in the changes; or do you mean a different dropdown?
Reply With Quote
  #6  
Old 04-09-2007, 09:09 PM
Muellmann's Avatar
Muellmann Muellmann is offline
 
Join Date: Jun 2006
Location: near keyboard
Posts: 109
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You've made a good job, I like this modification because I had many unread messages everywhere in my box, now I can see them in one place, thanks
Reply With Quote
  #7  
Old 04-16-2007, 09:04 PM
MPDev's Avatar
MPDev MPDev is offline
 
Join Date: Oct 2003
Location: Virginia
Posts: 885
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks! Has been a huge timesaver for me as well; amazingly simple and should probably be an option by default.
Reply With Quote
  #8  
Old 05-28-2007, 06:11 AM
Ian Montgomerie Ian Montgomerie is offline
 
Join Date: Dec 2003
Posts: 11
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I tried this and there's a fundamental problem with the coding - it sets up the "unread PMs" folder to be treated the same way as the "sent items" folder. It should be treated like the inbox folder, because the unread PMs are from the inbox. For example, this problem causes all messages in the unread PM list to display as if they were sent by you.

The fix is easy because the "inbox" way of doing things is the default. You just have to remove all of the modifications which look for a "-1" case in the code and change it to "-1 or -2". "-1" is the special case for the sent items folder.

I'm using a shorter, simpler mod file that looks like this. Working with 3.7 PL1.

Code:
//################################################################################//
//         MOD NAME: Unread PMs                                                  #//
//################################################################################//
//      DESCRIPTION: Let's users view only unread PMs                            #//
//                   Sorry, folks; this couldn't be done via a plug-in because   #//
//                   it requires changing lines of code which explicitly use     #//
//                   a folder id to identify "system" folders.                   #//
//################################################################################//
//               BY: MPDev                                                       #//
//             DATE: 4.07.07                                                     #//
//          VERSION: 1.0                                                         #//
//################################################################################//
//      FILES UPDATED:                                                           #//
//                   private.php                                                 #//
//                   includes/functions_misc.php                                 #//
//################################################################################//

Please make backups of these two files before editting them so you can back
it out if you want.

//################################################################################//
//                                 private.php                                   #//
//################################################################################//

Find:

	$pmfolders = array('0' => $vbphrase['inbox'], '-1' => $vbphrase['sent_items']);

change to:

	$pmfolders = array('0' => $vbphrase['inbox'], '-1' => $vbphrase['sent_items'], '-2' => 'Unread PMs');

//################################################################################//

Find:

			switch ($vbulletin->GPC['folderid'])
			{
				case -1:

change to:

			switch ($vbulletin->GPC['folderid'])
			{
    			// MDP
				case -2:
					$fromfolder = 'Unread PMs';
					break;
			    // MDP
				case -1:

//################################################################################//


Find:

	($hook = vBulletinHook::fetch_hook('private_messagelist_start')) ? eval($hook) : false;

Add after:

    $foldernames["-2"] = "Unread PMs";
	$show['showunread'] = iif($vbulletin->userinfo['pmunread'], true, false);

//################################################################################//

Find:

		    $pms = $db->query_read_slave("
    			SELECT pm.*, pmtext.*
				    " . iif($vbulletin->options['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($vbulletin->options['privallowicons'], "LEFT JOIN " . TABLE_PREFIX . "icon AS icon ON(icon.iconid = pmtext.iconid)") . "
			    WHERE pm.userid=" . $vbulletin->userinfo['userid'] . " AND pm.folderid=" . $vbulletin->GPC['folderid'] . "
			    ORDER BY pmtext.dateline DESC
			    LIMIT $startat, " . $vbulletin->GPC['perpage'] . "
		    ");


Replace with:

		if ( $vbulletin->GPC['folderid'] == -2 )
		{
		    $pms = $db->query_read_slave("
    			SELECT pm.*, pmtext.*
				    " . iif($vbulletin->options['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($vbulletin->options['privallowicons'], "LEFT JOIN " . TABLE_PREFIX . "icon AS icon ON(icon.iconid = pmtext.iconid)") . "
			    WHERE pm.userid=" . $vbulletin->userinfo['userid'] . " AND pm.folderid=0 AND pm.messageread=0
			    ORDER BY pmtext.dateline DESC
			    LIMIT $startat, " . $vbulletin->GPC['perpage'] . "
		    ");
		}
		else
		{
		    $pms = $db->query_read_slave("
    			SELECT pm.*, pmtext.*
				    " . iif($vbulletin->options['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($vbulletin->options['privallowicons'], "LEFT JOIN " . TABLE_PREFIX . "icon AS icon ON(icon.iconid = pmtext.iconid)") . "
			    WHERE pm.userid=" . $vbulletin->userinfo['userid'] . " AND pm.folderid=" . $vbulletin->GPC['folderid'] . "
			    ORDER BY pmtext.dateline DESC
			    LIMIT $startat, " . $vbulletin->GPC['perpage'] . "
		    ");
		}

//################################################################################//
//                          includes/functions_misc.php                          #//
//################################################################################//

Find:

			$folders = array('0' => $vbphrase['inbox'], '-1' => $vbphrase['sent_items']);

replace with:

            $messagecounters["-2"] = $vbulletin->userinfo['pmunread'];
			$folders = array('0' => $vbphrase['inbox'], '-1' => $vbphrase['sent_items'], '-2' => 'Unread');
Reply With Quote
  #9  
Old 09-11-2007, 01:27 AM
yoyoyoyo's Avatar
yoyoyoyo yoyoyoyo is offline
 
Join Date: Dec 2004
Location: USA
Posts: 1,612
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Ian Montgomerie View Post
I'm using a shorter, simpler mod file that looks like this. Working with 3.7 PL1.
Thanks much- working great in 3.8.6!
Reply With Quote
  #10  
Old 09-11-2007, 12:54 PM
MPDev's Avatar
MPDev MPDev is offline
 
Join Date: Oct 2003
Location: Virginia
Posts: 885
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Be sure to click install!
Reply With Quote
Reply


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 07:13 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.05364 seconds
  • Memory Usage 2,306KB
  • Queries Executed 23 (?)
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
  • (2)bbcode_code
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (9)postbit
  • (10)postbit_onlinestatus
  • (10)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
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete