]> git.wh0rd.org Git - tt-rss.git/commitdiff
api: add show_content to getHeadlines to allow CDM-styled operation
authorAndrew Dolgov <fox@bah.org.ru>
Thu, 17 Dec 2009 10:35:25 +0000 (13:35 +0300)
committerAndrew Dolgov <fox@bah.org.ru>
Thu, 17 Dec 2009 10:35:25 +0000 (13:35 +0300)
api/index.php

index 5c1efd15e97797d5b448a1e5a19179fc8ad92a42..c9d134df12e6bcb25809c21dabf7c8615616c127 100644 (file)
                        $limit = (int)db_escape_string($_REQUEST["limit"]);
                        $filter = db_escape_string($_REQUEST["filter"]);
                        $is_cat = (bool)db_escape_string($_REQUEST["is_cat"]);
-                       $show_except = (bool)db_escape_string($_REQUEST["show_excerpt"]);
+                       $show_excerpt = (bool)db_escape_string($_REQUEST["show_excerpt"]);
+                       $show_content = (bool)db_escape_string($_REQUEST["show_content"]);
 
                        /* do not rely on params below */
 
                                                "feed_id" => $line["feed_id"],
                                        );
 
-                               if ($show_except) {
+                               if ($show_excerpt) {
                                        $excerpt = truncate_string(strip_tags($line["content_preview"]), 100);
                                        $headline_row["excerpt"] = $excerpt;
                                }
-                       
+
+                               if ($show_content) {
+                                       $headline_row["content"] = $line["content_preview"];
+                               }
+
                                array_push($headlines, $headline_row);
                        }