]> git.wh0rd.org Git - tt-rss.git/commitdiff
subtoolbar: add last updated when hovering over originating site link
authorAndrew Dolgov <fox@fakecake.org>
Thu, 25 Apr 2013 12:27:33 +0000 (16:27 +0400)
committerAndrew Dolgov <fox@fakecake.org>
Thu, 25 Apr 2013 12:27:33 +0000 (16:27 +0400)
classes/feeds.php
include/functions.php

index dd986410391c32d14e5ddfe65c4bf0e0ff077fab..7ea4b23e87e819d81da5523e28c02ab16553d6d5 100644 (file)
@@ -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 .= "<span id='feed_title'>";
 
                if ($feed_site_url) {
+                       $last_updated = T_sprintf("Last updated: %s",
+                               $feed_last_updated);
+
                        $target = "target=\"_blank\"";
-                       $reply .= "<a title=\"".__("Visit the website")."\" $target href=\"$feed_site_url\">".
+                       $reply .= "<a title=\"$last_updated\" $target href=\"$feed_site_url\">".
                                truncate_string($feed_title,30)."</a>";
 
                        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);
 
index 39021e9d0acf4f3c4d11ad11d2c8f60bae553244..d42e111f27b768cf8f38ab502ef32dc3f6c94982 100644 (file)
                                        $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);
                                        }
                                $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);
 
        }