Re: How do I sort Search Results by descending date?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




Steve Giessler-2 wrote:
> 
> On 4/4/11 4:19 PM, Tomas Kuliavas wrote:
>>
>> Steve Giessler-2 wrote:
>>> Dear fellow Squirrelmail admins,
>>>
>>> I have SM 1.4.21 installed on Debian and after spending quite a bit of
>>> time searching all over for the answer I decided to post the question to
>>> this list. Whenever someone does a Search in SM, the Search Results
>>> window gives the results sorted by date in ASCENDING order (oldest to
>>> newest) but users would prefer these results to be sorted by date in
>>> DESCENDING order (newest to oldest).
>>>
>>> How can I make that happen without rewriting the .php code? Is there an
>>> option to change that or a plugin that will allow me to do that? I could
>>> not find it.  BTW - server side sorting is enabled and I use the latest
>>> stable Exim and Dovecot IMAP with Maildir format if that matters (and
>>> PHP 5.2.16-0.dotdeb.0 with Suhosin-Patch 0.9.7)
>>>
>> SquirrelMail does not use SORT extension in search. Search results are
>> not
>> sorted. They are listed in the way IMAP server returns them and results
>> look
>> like sorted by arrival date. Newer arrivals get higher UIDs.
>>
>> Order can be reversed with one line of code in functions/imap_search.php.
>> Same function can be modified to use SORT extension.
>>
> Tomas,
> 
> Any chance you or someone can tell me what that one line of code might be?
> 
----
tomas@miri:/home/www/mail.topolis.inet/www/squirrelmail-1.4.21/functions$
diff -u imap_search.php.orig imap_search.php 
--- imap_search.php.orig	2011-04-05 07:56:27.000000000 +0300
+++ imap_search.php	2011-04-05 07:56:48.000000000 +0300
@@ -109,6 +109,8 @@
     }
     $issent = ($mailbox == $sent_folder);
 
+    $id = array_reverse($id);
+
     $msgs = fillMessageArray($imapConnection,$id,$cnt);
 
     return $msgs;
-----

functions/imap_search.php, near the end of file. + indicates added lines.
-- 
View this message in context: http://old.nabble.com/How-do-I-sort-Search-Results-by-descending-date--tp31316791p31320917.html
Sent from the squirrelmail-users mailing list archive at Nabble.com.


------------------------------------------------------------------------------
Xperia(TM) PLAY
It's a major breakthrough. An authentic gaming
smartphone on the nation's most reliable network.
And it wants your games.
http://p.sf.net/sfu/verizon-sfdev
-----
squirrelmail-users mailing list
Posting guidelines: http://squirrelmail.org/postingguidelines
List address: squirrelmail-users@xxxxxxxxxxxxxxxxxxxxx
List archives: http://news.gmane.org/gmane.mail.squirrelmail.user
List info (subscribe/unsubscribe/change options): https://lists.sourceforge.net/lists/listinfo/squirrelmail-users


[Index of Archives]     [Video For Linux]     [Yosemite News]     [Yosemite Photos]     [gtk]     [KDE]     [Cyrus SASL]     [Gimp on Windows]     [Steve's Art]     [Webcams]

  Powered by Linux