From 784ac51f88fec800f89879f020fd7f1ef851a3d2 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Fri, 21 Aug 2009 15:24:18 +0400 Subject: [PATCH] add separate indicator for fresh articles --- functions.php | 12 ++++++++++-- images/fresh_sign.png | Bin 0 -> 177 bytes viewfeed.js | 4 +++- 3 files changed, 13 insertions(+), 3 deletions(-) create mode 100755 images/fresh_sign.png diff --git a/functions.php b/functions.php index aeca9236..044b0162 100644 --- a/functions.php +++ b/functions.php @@ -4926,6 +4926,8 @@ $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"; @@ -4943,8 +4945,7 @@ 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 = "\"Updated\""; @@ -4952,6 +4953,13 @@ $update_pic = "\"Updated\""; } + + if (sql_bool_to_bool($line["unread"]) && + time() - strtotime($line["updated_noms"]) < $fresh_intl) { + + $update_pic = "\"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 index 0000000000000000000000000000000000000000..9f3d96a349bdf07440d13c0fa3cd700b91cebb23 GIT binary patch literal 177 zcmeAS@N?(olHy`uVBq!ia0vp^LO{&U!3HE*ugcZ~Db50q$YKTtZeb8+WSBKa0w|d5 z>Eak7A-T5Ck?Vkh0CVogEB}_fza0L