summaryrefslogtreecommitdiff
path: root/modules/backend-rpc.php
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2010-11-13 02:09:30 +0300
committerAndrew Dolgov <[email protected]>2010-11-13 02:09:30 +0300
commitdd1c068056bc6ac18a4832f7c7dd4376c17f9b14 (patch)
tree1e6944a05ffd1aa7a5cf50d793d372e01c06769b /modules/backend-rpc.php
parent62b800b47cadf623dfd0178554a1d7251f5b979e (diff)
implement ajax loading of cdm content when not in expand mode
Diffstat (limited to 'modules/backend-rpc.php')
-rw-r--r--modules/backend-rpc.php27
1 files changed, 27 insertions, 0 deletions
diff --git a/modules/backend-rpc.php b/modules/backend-rpc.php
index 874f547c3..a6d495feb 100644
--- a/modules/backend-rpc.php
+++ b/modules/backend-rpc.php
@@ -1146,6 +1146,33 @@
return;
}
+ if ($subop == "cdmGetArticle") {
+ $id = db_escape_string($_REQUEST["id"]);
+
+ $result = db_query($link, "SELECT content,
+ ttrss_feeds.site_url AS site_url FROM ttrss_user_entries, ttrss_feeds,
+ ttrss_entries
+ WHERE feed_id = ttrss_feeds.id AND ref_id = '$id' AND
+ ttrss_entries.id = ref_id AND
+ ttrss_user_entries.owner_uid = ".$_SESSION["uid"]);
+
+ if (db_num_rows($result) != 0) {
+ $line = db_fetch_assoc($result);
+
+ $article_content = sanitize_rss($link, $line["content"],
+ false, false, $line['site_url']);
+
+ } else {
+ $article_content = '';
+ }
+
+ print "<rpc-reply><article id=\"$id\"><![CDATA[";
+ print "$article_content";
+ print "]]></article></rpc-reply>";
+
+ return;
+ }
+
print "<rpc-reply><error>Unknown method: $subop</error></rpc-reply>";
}
?>