From 8361e724785767d57cd28be7ceaea7ad81fae0a2 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Sun, 9 Sep 2012 16:05:59 +0400 Subject: implement sharing of arbitrary stuff using bookmarklet and API call, bump API version --- classes/handler/public.php | 70 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) (limited to 'classes/handler/public.php') diff --git a/classes/handler/public.php b/classes/handler/public.php index 983f0aaa9..cd46fa033 100644 --- a/classes/handler/public.php +++ b/classes/handler/public.php @@ -306,5 +306,75 @@ class Handler_Public extends Handler { // Update all feeds needing a update. update_daemon_common($this->link, 0, true, false); } + + function sharepopup() { + header('Content-Type: text/html; charset=utf-8'); + print " + + Tiny Tiny RSS + + + + + "; + + $action = $_REQUEST["action"]; + + if ($_SESSION["uid"]) { + + if (!$action) { + + print ""; + + print ""; + + print ""; + print ""; + + $title = htmlspecialchars($_REQUEST["title"]); + $url = htmlspecialchars($_REQUEST["url"]); + + print ""; + print ""; + print ""; + + print ""; + + print "
"; + print "

Publish with Tiny Tiny RSS

"; + print "
".__("Title:")."
".__("URL:")."
".__("Content:")."
+ + + "; + + print ""; + print "
"; + + print ""; + + } else { + + $title = db_escape_string(strip_tags($_REQUEST["title"])); + $url = db_escape_string(strip_tags($_REQUEST["url"])); + $content = db_escape_string(strip_tags($_REQUEST["content"])); + + create_published_article($this->link, $title, $url, $content, $_SESSION["uid"]); + + print ""; + } + + } else { + + print "
" . __("Not logged in.") . "
"; + + } + } + } ?> -- cgit v1.2.3