]> git.wh0rd.org - tt-rss.git/blobdiff - classes/handler/public.php
fix inline flash/html5 audio player
[tt-rss.git] / classes / handler / public.php
index 0aa86a8442afc1237c09df1995a3885e69166632..ca6144bdff5a5844e19f8f626234d7f1546fda46 100644 (file)
@@ -61,7 +61,7 @@ class Handler_Public extends Handler {
                                $tpl->setVariable('ARTICLE_EXCERPT',
                                        truncate_string(strip_tags($line["content_preview"]), 100, '...'), true);
 
-                               $content = $line["content_preview"];
+                               $content = sanitize($this->link, $line["content_preview"], false, $owner_uid);
 
                                if ($line['note']) {
                                        $content = "<div style=\"$note_style\">Article note: " . $line['note'] . "</div>" .
@@ -132,7 +132,7 @@ class Handler_Public extends Handler {
                                $article['link']        = $line['link'];
                                $article['title'] = $line['title'];
                                $article['excerpt'] = truncate_string(strip_tags($line["content_preview"]), 100, '...');
-                               $article['content'] = $line["content_preview"];
+                               $article['content'] = sanitize($this->link, $line["content_preview"], false, $owner_uid);
                                $article['updated'] = date('c', strtotime($line["updated"]));
 
                                if ($line['note']) $article['note'] = $line['note'];
@@ -280,36 +280,6 @@ class Handler_Public extends Handler {
                header("Location: index.php");
        }
 
-       function fbexport() {
-
-               $access_key = db_escape_string($_POST["key"]);
-
-               // TODO: rate limit checking using last_connected
-               $result = db_query($this->link, "SELECT id FROM ttrss_linked_instances
-                       WHERE access_key = '$access_key'");
-
-               if (db_num_rows($result) == 1) {
-
-                       $instance_id = db_fetch_result($result, 0, "id");
-
-                       $result = db_query($this->link, "SELECT feed_url, site_url, title, subscribers
-                               FROM ttrss_feedbrowser_cache ORDER BY subscribers DESC LIMIT 100");
-
-                       $feeds = array();
-
-                       while ($line = db_fetch_assoc($result)) {
-                               array_push($feeds, $line);
-                       }
-
-                       db_query($this->link, "UPDATE ttrss_linked_instances SET
-                               last_status_in = 1 WHERE id = '$instance_id'");
-
-                       print json_encode(array("feeds" => $feeds));
-               } else {
-                       print json_encode(array("error" => array("code" => 6)));
-               }
-       }
-
        function share() {
                $uuid = db_escape_string($_REQUEST["key"]);
 
@@ -377,12 +347,17 @@ class Handler_Public extends Handler {
        }
 
        function sharepopup() {
+               if (SINGLE_USER_MODE) {
+                       login_sequence($this->link);
+               }
+
                header('Content-Type: text/html; charset=utf-8');
                print "<html>
                                <head>
                                        <title>Tiny Tiny RSS</title>
                                        <link rel=\"stylesheet\" type=\"text/css\" href=\"utility.css\">
                                        <script type=\"text/javascript\" src=\"lib/prototype.js\"></script>
+                                       <script type=\"text/javascript\" src=\"lib/scriptaculous/scriptaculous.js?load=effects,dragdrop,controls\"></script>
                                        <meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\"/>
                                </head>
                                <body id='sharepopup'>";
@@ -396,8 +371,10 @@ class Handler_Public extends Handler {
                                $title = db_escape_string(strip_tags($_REQUEST["title"]));
                                $url = db_escape_string(strip_tags($_REQUEST["url"]));
                                $content = db_escape_string(strip_tags($_REQUEST["content"]));
+                               $labels = db_escape_string(strip_tags($_REQUEST["labels"]));
 
-                               create_published_article($this->link, $title, $url, $content, $_SESSION["uid"]);
+                               create_published_article($this->link, $title, $url, $content, $labels,
+                                       $_SESSION["uid"]);
 
                                print "<script type='text/javascript'>";
                                print "window.close();";
@@ -424,9 +401,23 @@ class Handler_Public extends Handler {
                                <td><input name='url' value="<?php echo $url ?>"></td></tr>
                                <tr><td align='right'><?php echo __("Content:") ?></td>
                                <td><input name='content' value=""></td></tr>
+                               <tr><td align='right'><?php echo __("Labels:") ?></td>
+                               <td><input name='labels' id="labels_value"
+                                       placeholder='Alpha, Beta, Gamma' value="">
+                               </td></tr>
+
+                               <tr><td>
+                                       <div class="autocomplete" id="labels_choices"
+                                               style="display : block"></div></td></tr>
 
                                <script type='text/javascript'>document.forms[0].title.focus();</script>
 
+                               <script type='text/javascript'>
+                                       new Ajax.Autocompleter('labels_value', 'labels_choices',
+                                  "backend.php?op=rpc&method=completeLabels",
+                                  { tokens: ',', paramName: "search" });
+                               </script>
+
                                <tr><td colspan='2'>
                                        <div style='float : right' class='insensitive-small'>
                                        <?php echo __("Shared article will appear in the Published feed.") ?>
@@ -525,6 +516,10 @@ class Handler_Public extends Handler {
        }
 
        function subscribe() {
+               if (SINGLE_USER_MODE) {
+                       login_sequence($this->link);
+               }
+
                if ($_SESSION["uid"]) {
 
                        $feed_url = db_escape_string(trim($_REQUEST["feed_url"]));