diff options
author | Andrew Dolgov <[email protected]> | 2009-04-30 11:23:38 +0400 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2009-04-30 11:23:38 +0400 |
commit | 4a596be6976e61962b8ac6053b3917906b384bb7 (patch) | |
tree | 4867edede986eed4a18b27d059ff6208a894cf82 /mobile | |
parent | 849b382582b052abe9dee827c32b92f695405c9a (diff) |
mobile: allow marking articles as unread (clses #240)
Diffstat (limited to 'mobile')
-rw-r--r-- | mobile/functions.php | 15 | ||||
-rw-r--r-- | mobile/mobile.css | 5 | ||||
-rw-r--r-- | mobile/tt-rss.php | 14 |
3 files changed, 29 insertions, 5 deletions
diff --git a/mobile/functions.php b/mobile/functions.php index b5148bad8..7c57cfc57 100644 --- a/mobile/functions.php +++ b/mobile/functions.php @@ -710,9 +710,14 @@ $published_pic = "<img class='marked' src=\"../images/pub_unset.gif\">"; } + print "<div class=\"postStarOps\">"; - print "<a href=\"?go=view&id=$id&ret_feed=$ret_feed_id&feed=$feed_id&sop=ts\">$marked_pic</a>"; - print "<a href=\"?go=view&id=$id&ret_feed=$ret_feed_id&feed=$feed_id&sop=tp\">$published_pic</a>"; + print "<a title=\"".__('Toggle starred')."\"href=\"?go=view&id=$id&ret_feed=$ret_feed_id&feed=$feed_id&sop=ts\">$marked_pic</a>"; + print "<a title=\"".__('Toggle published')."\" href=\"?go=view&id=$id&ret_feed=$ret_feed_id&feed=$feed_id&sop=tp\">$published_pic</a>"; + // Mark unread + print "<a title=\"".__('Mark as unread')."\" href=\"?go=vf&id=$ret_feed_id&feed=$feed_id&sop=mu&aid=$id"; + if ($cat_view) { print "&cat=$cat_view"; } + print "\"><img class='marked' src=\"../images/art-set-unread.png\"></a>"; print "</div>"; print sanitize_rss($link, $line["content"], true);; @@ -796,4 +801,10 @@ $result = db_query($link, "UPDATE ttrss_user_entries SET published = NOT published WHERE ref_id = '$tp_id' AND owner_uid = " . $_SESSION["uid"]); } + + function markUnread($link, $mu_id) { + $result = db_query($link, "UPDATE ttrss_user_entries SET unread = true + WHERE ref_id = '$mu_id' AND owner_uid = " . $_SESSION["uid"]); + } + ?> diff --git a/mobile/mobile.css b/mobile/mobile.css index b50da5875..8161340cc 100644 --- a/mobile/mobile.css +++ b/mobile/mobile.css @@ -200,6 +200,11 @@ ul.headlines img.feedIcon { ul.headlines img.marked { border-width : 0px; } + +div.postStarOps img.marked { + border-width : 0px; +} + div.postTags { color : gray; font-size : small; diff --git a/mobile/tt-rss.php b/mobile/tt-rss.php index db7129042..b291f46dd 100644 --- a/mobile/tt-rss.php +++ b/mobile/tt-rss.php @@ -67,8 +67,12 @@ $sop = db_escape_string($_GET["sop"]); - if ($sop && $go == "view") { - $a_id = db_escape_string($_GET["id"]); + if ($sop) { + if ($go == "view") { + $a_id = db_escape_string($_GET["id"]); + } elseif ($go == "vf") { + $a_id = db_escape_string($_GET["aid"]); + } if ($a_id) { @@ -80,7 +84,11 @@ toggleMarked($link, $a_id); } - $query_string = preg_replace("/&sop=t[sp]/", "", $_SERVER["QUERY_STRING"]); + if ($sop == "mu") { + markUnread($link, $a_id); + } + + $query_string = str_replace("&sop=$sop", "", $_SERVER["QUERY_STRING"]); header("Location: tt-rss.php?$query_string"); } } |