]> git.wh0rd.org Git - tt-rss.git/commitdiff
mobile: allow catchup page or entire feed (closes #89)
authorAndrew Dolgov <fox@madoka.spb.ru>
Fri, 7 Jul 2006 03:48:19 +0000 (04:48 +0100)
committerAndrew Dolgov <fox@madoka.spb.ru>
Fri, 7 Jul 2006 03:48:19 +0000 (04:48 +0100)
mobile/functions.php
mobile/mobile.css

index 0339b56f8e64bc155b379c689b744ddae5200586..df48456b1f329b0c444109c6eb948912e7bc8c98 100644 (file)
                        catchup_feed($link, $feed, $cat_view);
                }
 
+               if ($subop == "MarkPageRead") {
+                       $ids_to_mark = $_SESSION["last_page_ids.$feed"];
+
+                       if ($ids_to_mark) {
+
+                               foreach ($ids_to_mark as $id) {
+                                       db_query($link, "UPDATE ttrss_user_entries SET 
+                                               unread = false,last_read = NOW()
+                                               WHERE ref_id = '$id' AND owner_uid = " . $_SESSION["uid"]);
+                               }
+                       }
+               }
+               
                $search = db_escape_string($_GET["search"]);
                $search_mode = db_escape_string($_GET["smode"]);
 
                
                print "$feed_title <span id=\"headingAddon\">(";
                print "<a href=\"tt-rss.php\">Back</a>, ";
-               print "<a href=\"tt-rss.php?go=vf&id=$feed&subop=ForceUpdate\">Update</a>, ";
-               print "<a href=\"tt-rss.php?go=vf&id=$feed&subop=MarkAllRead\">Mark as read</a>";
+               print "<a href=\"tt-rss.php?go=vf&id=$feed&subop=ForceUpdate\">Update</a>";
+#              print "Mark as read: ";
+#              print "<a href=\"tt-rss.php?go=vf&id=$feed&subop=MarkAsRead\">Page</a>, ";
+#              print "<a href=\"tt-rss.php?go=vf&id=$feed&subop=MarkAllRead\">Feed</a>";
                print ")</span>";
                
                print "</div>";
 
                        print "<ul class=\"headlines\">";
 
+                       $page_art_ids = array();
+                       
                        $lnum = 0;
        
                        error_reporting (DEFAULT_ERROR_LEVEL);
        
                                $id = $line["id"];
                                $feed_id = $line["feed_id"];
+
+                               array_push($page_art_ids, $id);
        
                                if ($line["last_read"] == "" && 
                                                ($line["unread"] != "t" && $line["unread"] != "1")) {
 
                        print "</ul>";
 
+                       print "<div class='footerAddon'>Mark as read: ";
+
+                       $_SESSION["last_page_ids.$feed"] = $page_art_ids;
+
+                       print "<a href=\"tt-rss.php?go=vf&id=$feed&subop=MarkPageRead\">Page</a>, ";
+                       print "<a href=\"tt-rss.php?go=vf&id=$feed&subop=MarkAllRead\">Feed</a></div>";
+
                } else {
                        print "<div align='center'>No articles found.</div>";
                }
index a370a08e461908c5c88fd94efb8909c727ec5ac3..5317890fc4cd88b015250f65d83c91da429da21f 100644 (file)
@@ -170,4 +170,7 @@ div.postTags {
        font-weight : normal;
 }
 
-
+div.footerAddon {
+       margin-top : 5px;
+       margin-bottom : 5px;
+}