From 9d46d280b1f611904080ace89e48e0970b03be43 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Wed, 27 Mar 2013 15:18:38 +0400 Subject: split several social plugins from trunk to separate optional downloads (see forum) --- plugins/flattr/flattr.png | Bin 693 -> 0 bytes plugins/flattr/init.php | 46 ------------------ plugins/googleplus/googleplus.js | 29 ------------ plugins/googleplus/googleplus.png | Bin 3295 -> 0 bytes plugins/googleplus/init.php | 53 --------------------- plugins/identica/identica.js | 31 ------------ plugins/identica/identica.png | Bin 121 -> 0 bytes plugins/identica/init.php | 53 --------------------- plugins/owncloud/init.php | 96 -------------------------------------- plugins/owncloud/owncloud.js | 27 ----------- plugins/owncloud/owncloud.png | Bin 625 -> 0 bytes plugins/pinterest/init.php | 53 --------------------- plugins/pinterest/pinterest.js | 31 ------------ plugins/pinterest/pinterest.png | Bin 3829 -> 0 bytes plugins/pocket/init.php | 54 --------------------- plugins/pocket/pocket.js | 31 ------------ plugins/pocket/pocket.png | Bin 471 -> 0 bytes plugins/tweet/init.php | 53 --------------------- plugins/tweet/tweet.js | 31 ------------ plugins/tweet/tweet.png | Bin 159 -> 0 bytes 20 files changed, 588 deletions(-) delete mode 100644 plugins/flattr/flattr.png delete mode 100644 plugins/flattr/init.php delete mode 100644 plugins/googleplus/googleplus.js delete mode 100644 plugins/googleplus/googleplus.png delete mode 100644 plugins/googleplus/init.php delete mode 100644 plugins/identica/identica.js delete mode 100644 plugins/identica/identica.png delete mode 100644 plugins/identica/init.php delete mode 100644 plugins/owncloud/init.php delete mode 100644 plugins/owncloud/owncloud.js delete mode 100644 plugins/owncloud/owncloud.png delete mode 100644 plugins/pinterest/init.php delete mode 100644 plugins/pinterest/pinterest.js delete mode 100644 plugins/pinterest/pinterest.png delete mode 100644 plugins/pocket/init.php delete mode 100644 plugins/pocket/pocket.js delete mode 100644 plugins/pocket/pocket.png delete mode 100644 plugins/tweet/init.php delete mode 100644 plugins/tweet/tweet.js delete mode 100644 plugins/tweet/tweet.png diff --git a/plugins/flattr/flattr.png b/plugins/flattr/flattr.png deleted file mode 100644 index 4933ffc21..000000000 Binary files a/plugins/flattr/flattr.png and /dev/null differ diff --git a/plugins/flattr/init.php b/plugins/flattr/init.php deleted file mode 100644 index b91019880..000000000 --- a/plugins/flattr/init.php +++ /dev/null @@ -1,46 +0,0 @@ -link = $host->get_link(); - $this->host = $host; - - $host->add_hook($host::HOOK_ARTICLE_BUTTON, $this); - } - - function about() { - return array(1.1, - "Share articles on Flattr (if they exist in their catalogue)", - "F. Eitel, N. Honing"); - } - - function hook_article_button($line) { - - $rv = ""; - $article_link = $line['link']; - - if ($article_link) { - $encoded = urlencode($article_link); - $r = file_get_contents("https://api.flattr.com/rest/v2/things/lookup/?url=$encoded"); - $response = json_decode($r, true); - $image = ""; - // if Flattr has it in the catalogue, we display the button - if ($response and array_key_exists('link', $response)) { - $rv = " . $image . "; - } else { - // We can't submit a thing to the catalogue without giving a Flattr user id (who would be the owner) - // see http://developers.flattr.net/auto-submit - //$rv = "" . $image . ""; - $rv = ''; - // Another useful thing would be any rel=payment link (which would have the user id as well), - // but tt-rss is not checking that (yet), I believe. See http://developers.flattr.net/feed - } - } - return $rv; - } -} -?> diff --git a/plugins/googleplus/googleplus.js b/plugins/googleplus/googleplus.js deleted file mode 100644 index 027d9b40e..000000000 --- a/plugins/googleplus/googleplus.js +++ /dev/null @@ -1,29 +0,0 @@ - function shareArticleToGooglePlus(id) { - try { - var query = "?op=pluginhandler&plugin=googleplus&method=getInfo&id=" + param_escape(id); - - console.log(query); - - var d = new Date(); - var ts = d.getTime(); - - var w = window.open('backend.php?op=backend&method=loading', 'ttrss_tweet', - "status=0,toolbar=0,location=0,width=500,height=450,scrollbars=1,menubar=0"); - - new Ajax.Request("backend.php", { - parameters: query, - onComplete: function(transport) { - var ti = JSON.parse(transport.responseText); - - var share_url = "https://plus.google.com/share?url=" + param_escape(ti.link); - - w.location.href = share_url; - - } }); - - - } catch (e) { - exception_error("tweetArticle", e); - } - } - diff --git a/plugins/googleplus/googleplus.png b/plugins/googleplus/googleplus.png deleted file mode 100644 index ac46126d7..000000000 Binary files a/plugins/googleplus/googleplus.png and /dev/null differ diff --git a/plugins/googleplus/init.php b/plugins/googleplus/init.php deleted file mode 100644 index 6045d2df6..000000000 --- a/plugins/googleplus/init.php +++ /dev/null @@ -1,53 +0,0 @@ -link = $host->get_link(); - $this->host = $host; - - $host->add_hook($host::HOOK_ARTICLE_BUTTON, $this); - } - - function about() { - return array(1.0, - "Share article on Google+", - "homolibere"); - } - - function get_js() { - return file_get_contents(dirname(__FILE__) . "/googleplus.js"); - } - - function hook_article_button($line) { - $article_id = $line["id"]; - - $rv = ""; - - return $rv; - } - - function getInfo() { - $id = db_escape_string($this->link, $_REQUEST['id']); - - $result = db_query($this->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)); - } - - -} -?> diff --git a/plugins/identica/identica.js b/plugins/identica/identica.js deleted file mode 100644 index d31fc55f4..000000000 --- a/plugins/identica/identica.js +++ /dev/null @@ -1,31 +0,0 @@ - function shareArticleToIdentica(id) { - try { - var query = "?op=pluginhandler&plugin=identica&method=getInfo&id=" + param_escape(id); - - console.log(query); - - var d = new Date(); - var ts = d.getTime(); - - var w = window.open('backend.php?op=backend&method=loading', 'ttrss_tweet', - "status=0,toolbar=0,location=0,width=600,height=500,scrollbars=1,menubar=0"); - - new Ajax.Request("backend.php", { - parameters: query, - onComplete: function(transport) { - var ti = JSON.parse(transport.responseText); - - var share_url = "http://identi.ca/index.php?action=bookmarkpopup&_=" + ts + - "&title=" + param_escape(ti.title) + - "&url=" + param_escape(ti.link); - - w.location.href = share_url; - - } }); - - - } catch (e) { - exception_error("shareArticleIdentica", e); - } - } - diff --git a/plugins/identica/identica.png b/plugins/identica/identica.png deleted file mode 100644 index ee3cb61ea..000000000 Binary files a/plugins/identica/identica.png and /dev/null differ diff --git a/plugins/identica/init.php b/plugins/identica/init.php deleted file mode 100644 index 8e0ad4b9a..000000000 --- a/plugins/identica/init.php +++ /dev/null @@ -1,53 +0,0 @@ -link = $host->get_link(); - $this->host = $host; - - $host->add_hook($host::HOOK_ARTICLE_BUTTON, $this); - } - - function about() { - return array(1.0, - "Share articles on Identi.ca", - "fox"); - } - - function get_js() { - return file_get_contents(dirname(__FILE__) . "/identica.js"); - } - - function hook_article_button($line) { - $article_id = $line["id"]; - - $rv = ""; - - return $rv; - } - - function getInfo() { - $id = db_escape_string($this->link, $_REQUEST['id']); - - $result = db_query($this->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)); - } - - -} -?> diff --git a/plugins/owncloud/init.php b/plugins/owncloud/init.php deleted file mode 100644 index 5d215b386..000000000 --- a/plugins/owncloud/init.php +++ /dev/null @@ -1,96 +0,0 @@ -link = $host->get_link(); - $this->host = $host; - - $host->add_hook($host::HOOK_ARTICLE_BUTTON, $this); - $host->add_hook($host::HOOK_PREFS_TAB, $this); - } - - function save() { - $owncloud_url = db_escape_string($this->link, $_POST["owncloud_url"]); - $this->host->set($this, "owncloud", $owncloud_url); - echo "Value set to $owncloud_url"; - } - - function get_js() { - return file_get_contents(dirname(__FILE__) . "/owncloud.js"); - } - - function hook_prefs_tab($args) { - if ($args != "prefPrefs") return; - - print "
"; - - print "
"; - - $value = $this->host->get($this, "owncloud"); - print "
"; - - print ""; - - print ""; - print ""; - print ""; - print ""; - print ""; - print ""; - print "
".__("Owncloud url")."
"; - print "

"; - - print "

"; - - print "
"; #pane - - } - - function hook_article_button($line) { - return ""; - } - - function getOwnCloud() { - $id = db_escape_string($this->link, $_REQUEST['id']); - - $result = db_query($this->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'); - } - - $own_url = $this->host->get($this, "owncloud"); - - print json_encode(array("title" => $title, "link" => $article_link, - "id" => $id, "ownurl" => $own_url)); - } -} -?> diff --git a/plugins/owncloud/owncloud.js b/plugins/owncloud/owncloud.js deleted file mode 100644 index df929e015..000000000 --- a/plugins/owncloud/owncloud.js +++ /dev/null @@ -1,27 +0,0 @@ -function ownArticle(id) { - try { - var query = "?op=pluginhandler&plugin=owncloud&method=getOwnCloud&id=" + param_escape(id); - - console.log(query); - - var d = new Date(); - var ts = d.getTime(); - - var w = window.open('backend.php?op=backend&method=loading', 'ttrss_tweet', - "status=0,toolbar=0,location=0,width=600,height=500,scrollbars=1,menubar=0"); - - new Ajax.Request("backend.php", { - parameters: query, - onComplete: function(transport) { - var ti = JSON.parse(transport.responseText); - - var share_url = ti.ownurl + "/apps/bookmarks/addBm.php?output=popup&url=" + param_escape(ti.link) - + '&title=' + ti.title; - - w.location.href = share_url; - } }); - } catch (e) { - exception_error("ownArticle", e); - } -} - diff --git a/plugins/owncloud/owncloud.png b/plugins/owncloud/owncloud.png deleted file mode 100644 index d31ba924b..000000000 Binary files a/plugins/owncloud/owncloud.png and /dev/null differ diff --git a/plugins/pinterest/init.php b/plugins/pinterest/init.php deleted file mode 100644 index 11fe64eb5..000000000 --- a/plugins/pinterest/init.php +++ /dev/null @@ -1,53 +0,0 @@ -link = $host->get_link(); - $this->host = $host; - - $host->add_hook($host::HOOK_ARTICLE_BUTTON, $this); - } - - function get_js() { - return file_get_contents(dirname(__FILE__) . "/pinterest.js"); - } - - function hook_article_button($line) { - $article_id = $line["id"]; - - $rv = ""; - - return $rv; - } - - function getInfo() { - $id = db_escape_string($this->link, $_REQUEST['id']); - - $result = db_query($this->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)); - } - - -} -?> diff --git a/plugins/pinterest/pinterest.js b/plugins/pinterest/pinterest.js deleted file mode 100644 index 01c525f55..000000000 --- a/plugins/pinterest/pinterest.js +++ /dev/null @@ -1,31 +0,0 @@ - function pinterest(id) { - try { - var query = "?op=pluginhandler&plugin=pinterest&method=getInfo&id=" + param_escape(id); - - console.log(query); - - var d = new Date(); - var ts = d.getTime(); - - var w = window.open('backend.php?op=backend&method=loading', 'ttrss_tweet', - "status=0,toolbar=0,location=0,width=650,height=600,scrollbars=1,menubar=0"); - - new Ajax.Request("backend.php", { - parameters: query, - onComplete: function(transport) { - var ti = JSON.parse(transport.responseText); - - var share_url = "http://pinterest.com/pin/create/button/?" + - "url=" + param_escape(ti.link) + - "&description=" + param_escape(ti.title); - - w.location.href = share_url; - - } }); - - - } catch (e) { - exception_error("tweetArticle", e); - } - } - diff --git a/plugins/pinterest/pinterest.png b/plugins/pinterest/pinterest.png deleted file mode 100644 index b85aed3cd..000000000 Binary files a/plugins/pinterest/pinterest.png and /dev/null differ diff --git a/plugins/pocket/init.php b/plugins/pocket/init.php deleted file mode 100644 index e96d08001..000000000 --- a/plugins/pocket/init.php +++ /dev/null @@ -1,54 +0,0 @@ -link = $host->get_link(); - $this->host = $host; - - $host->add_hook($host::HOOK_ARTICLE_BUTTON, $this); - } - - function get_js() { - return file_get_contents(dirname(__FILE__) . "/pocket.js"); - } - - function hook_article_button($line) { - $article_id = $line["id"]; - - $rv = ""; - - return $rv; - } - - function getInfo() { - $id = db_escape_string($this->link, $_REQUEST['id']); - - $result = db_query($this->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)); - } - - -} -?> diff --git a/plugins/pocket/pocket.js b/plugins/pocket/pocket.js deleted file mode 100644 index 021d5bb05..000000000 --- a/plugins/pocket/pocket.js +++ /dev/null @@ -1,31 +0,0 @@ - function shareArticleToPocket(id) { - try { - var query = "?op=pluginhandler&plugin=pocket&method=getInfo&id=" + param_escape(id); - - console.log(query); - - var d = new Date(); - var ts = d.getTime(); - - var w = window.open('backend.php?op=backend&method=loading', 'ttrss_tweet', - "status=0,toolbar=0,location=0,width=500,height=400,scrollbars=1,menubar=0"); - - new Ajax.Request("backend.php", { - parameters: query, - onComplete: function(transport) { - var ti = JSON.parse(transport.responseText); - - var share_url = "https://getpocket.com/save?" + - "&title=" + param_escape(ti.title) + - "&url=" + param_escape(ti.link); - - w.location.href = share_url; - - } }); - - - } catch (e) { - exception_error("tweetArticle", e); - } - } - diff --git a/plugins/pocket/pocket.png b/plugins/pocket/pocket.png deleted file mode 100644 index ff6bc85a4..000000000 Binary files a/plugins/pocket/pocket.png and /dev/null differ diff --git a/plugins/tweet/init.php b/plugins/tweet/init.php deleted file mode 100644 index bbcf7836c..000000000 --- a/plugins/tweet/init.php +++ /dev/null @@ -1,53 +0,0 @@ -link = $host->get_link(); - $this->host = $host; - - $host->add_hook($host::HOOK_ARTICLE_BUTTON, $this); - } - - function about() { - return array(1.0, - "Share article on Twitter", - "fox"); - } - - function get_js() { - return file_get_contents(dirname(__FILE__) . "/tweet.js"); - } - - function hook_article_button($line) { - $article_id = $line["id"]; - - $rv = ""; - - return $rv; - } - - function getInfo() { - $id = db_escape_string($this->link, $_REQUEST['id']); - - $result = db_query($this->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)); - } - - -} -?> diff --git a/plugins/tweet/tweet.js b/plugins/tweet/tweet.js deleted file mode 100644 index 07e89d5f8..000000000 --- a/plugins/tweet/tweet.js +++ /dev/null @@ -1,31 +0,0 @@ - function tweetArticle(id) { - try { - var query = "?op=pluginhandler&plugin=tweet&method=getInfo&id=" + param_escape(id); - - console.log(query); - - var d = new Date(); - var ts = d.getTime(); - - var w = window.open('backend.php?op=backend&method=loading', 'ttrss_tweet', - "status=0,toolbar=0,location=0,width=500,height=400,scrollbars=1,menubar=0"); - - new Ajax.Request("backend.php", { - parameters: query, - onComplete: function(transport) { - var ti = JSON.parse(transport.responseText); - - var share_url = "http://twitter.com/share?_=" + ts + - "&text=" + param_escape(ti.title) + - "&url=" + param_escape(ti.link); - - w.location.href = share_url; - - } }); - - - } catch (e) { - exception_error("tweetArticle", e); - } - } - diff --git a/plugins/tweet/tweet.png b/plugins/tweet/tweet.png deleted file mode 100644 index ad3c177a2..000000000 Binary files a/plugins/tweet/tweet.png and /dev/null differ -- cgit v1.2.3