| | |
| | | } |
| | | } |
| | | |
| | | |
| | | $next = $prev = $first = $last = -1; |
| | | // get previous, first, next and last message UID |
| | | if ($RCMAIL->action != 'preview' && $RCMAIL->action != 'print') |
| | | { |
| | | $next = $prev = $first = $last = -1; |
| | | |
| | | if ((!($_SESSION['sort_col'] == 'date' && $_SESSION['sort_order'] == 'DESC') && |
| | | $IMAP->get_capability('sort')) || !empty($_REQUEST['_search'])) |
| | | { |
| | |
| | | else |
| | | { |
| | | // this assumes that we are sorted by date_DESC |
| | | $cnt = $IMAP->messagecount(); |
| | | $seq = $IMAP->get_id($MESSAGE->uid); |
| | | $MESSAGE->index = $cnt - $seq; |
| | | |
| | | $prev = $IMAP->get_uid($seq + 1); |
| | | $first = $IMAP->get_uid($IMAP->messagecount()); |
| | | $first = $IMAP->get_uid($cnt); |
| | | $next = $IMAP->get_uid($seq - 1); |
| | | $last = $IMAP->get_uid(1); |
| | | $MESSAGE->index = $IMAP->messagecount() - $seq; |
| | | } |
| | | |
| | | if ($prev > 0) |
| | |
| | | $OUTPUT->set_env('next_uid', $next); |
| | | if ($last > 0) |
| | | $OUTPUT->set_env('last_uid', $last); |
| | | } |
| | | |
| | | // mark message as read |
| | | if (!$MESSAGE->headers->seen) |