From fb1fb4ab1facad22f9f9bfb868efa35500d90abf Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Tue, 28 Mar 2006 07:12:45 +0100 Subject: show last update time/status in feed tooltip (#55) --- backend.php | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'backend.php') diff --git a/backend.php b/backend.php index 916d2b123..482874d21 100644 --- a/backend.php +++ b/backend.php @@ -238,6 +238,7 @@ } $result = db_query($link, "SELECT ttrss_feeds.*, + SUBSTRING(last_updated,1,19) AS last_updated_noms, (SELECT COUNT(id) FROM ttrss_entries,ttrss_user_entries WHERE feed_id = ttrss_feeds.id AND ttrss_user_entries.ref_id = ttrss_entries.id AND @@ -264,6 +265,8 @@ $total_unread = 0; $category = ""; + + $short_date = get_pref($link, 'SHORT_DATE_FORMAT'); while ($line = db_fetch_assoc($result)) { @@ -275,6 +278,12 @@ $total = $line["total"]; $unread = $line["unread"]; + if (get_pref($link, 'HEADLINES_SMART_DATE')) { + $last_updated = smart_date_time(strtotime($line["last_updated_noms"])); + } else { + $last_updated = date($short_date, strtotime($line["last_updated_noms"])); + } + $rtl_content = sql_bool_to_bool($line["rtl_content"]); if ($rtl_content) { @@ -365,7 +374,8 @@ $tmp_category ($cat_unread unread)$ellipsis"; + class=\"$catctr_class\">($cat_unread unread)$ellipsis + "; // !!! NO SPACE before keyboard navigation, etc. @@ -373,7 +383,8 @@ } printFeedEntry($feed_id, $class, $feed, $unread, - "icons/$feed_id.ico", $link, $rtl_content); + "icons/$feed_id.ico", $link, $rtl_content, + $last_updated, $line["last_error"]); ++$lnum; } -- cgit v1.2.3-54-g00ecf