From: Andrew Dolgov Date: Thu, 30 Apr 2009 07:23:38 +0000 (+0400) Subject: mobile: allow marking articles as unread (clses #240) X-Git-Tag: 1.3.3~13 X-Git-Url: https://git.wh0rd.org/?p=tt-rss.git;a=commitdiff_plain;h=4a596be6976e61962b8ac6053b3917906b384bb7 mobile: allow marking articles as unread (clses #240) --- diff --git a/images/art-set-unread.png b/images/art-set-unread.png new file mode 100755 index 00000000..611dd954 Binary files /dev/null and b/images/art-set-unread.png differ diff --git a/mobile/functions.php b/mobile/functions.php index b5148bad..7c57cfc5 100644 --- a/mobile/functions.php +++ b/mobile/functions.php @@ -710,9 +710,14 @@ $published_pic = ""; } + print "
"; - print "$marked_pic"; - print "$published_pic"; + print "$marked_pic"; + print "$published_pic"; + // Mark unread + print ""; print "
"; 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 b50da587..8161340c 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 db712904..b291f46d 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"); } }