]> git.wh0rd.org Git - tt-rss.git/commitdiff
dashboard: show last feed update time
authorAndrew Dolgov <fox@madoka.volgo-balt.ru>
Thu, 4 Nov 2010 17:49:49 +0000 (20:49 +0300)
committerAndrew Dolgov <fox@madoka.volgo-balt.ru>
Thu, 4 Nov 2010 17:49:49 +0000 (20:49 +0300)
functions.php

index c691039d80018d8f4397ef67b20eb3c2fb964734..3c27f448bd7f34a6e25e846a2e18c5c434560083 100644 (file)
 
                print "<div class='whiteBox'>".__('No feed selected.');
 
+               print "<p class=\"small\"><span class=\"insensitive\">";
+
+               $result = db_query($link, "SELECT ".SUBSTRING_FOR_DATE."(MAX(last_updated), 1, 19) AS last_updated FROM ttrss_feeds
+                       WHERE owner_uid = " . $_SESSION['uid']);
+
+               $last_updated = db_fetch_result($result, 0, "last_updated");
+
+               if (get_pref($link, 'HEADLINES_SMART_DATE')) {
+                       $last_updated = smart_date_time(strtotime($last_updated));
+               } else {
+                       $last_updated = date($short_date, strtotime($last_updated));
+               }                               
+
+               printf(__("Feeds last updated at %s"), $last_updated);
+
                $result = db_query($link, "SELECT COUNT(id) AS num_errors
                        FROM ttrss_feeds WHERE last_error != '' AND owner_uid = ".$_SESSION["uid"]);
 
                $num_errors = db_fetch_result($result, 0, "num_errors");
 
                if ($num_errors > 0) {
-
-                       print "<p><a class=\"insensitive\" href=\"#\" onclick=\"showFeedsWithErrors()\">".
+                       print "<br/>";
+                       print "<a class=\"insensitive\" href=\"#\" onclick=\"showFeedsWithErrors()\">".
                                __('Some feeds have update errors (click for details)')."</a>";
                }
+               print "</span></p>";
 
                print "</div>]]>";
                print "</headlines>";