]> git.wh0rd.org Git - tt-rss.git/commitdiff
add separate indicator for fresh articles
authorAndrew Dolgov <fox@bah.org.ru>
Fri, 21 Aug 2009 11:24:18 +0000 (15:24 +0400)
committerAndrew Dolgov <fox@bah.org.ru>
Fri, 21 Aug 2009 11:24:18 +0000 (15:24 +0400)
functions.php
images/fresh_sign.png [new file with mode: 0755]
viewfeed.js

index aeca923620bff7045d4d843a01c65bce6f4008a8..044b0162a9ce2a33a6250ab3bc821f1ca067d71f 100644 (file)
                        $num_unread = 0;
                        $cur_feed_title = '';
 
+                       $fresh_intl = get_pref($link, "FRESH_ARTICLE_MAX_AGE") * 60 * 60;
+
                        while ($line = db_fetch_assoc($result)) {
 
                                $class = ($lnum % 2) ? "even" : "odd";
                                        array_push($topmost_article_ids, $id);
                                }
 
-                               if ($line["last_read"] == "" && 
-                                               ($line["unread"] != "t" && $line["unread"] != "1")) {
+                               if ($line["last_read"] == "" && !sql_bool_to_bool($line["unread"])) {
        
                                        $update_pic = "<img id='FUPDPIC-$id' src=\"images/updated.png\" 
                                                alt=\"Updated\">";
                                        $update_pic = "<img id='FUPDPIC-$id' src=\"images/blank_icon.gif\" 
                                                alt=\"Updated\">";
                                }
+
+                               if (sql_bool_to_bool($line["unread"]) && 
+                                       time() - strtotime($line["updated_noms"]) < $fresh_intl) {
+
+                                       $update_pic = "<img id='FUPDPIC-$id' src=\"images/fresh_sign.png\" 
+                                                       alt=\"Fresh\">";
+                               }
        
                                if ($line["unread"] == "t" || $line["unread"] == "1") {
                                        $class .= "Unread";
diff --git a/images/fresh_sign.png b/images/fresh_sign.png
new file mode 100755 (executable)
index 0000000..9f3d96a
Binary files /dev/null and b/images/fresh_sign.png differ
index 7e53467dc5a5156ded208685fb11f7c9ec176a9f..429412ba465acb8c9b6f5a92b927f4675a80fafe 100644 (file)
@@ -320,7 +320,9 @@ function showArticleInHeadlines(id) {
                        //
                }
 
-               if (upd_img_pic && upd_img_pic.src.match("updated.png")) {
+               if (upd_img_pic && (upd_img_pic.src.match("updated.png") || 
+                                       upd_img_pic.src.match("fresh_sign.png"))) {
+
                        upd_img_pic.src = "images/blank_icon.gif";
 
                        cache_invalidate(cache_prefix + getActiveFeedId());