From 4a596be6976e61962b8ac6053b3917906b384bb7 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Thu, 30 Apr 2009 11:23:38 +0400 Subject: [PATCH] mobile: allow marking articles as unread (clses #240) --- images/art-set-unread.png | Bin 0 -> 280 bytes mobile/functions.php | 15 +++++++++++++-- mobile/mobile.css | 5 +++++ mobile/tt-rss.php | 14 +++++++++++--- 4 files changed, 29 insertions(+), 5 deletions(-) create mode 100755 images/art-set-unread.png diff --git a/images/art-set-unread.png b/images/art-set-unread.png new file mode 100755 index 0000000000000000000000000000000000000000..611dd95485a31d2e183c86e66e13357843c491b0 GIT binary patch literal 280 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`oCO|{#S9GG!XV7ZFl&wkQ1Fze zi(`m|;L#v!zGefSTE)GLNjl*VSrQ*l+R!R}QM9#@wbTC=i)vAWR#52HxIcfYtETb( zxjjQzVd)h<>HjaRq#n(C?ie#|>D;{+*9bJV>)IYG2OkT0-)VuSR?tvofN"; } + 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"); } } -- 2.39.2