summaryrefslogtreecommitdiff
path: root/api
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2009-12-17 13:35:25 +0300
committerAndrew Dolgov <[email protected]>2009-12-17 13:35:25 +0300
commitd5e71621fe571dae203094fd42d8fc9c83a2d483 (patch)
tree4e6926a7f0c856d6601869ae367580089c80671e /api
parentb792cd703ac554c611891b0f1a092034813c9b7c (diff)
api: add show_content to getHeadlines to allow CDM-styled operation
Diffstat (limited to 'api')
-rw-r--r--api/index.php11
1 files changed, 8 insertions, 3 deletions
diff --git a/api/index.php b/api/index.php
index 5c1efd15e..c9d134df1 100644
--- a/api/index.php
+++ b/api/index.php
@@ -201,7 +201,8 @@
$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 */
@@ -231,11 +232,15 @@
"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);
}