From: Andrew Dolgov Date: Wed, 27 Mar 2013 11:18:38 +0000 (+0400) Subject: split several social plugins from trunk to separate optional downloads (see forum) X-Git-Tag: 1.7.6~246 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=9d46d280b1f611904080ace89e48e0970b03be43;p=tt-rss.git split several social plugins from trunk to separate optional downloads (see forum) --- diff --git a/plugins/flattr/flattr.png b/plugins/flattr/flattr.png deleted file mode 100644 index 4933ffc2..00000000 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 b9101988..00000000 --- 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 027d9b40..00000000 --- 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 ac46126d..00000000 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 6045d2df..00000000 --- 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 d31fc55f..00000000 --- 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 ee3cb61e..00000000 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 8e0ad4b9..00000000 --- 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 5d215b38..00000000 --- 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 df929e01..00000000 --- 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 d31ba924..00000000 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 11fe64eb..00000000 --- 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 01c525f5..00000000 --- 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 b85aed3c..00000000 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 e96d0800..00000000 --- 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 021d5bb0..00000000 --- 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 ff6bc85a..00000000 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 bbcf7836..00000000 --- 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 07e89d5f..00000000 --- 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 ad3c177a..00000000 Binary files a/plugins/tweet/tweet.png and /dev/null differ