summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2009-08-21 15:24:18 +0400
committerAndrew Dolgov <[email protected]>2009-08-21 15:24:18 +0400
commit784ac51f88fec800f89879f020fd7f1ef851a3d2 (patch)
treed75b3711ce04ca098831758b40425a709e5bc0d7
parent9897ca677224d3de7f8f155dd11dd98acf99bfa3 (diff)
add separate indicator for fresh articles
-rw-r--r--functions.php12
-rwxr-xr-ximages/fresh_sign.pngbin0 -> 177 bytes
-rw-r--r--viewfeed.js4
3 files changed, 13 insertions, 3 deletions
diff --git a/functions.php b/functions.php
index aeca92362..044b0162a 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 = "<img id='FUPDPIC-$id' src=\"images/updated.png\"
alt=\"Updated\">";
@@ -4952,6 +4953,13 @@
$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
index 000000000..9f3d96a34
--- /dev/null
+++ b/images/fresh_sign.png
Binary files differ
diff --git a/viewfeed.js b/viewfeed.js
index 7e53467dc..429412ba4 100644
--- a/viewfeed.js
+++ b/viewfeed.js
@@ -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());