summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2010-11-25 12:58:29 +0300
committerAndrew Dolgov <[email protected]>2010-11-25 12:58:29 +0300
commitba7e88e5a59295ac3eed38ea627e9fa2a414b989 (patch)
tree64c5475fcb5734b5f0a1758355b4174e1992ebc4 /modules
parent411fe209d642f64ee1f856908e6c1b4507893fcf (diff)
add tweet button to digest, misc digest fixes; rework article tweeting to use ajax loading of needed info
Diffstat (limited to 'modules')
-rw-r--r--modules/backend-rpc.php20
1 files changed, 20 insertions, 0 deletions
diff --git a/modules/backend-rpc.php b/modules/backend-rpc.php
index e7c1f5721..e93571207 100644
--- a/modules/backend-rpc.php
+++ b/modules/backend-rpc.php
@@ -982,6 +982,26 @@
return;
}
+ if ($subop == "getTweetInfo") {
+ header("Content-Type: text/html");
+ $id = db_escape_string($_REQUEST['id']);
+
+ $result = db_query($link, "SELECT title, link
+ FROM ttrss_entries, ttrss_user_entries
+ WHERE id = '$id' AND ref_id = id AND owner_uid = " .$_SESSION['uid']);
+
+ if (db_num_rows($result) != 0) {
+ $title = truncate_string(strip_tags(db_fetch_result($result, 0, 'title')),
+ 100, '...');
+ $article_link = db_fetch_result($result, 0, 'link');
+ }
+
+ print json_encode(array("title" => $title, "link" => $article_link,
+ "id" => $id));
+
+ return;
+ }
+
print "<rpc-reply><error>Unknown method: $subop</error></rpc-reply>";
}
?>