From: Andrew Dolgov Date: Thu, 25 Apr 2013 12:27:33 +0000 (+0400) Subject: subtoolbar: add last updated when hovering over originating site link X-Git-Tag: 1.7.9~25^2~83^2 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=6e3e8db9155eed1c42deaa1ad9e9dbaf6f5d3f27;p=tt-rss.git subtoolbar: add last updated when hovering over originating site link --- diff --git a/classes/feeds.php b/classes/feeds.php index dd986410..7ea4b23e 100644 --- a/classes/feeds.php +++ b/classes/feeds.php @@ -11,7 +11,7 @@ class Feeds extends Handler_Protected { private function format_headline_subtoolbar($feed_site_url, $feed_title, $feed_id, $is_cat, $search, - $search_mode, $view_mode, $error) { + $search_mode, $view_mode, $error, $feed_last_updated) { $page_prev_link = "viewFeedGoPage(-1)"; $page_next_link = "viewFeedGoPage(1)"; @@ -53,8 +53,11 @@ class Feeds extends Handler_Protected { $reply .= ""; if ($feed_site_url) { + $last_updated = T_sprintf("Last updated: %s", + $feed_last_updated); + $target = "target=\"_blank\""; - $reply .= "". + $reply .= "". truncate_string($feed_title,30).""; if ($error) { @@ -247,13 +250,14 @@ class Feeds extends Handler_Protected { $feed_title = $qfh_ret[1]; $feed_site_url = $qfh_ret[2]; $last_error = $qfh_ret[3]; + $last_updated = make_local_datetime($qfh_ret[4]); $vgroup_last_feed = $vgr_last_feed; $reply['toolbar'] = $this->format_headline_subtoolbar($feed_site_url, $feed_title, $feed, $cat_view, $search, $search_mode, $view_mode, - $last_error); + $last_error, $last_updated); $headlines_count = $this->dbh->num_rows($result); diff --git a/include/functions.php b/include/functions.php index 39021e9d..d42e111f 100644 --- a/include/functions.php +++ b/include/functions.php @@ -2535,12 +2535,13 @@ $feed_title = getCategoryTitle($feed); } else { if (is_numeric($feed) && $feed > 0) { - $result = db_query("SELECT title,site_url,last_error + $result = db_query("SELECT title,site_url,last_error,last_updated FROM ttrss_feeds WHERE id = '$feed' AND owner_uid = $owner_uid"); $feed_title = db_fetch_result($result, 0, "title"); $feed_site_url = db_fetch_result($result, 0, "site_url"); $last_error = db_fetch_result($result, 0, "last_error"); + $last_updated = db_fetch_result($result, 0, "last_updated"); } else { $feed_title = getFeedTitle($feed); } @@ -2688,7 +2689,7 @@ $result = db_query($select_qpart . $from_qpart . $where_qpart); } - return array($result, $feed_title, $feed_site_url, $last_error); + return array($result, $feed_title, $feed_site_url, $last_error, $last_updated); }