View Full Version : Sortable columns for message listing
Mark Wing
02-26-2005, 10:00 PM
Description
This hack changes the PM message listing to work more like most webmail type systems. The date, title and sender are separated into three columns and the current message grouping (ie today, yesterday, last week) is removed. Each of the new columns can be sorted by clicking on the column header. I have long hated the way the old message system works because I have trouble finding all messages from a particular user. By being able to sort by users, this has made things easier.
Details
Files to Modify: 1
Templates to Modify: 4
Difficulty: Easy
Support
I will be checking this thread and answering questions or addressing any problems
Updates
Version 1.01
1) Updated install script. Step 12 listed wrong template
2) Corrected problem with pagination. If you have installed 1.00, just redo step 7.
3) Updated to handle the fact that not everyone uses PM icons. Steps 9 to 12 were updated to reflect this change. This change both turns off the column when not used and properly alternates the column colors. If you have installed this and are using PM Icons, don't worry about it.
bigcurt
02-27-2005, 01:06 AM
Nice mod..congrats
* bigcurt doesnt install because I dont use pm ;)
FIRST POST!
Freezerator
02-27-2005, 09:16 AM
Nice hack!! Installing :)
honestjohn
03-19-2005, 03:26 AM
Slight correction to the install file:
Step 12 should read: In pm_messagelist_periodgroup find
(not PM_MESSAGELISTBIT_IGNORE)
And the code to search for in step 12 is:
<tr>
<td class="alt2" colspan="<if condition="$show['pmicons']">3<else />2</if>" style="padding-top:3px; padding-bottom:3px; border-bottom:1px outset; cursor:pointer;" ondblclick="toggle_collapse('pmf$groupid')" width="100%">
<div class="smallfont">
<span style="float:$stylevar[right]">
<label for="checkall_$groupid">$vbphrase[messages]: <strong>$messagesingroup</strong></label>
</span>
<a href="#top" onclick="return toggle_collapse('pmf$groupid')"><img class="inlineimg" id="collapseimg_pmf$groupid" src="$stylevar[imgdir_button]/collapse_alt{$collapseimg_groupid}.gif" alt="" border="0" /></a>
<strong>$groupname</strong>
</div>
</td>
<td class="alt2" style="padding:0px; border-bottom:1px outset" align="center"><input type="checkbox" id="checkall_$groupid" title="$vbphrase[select_deselect_all_in_time_period]" onclick="check_all_group(this, '$groupid')" /></td>
</tr>
(You just forgot to include the <IF> for pmicons, no biggie, but might confuse someone)
I beleive that's all that was missing. Great mod, simple but powerful improvement to the private messages. Thanks Mark.
honestjohn
03-19-2005, 05:28 PM
The hack goofs on pagination though, you end with page links that looks like:
"/private.php?folderid=0&pp=50&fromusername=$fromusername&sortorder=asc&page=2"
"/private.php?folderid=0&pp=50&=$&sortorder=desc&page=2"
I can guess what the problem is, but I'm still working out how this would be fixed... suggestions?
Mark Wing
03-21-2005, 04:47 PM
Thanks for the input. I have corrected the problems and loaded up a new installer. Please let me know if you have any more problems.
Mark
honestjohn
03-21-2005, 06:16 PM
Thanks, I should have looked there. However you pointed me in the right direction, and I found the bug I was looking for:
The code to replace in step 7 should be (change bolded, color):
$pagenav = construct_page_nav($totalmessages, "private.php?$session[sessionurl]folderid=$folderid&pp=$perpage&sort=$sortfield&sortorder=$sortorder");
And one simple improvement in step 12 (change bolded, color), allows you to click the sort on any page #, and maintain the page #:
<tr>
<td class="thead" nowrap="nowrap"></td>
<if condition="$show['pmicons']">
<td class="thead" nowrap="nowrap"></td>
</if>
<td class="thead" nowrap="nowrap"><a href="$sorturl&order=DESC&sort=dateline&pp=$perpage&fold erid=$folderid&page=$pagenumber">Date</a> $sortarrow[dateline]</td>
<td class="thead" nowrap="nowrap"><a href="$sorturl&order=ASC&sort=fromusername&pp=$perpage&f olderid=$folderid&page=$pagenumber"><if condition="$folderid==-1">To<else />From</if></a> $sortarrow[fromusername]</td>
<td class="thead" nowrap="nowrap"><a href="$sorturl&order=ASC&sort=title&pp=$perpage&folderid =$folderid&page=$pagenumber">Subject</a> $sortarrow[title]</td>
<td class="thead" nowrap="nowrap" style="padding:0px; border-bottom:1px outset" align="center"><input type="checkbox" id="checkall_$groupid" title="$vbphrase[select_deselect_all_in_time_period]" onclick="check_all_group(this, '$groupid')" /></td>
</tr>
After thos fixes, as far as I can tell, the mod is now working perfectly. Thanks for the mod, Mark, it's a huge improvement for alot of my users.
DivisionByZero
08-03-2005, 07:17 AM
any status on 3.5.0 for this? this ROCKS on my 3.0.7 board :)
Mark Wing
08-11-2005, 01:37 PM
I haven't even looked at 3.5 yet. Now that it is at "Release Candidate" status, I plan to do so soon.
Mark
DivisionByZero
09-17-2005, 03:44 AM
yes, please do :)
MThornback
09-18-2005, 11:54 AM
yes, please do :)
If your using the "Flag PM" Hack, you need to add an extra column for the sorting info to appear in the right places :) otherwise great hack :D
DivisionByZero
10-10-2005, 12:54 PM
*bump*
3.5.0?
buro9
10-17-2005, 10:42 AM
Another request for a 3.5 version :)
Spinning Webs
08-20-2007, 03:14 PM
Just wondering how difficult it would be to mod this to work exactly the same on search.php, particularly with new posts, ie: sort by forum name upon clicking "New Posts"
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.