From 749b07c78a29b03c63812c3ec3630b16db4baa8f Mon Sep 17 00:00:00 2001 From: thomascube Date: Wed, 14 Dec 2005 23:47:32 +0000 Subject: IMAP bugfixes, better signature handling --- program/include/main.inc | 13 ++++++++----- program/include/rcube_imap.inc | 2 +- 2 files changed, 9 insertions(+), 6 deletions(-) (limited to 'program/include') diff --git a/program/include/main.inc b/program/include/main.inc index 40ca1d4d7..6c4591dac 100644 --- a/program/include/main.inc +++ b/program/include/main.inc @@ -1098,15 +1098,18 @@ function format_date($date, $format=NULL) $now = time(); // local time $now -= (int)date('Z'); // make GMT time $now += ($CONFIG['timezone'] * 3600); // user's time + $now_date = getdate(); - $day_secs = 60*((int)date('H', $now)*60 + (int)date('i', $now)); - $week_secs = 60 * 60 * 24 * 7; - $diff = $now - $timestamp; + //$day_secs = 60*((int)date('H', $now)*60 + (int)date('i', $now)); + //$week_secs = 60 * 60 * 24 * 7; + //$diff = $now - $timestamp; + $today_limit = mktime(0, 0, 0, $now_date['mon'], $now_date['mday'], $now_date['year']); + $week_limit = mktime(0, 0, 0, $now_date['mon'], $now_date['mday']-6, $now_date['year']); // define date format depending on current time - if ($CONFIG['prettydate'] && !$format && $diff < $day_secs) + if ($CONFIG['prettydate'] && !$format && $timestamp > $today_limit) return sprintf('%s %s', rcube_label('today'), date('H:i', $timestamp)); - else if ($CONFIG['prettydate'] && !$format && $diff < $week_secs) + else if ($CONFIG['prettydate'] && !$format && $timestamp > $week_limit) $format = $CONFIG['date_short'] ? $CONFIG['date_short'] : 'D H:i'; else if (!$format) $format = $CONFIG['date_long'] ? $CONFIG['date_long'] : 'd.m.Y H:i'; diff --git a/program/include/rcube_imap.inc b/program/include/rcube_imap.inc index cc30b3fe4..593225da2 100644 --- a/program/include/rcube_imap.inc +++ b/program/include/rcube_imap.inc @@ -480,7 +480,7 @@ class rcube_imap // cache is OK if ($cache_status>0) { - $a_index = get_message_cache_index($cache_key, FALSE, $this->sort_field); + $a_index = $this->get_message_cache_index($cache_key, FALSE, $this->sort_field); return array_values($a_index); } -- cgit v1.2.3