subtoolbar: add last updated when hovering over originating site link

master
Andrew Dolgov 12 years ago
parent 204f9b186f
commit 6e3e8db915

@ -11,7 +11,7 @@ class Feeds extends Handler_Protected {
private function format_headline_subtoolbar($feed_site_url, $feed_title, private function format_headline_subtoolbar($feed_site_url, $feed_title,
$feed_id, $is_cat, $search, $feed_id, $is_cat, $search,
$search_mode, $view_mode, $error) { $search_mode, $view_mode, $error, $feed_last_updated) {
$page_prev_link = "viewFeedGoPage(-1)"; $page_prev_link = "viewFeedGoPage(-1)";
$page_next_link = "viewFeedGoPage(1)"; $page_next_link = "viewFeedGoPage(1)";
@ -53,8 +53,11 @@ class Feeds extends Handler_Protected {
$reply .= "<span id='feed_title'>"; $reply .= "<span id='feed_title'>";
if ($feed_site_url) { if ($feed_site_url) {
$last_updated = T_sprintf("Last updated: %s",
$feed_last_updated);
$target = "target=\"_blank\""; $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>"; truncate_string($feed_title,30)."</a>";
if ($error) { if ($error) {
@ -247,13 +250,14 @@ class Feeds extends Handler_Protected {
$feed_title = $qfh_ret[1]; $feed_title = $qfh_ret[1];
$feed_site_url = $qfh_ret[2]; $feed_site_url = $qfh_ret[2];
$last_error = $qfh_ret[3]; $last_error = $qfh_ret[3];
$last_updated = make_local_datetime($qfh_ret[4]);
$vgroup_last_feed = $vgr_last_feed; $vgroup_last_feed = $vgr_last_feed;
$reply['toolbar'] = $this->format_headline_subtoolbar($feed_site_url, $reply['toolbar'] = $this->format_headline_subtoolbar($feed_site_url,
$feed_title, $feed_title,
$feed, $cat_view, $search, $search_mode, $view_mode, $feed, $cat_view, $search, $search_mode, $view_mode,
$last_error); $last_error, $last_updated);
$headlines_count = $this->dbh->num_rows($result); $headlines_count = $this->dbh->num_rows($result);

@ -2535,12 +2535,13 @@
$feed_title = getCategoryTitle($feed); $feed_title = getCategoryTitle($feed);
} else { } else {
if (is_numeric($feed) && $feed > 0) { 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"); FROM ttrss_feeds WHERE id = '$feed' AND owner_uid = $owner_uid");
$feed_title = db_fetch_result($result, 0, "title"); $feed_title = db_fetch_result($result, 0, "title");
$feed_site_url = db_fetch_result($result, 0, "site_url"); $feed_site_url = db_fetch_result($result, 0, "site_url");
$last_error = db_fetch_result($result, 0, "last_error"); $last_error = db_fetch_result($result, 0, "last_error");
$last_updated = db_fetch_result($result, 0, "last_updated");
} else { } else {
$feed_title = getFeedTitle($feed); $feed_title = getFeedTitle($feed);
} }
@ -2688,7 +2689,7 @@
$result = db_query($select_qpart . $from_qpart . $where_qpart); $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);
} }

Loading…
Cancel
Save