Hello people out there,

I have been tearing my hair out with this one, as I cannot get imap_sort
to perform correctly.

below is the piece of code that I use. of all the sort types, only
SORTSIZE works. All the otheres give incorreclty sorted lists.

to see an example of this please go to :

http://www.tijuana.com

login : phplist
passwd : phplistphp

and send the account an email. Click on the header columns to sort the
headers.

please tell me what I am doing wrong..... I cant stare at it any longer :(
_______________________________________
machine OS specs:
RH7.1, php4.0.5, wu-imap, apache1.3.19
---------------------------------------
<---code snip ----------->

$newstrm = imap_open ($ms.$selectedmb, $usr, $usrpwd) or die ("cant
connect: ".imap_last_error());
  switch ($sortby) {
    case "date":
  $sorted_headers = imap_sort($newstrm,SORTDATE, $rev_flag,'');
      break;
    case "subject":
  $sorted_headers = imap_sort($newstrm,SORTSUBJECT, $rev_flag,'');
      break;
    case "tag":
      if ($tag == "From") {
  $sorted_headers = imap_sort($newstrm,SORTFROM, $rev_flag,'');
      } else {
  $sorted_headers = imap_sort($newstrm,SORTTO, $rev_flag,'');
      }
      break;
    case "size":
  $sorted_headers = imap_sort($newstrm,SORTSIZE, $rev_flag,'');
      break;
  }
  while (list(,$qq) = each($sorted_headers)) {
    $header = imap_headerinfo($newstrm, $qq);
    $msgnumber = $header->Msgno;

etc etc etc..

<--- code snip ------------->

but hte order never come out correct. The listing of using the sort by
does change, but it is not correct.

thanks in advance

richard

__________________________________________________
Do You Yahoo!?
Find the one for you at Yahoo! Personals
http://personals.yahoo.com

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to