]> git.wh0rd.org Git - tt-rss.git/commitdiff
mobile: add support for publishing articles
authorAndrew Dolgov <fox@madoka.spb.ru>
Wed, 5 Dec 2007 06:28:19 +0000 (07:28 +0100)
committerAndrew Dolgov <fox@madoka.spb.ru>
Wed, 5 Dec 2007 06:28:19 +0000 (07:28 +0100)
mobile/functions.php
mobile/tt-rss.php

index 3d67f4a230c1e43a036adab685f2f192ed9019ed..0bd65082a01c6476aa1acae2900f70b932e24ed7 100644 (file)
                                } else {
                                        $marked_pic = "<img class='marked' src=\"../images/mark_unset.png\">";
                                }
-       
+
+                               if ($line["published"] == "t" || $line["published"] == "1") {
+                                       $published_pic = "<img class='marked' src=\"../images/pub_set.gif\">";
+                               } else {
+                                       $published_pic = "<img class='marked' src=\"../images/pub_unset.gif\">";
+                               }
+
                                $content_link = "<a href=\"?go=view&id=$id&ret_feed=$feed&feed=$feed_id\">" .
                                        $line["title"] . "</a>";
 
                                print "<li class='$class'>";
 
                                print "<a href=\"?go=vf&id=$feed&ts=$id\">$marked_pic</a>";
+                               print "<a href=\"?go=vf&id=$feed&tp=$id\">$published_pic</a>";
 
                                print $content_link;
        
index 1b3b0763fc0c18c8c7a4071de6fd5e6987782862..0793ce497de0ababfadbc8d37a6493b904e0e05d 100644 (file)
                header("Location: tt-rss.php?$query_string");
                return;
        }
+
+       $tp_id = db_escape_string($_GET["tp"]);
+
+       if ($go == "vf" && $tp_id) {
+               $result = db_query($link, "UPDATE ttrss_user_entries SET published = NOT published
+                       WHERE ref_id = '$tp_id' AND owner_uid = " . $_SESSION["uid"]);
+               $query_string = preg_replace("/&tp=[0-9]*/", "", $_SERVER["QUERY_STRING"]);
+               header("Location: tt-rss.php?$query_string");
+               return;
+       }
+
 ?>
 <html>
 <head>