]> git.wh0rd.org Git - tt-rss.git/commitdiff
implement new version checking (2)
authorAndrew Dolgov <fox@bah.spb.su>
Sun, 20 Aug 2006 04:31:22 +0000 (05:31 +0100)
committerAndrew Dolgov <fox@bah.spb.su>
Sun, 20 Aug 2006 04:31:22 +0000 (05:31 +0100)
functions.php

index b62f27eaf81c5a3f8a5ba008c98e43a3ed6cfe8c..546a5f1d5fc540b62f97617186f0046d7158c9ca 100644 (file)
                        if (!$items || !is_array($items)) $items = $rss->entries;
                        if (!$items || !is_array($items)) $items = $rss;
 
-                       if (!is_array($items)) {
+                       if (!is_array($items) || count($items) == 0) {
                                return;
-                       }
+                       }                       
 
                        $last_item = $items[0];
 
 
                        $release_url = $last_item["link"];
 
-                       if ($cur_version != $last_version) {
+                       if ($cur_version == $last_version) {
                                return "<div class=\"notice\"><a target=\"_new\" href=\"$release_url\">
-                                               New version of Tiny-Tiny RSS is available.</a></div>";
-                       }
+                                               New version of Tiny-Tiny RSS ($last_version) is available.</a></div>";
+                       }                       
                }
        }
 ?>