Commit c5735dc5 authored by lucha's avatar lucha Committed by lechuck

updated Privacy Share Buttons plugin

parent 9632efbf
.social_share_privacy {clear:both; margin:0 auto; width:100%; margin-bottom:15px;}
.social_share_privacy_area {clear:both; margin:20px 0 !important; padding:0; height:25px; width:100%;}
.social_share_privacy_area li {margin:0 !important; padding:0; height:20px; float:left; list-style-type:none !important; list-style:none !important; background:none !important;}
.social_share_privacy_area li .dummy_btn {float:left; margin-left:10px; cursor:pointer; padding:0;}
.social_share_privacy {width:100%;}
.social_share_privacy_area ul {position:relative;}
.social_share_privacy_area li {float:left; list-style-type:none !important; list-style:none !important;}
.social_share_privacy_area li .dummy_btn {cursor:pointer;}
/* Facebook begin */
.social_share_privacy_area .facebook {width: 175px;}
.social_share_privacy_area .facebook .fb_edge_comment_widget {width:400px;}
/* .social_share_privacy_area .facebook div.dummy_btn {width: 150px;}
*//* Facebook end */
/* Tooltips */
.social_share_privacy .dropdown {border:1px solid #ccc; -moz-border-radius:4px; -webkit-border-radius:4px; border-radius:4px; -moz-box-shadow:0 3px 4px #999; -webkit-box-shadow:0 3px 4px #999; box-shadow:0 3px 4px #999; background-color:#F7F7F7; color:#000; z-index:500; padding:4px 5px; font-weight: bold;}
.social_share_privacy_area li {position:relative;}
.social_share_privacy_area li span.info {position:absolute; bottom:35px;}
/* Identica begin */
.social_share_privacy_area .identica {width:148px;}
/* identica end */
/* Info & Option dropdown */
.social_share_privacy_area .psb_info {position:absolute; bottom:8em; width:150px;}
.social_share_privacy_area #option-dropdown label.checked {color:#090;}
.social_share_privacy_area div#option-dropdown {position:absolute; bottom:-6em; float:left;}
/* Twitter begin */
.social_share_privacy_area .twitter {width:148px;}
.social_share_privacy_area li div.tweet {width:115px;}
/* Twitter end */
/* Services */
.social_share_privacy_area li div {width:100px;}
.social_share_privacy_area .twitter {width:80px;}
.social_share_privacy_area .facebook {width: 125px; padding-right:10px;}
.social_share_privacy_area .identica {width:125px;}
.ui-icon-identica { background-image: url("../images/identica-share-button.png") !important; }
.ui-icon-identica-dummy { background-image: url("../images/dummy_identica.png") !important; }
/* Google+ begin */
.social_share_privacy_area .gplus {width:123px;}
.social_share_privacy_area li div.gplusone {width:90px;}
/* Google+ end */
/* Flattr begin */
.social_share_privacy_area .flattr {width:148px;}
.social_share_privacy_area li div.flattrbtn {width:115px;}
/* Flattr end */
/* Switch begin */
.social_share_privacy_area li .switch {display: none; text-indent:-9999em; background:transparent url(../images/socialshareprivacy_on_off.png) no-repeat 0 0 scroll; width:23px; height:12px; overflow:hidden; float:left; margin:4px 0 0; cursor:pointer;}
.social_share_privacy_area li .switch.on {background-position:0 -12px;}
/* Switch end */
/* Tooltips begin */
.social_share_privacy_area li.help_info {position:relative; padding:0 !important; margin:10px 0 !important;}
.social_share_privacy_area li.help_info .info, .social_share_privacy_area li .help_info.icon .info {display:none; position:absolute; bottom:40px; left:-10px; width:290px; padding:10px 15px; font-size:12px; line-height:16px; font-weight:bold; border:1px solid #ccc; -moz-border-radius:4px; -webkit-border-radius:4px; border-radius:4px; -moz-box-shadow:0 3px 4px #999; -webkit-box-shadow:0 3px 4px #999; box-shadow:0 3px 4px #999; background-color:#fdfbec; color:#000; z-index:500;}
.social_share_privacy_area li .help_info.icon .info {left:-150px; width:350px;}
.social_share_privacy_area li.help_info.display .info, .social_share_privacy_area li .help_info.icon.display .info {display:block;}
.social_share_privacy_area li.help_info.info_off.display .info {display:none;}
.social_share_privacy_area li .help_info.icon {background:#fff url(../images/socialshareprivacy_info.png) no-repeat center center scroll; width:25px; height:20px; position:relative; display:inline-block; vertical-align:top; border:2px solid #e7e3e3; border-right-width:0; -moz-border-radius:5px 0 0 5px; -webkit-border-radius:5px 0 0 5px; border-radius:5px 0 0 5px;}
.social_share_privacy_area li.settings_info .settings_info_menu.on .help_info.icon {border-top-width:0; border-left-width:0;}
.social_share_privacy_area li.settings_info .settings_info_menu.perma_option_off .help_info.icon {border-right-width:2px; -moz-border-radius:5px; -webkit-border-radius:5px; border-radius:5px;}
/* Tooltips end */
/* Settings/Info begin */
.social_share_privacy_area li.settings_info {position:relative; top:8px; width:135px; overflow:visible;}
.social_share_privacy_area li.settings_info a {text-decoration:none; margin:0 !important;}
.social_share_privacy_area li.settings_info .settings_info_menu {background-color:#f3f4f5; border:2px solid #e7e3e3; -moz-border-radius:5px; -webkit-border-radius:5px; border-radius:5px; -moz-box-shadow:2px 2px 3px #c1c1c1; -webkit-box-shadow:2px 2px 3px #c1c1c1; box-shadow:3px 3px 3px #c1c1c1; left:0; position:absolute; top:0; width:135px; z-index:10;}
.social_share_privacy_area li.settings_info .settings_info_menu.off {border-width:0; -moz-box-shadow:none; -webkit-box-shadow:none; box-shadow:none; background-color:transparent; }
.social_share_privacy_area li.settings_info .settings_info_menu.off form {display:none;}
.social_share_privacy_area li.settings_info .settings_info_menu .settings {text-indent:-9999em; display:inline-block; background: #fff url(../images/settings.png) no-repeat center center scroll; width:25px; height:20px; border:2px solid #e7e3e3; -moz-border-radius:0 5px 5px 0; -webkit-border-radius:0 5px 5px 0; border-radius:0 5px 5px 0; border-left:1px solid #ddd;}
.social_share_privacy_area li.settings_info .settings_info_menu.on .settings {border-top-width:0;}
.social_share_privacy_area li.settings_info .settings_info_menu form fieldset {border-width: 0; margin:0; padding:0 10px 10px; }
.social_share_privacy_area li.settings_info .settings_info_menu form fieldset legend {font-size:11px; font-weight:bold; line-height:14px; margin:0; padding:10px 0; width:115px; color:#151515;}
.social_share_privacy_area li.settings_info .settings_info_menu form fieldset input {clear:both; float:left; margin:4px 10px 4px 0; width:auto;}
.social_share_privacy_area li.settings_info .settings_info_menu form fieldset label {display:inline-block; float:left; font-size:12px; font-weight:bold; line-height:24px; -moz-transition:color .5s ease-in; -webkit-transition:color .5s ease-in; transition:color .5s ease-in; color:#151515; margin-bottom:0px;}
.social_share_privacy_area li.settings_info .settings_info_menu form fieldset label.checked {color:#090;}
@media (max-width: 800px) {
.social_share_privacy_area .settings_info {clear: left;}
.count-o {
position: relative;
float: right;
top: 3px;
background: none repeat scroll 0 0 #fff;
border: 1px solid #bbb;
min-height: 18px;
min-width: 15px;
max-width: 30px;
text-align: center;
visibility: visible;
-moz-border-radius: 3px;
-webkit-border-radius: 3px;
border-radius: 3px;
margin: 0 0 0 5px;
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
-ms-box-sizing: border-box;
box-sizing: border-box;
}
/* Clearfix (as it will come in WP 3.4)
----------------------------------------------- */
.clearfix:after {content:"."; display:block; clear:both; visibility:hidden; line-height:0; height:0;}
.clearfix {display:inline-block;}
html[xmlns] .clearfix {display:block;}
* html .clearfix {height:1%;}
\ No newline at end of file
#count {
color: #333;
}
#count:hover, #count:focus {
color: #333;
text-decoration: underline;
}
.count-o i, .count-o u {
border: 4px transparent solid;
-moz-border-bottom-colors: none;
-moz-border-image: none;
-moz-border-left-colors: none;
-moz-border-right-colors: none;
-moz-border-top-colors: none;
border-color: transparent #aaa transparent -moz-use-text-color;
border-style: solid solid solid none;
border-width: 4px 4px 4px 0;
border-right-color: #aaa;
height: 0;
left: 0;
line-height: 0;
margin: -4px 0 0 -4px;
position: absolute;
top: 50%;
width: 0;
}
.count-o u {
border-right-color: #fff;
margin-left: -3px;
}
\ No newline at end of file
<?php
//
// Copyright (C) 2011 Jacob Barkdull, Roberto Guido
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
if (isset($_GET["source"])) {
header("Content-type: text/plain");
echo file_get_contents("." . $_SERVER["PHP_SELF"]);
die();
}
$server = $_SERVER["SERVER_NAME"];
if (isset($_SERVER["HTTP_REFERER"])) {
$referer = $_SERVER["HTTP_REFERER"];
$referringurl = str_replace(array("http://", "www."), "", $referer);
$jsondata = file_get_contents("http://identi.ca/api/search.json?q=" . $referringurl . "&rpp=100");
$results = substr_count($jsondata, str_replace("/", "\/", addslashes($referringurl)));
if ($results <= 0) {
$results = "0";
}
} else {
$results = "0";
$referer = "http://www.tildehash.com/";
}
$referer = str_replace(array("?", "&"), array("%3F", "%26"), $referer);
$referringurl = str_replace(array("?", "&"), array("%3F", "%26"), $referringurl);
$style = '<a href="http://identi.ca/index.php?action=newnotice&status_textarea=PAGE_TITLE_HERE' . $referer . '" target="_blank" style="display: inline-block; background-image: url(\'http://' . $server . '/identishare/share.png\'); background-repeat: no-repeat; width: 61px; height: 53px; padding: 10px 0px 0px 0px !important; margin: 0px !important; font-family: \'Arial\'; font-size: 20px; text-decoration: none; line-height: 1.2em; color: #000000; text-align: center;" title="Share on Identi.ca"><b style="float: none !important; margin: 0px !important;">' . $results . '</b></a>';
$style2 = <<<STYLE2
<div style="width: 130px; height: 23px; margin: 2px 0px 4px 0px;">
<div dir="ltr" style="position:relative">
<div style="height: 23px;">
<div>
<a href="http://identi.ca/index.php?action=newnotice&status_textarea=PAGE_TITLE_HERE${referer}" target="_blank" style="display: inline-block; background-image: url('identishare/button.png'); font-family: arial; text-decoration: none; line-height: 1.2em; color: #000000; width: 50px; height: 20px;" title="Share on Identi.ca"></a>
</div>
<div style="position: absolute; top: 1px; left:51px; background: no-repeat url('identishare/bubble-right.png'); height: 23px; width: 50px; text-align: center; overflow: hidden; font-size: 12px; padding-top:1px;">
<a href="http://identi.ca/search/notice?q=${referringurl}&search=Search" target="_blank" style="vertical-align: top; color: #666666; font-family: 'Arial',sans-serif; text-decoration:none; padding-right:8px"><b>$results</b></a>
</div>
</div>
</div>
</div>
STYLE2;
if (isset($_GET["style2"])) {
$style = $style2;
}
if (!isset($_GET["noscript"])) {
$style = str_replace(array("\n", "\t"), "", addslashes($style));
}
if (isset($_GET["title"])) {
$style = str_replace("PAGE_TITLE_HERE", str_replace(array("?", "&"), array("%3F", "%26"), $_GET["title"]) . " ", $style);
} else {
if (!isset($_GET["noscript"])) {
$style = str_replace("PAGE_TITLE_HERE", '"+document.title+" - ', $style);
} else {
$style = str_replace("PAGE_TITLE_HERE", "", $style);
}
}
$html = <<<HTML
<html>
<head>
<title>Share on Identi.ca</title>
</head>
<body marginwidth="0" marginheight="0">
${style}
</body>
</html>
HTML;
if (isset($_GET["noscript"])) {
echo $html;
} else {
header("Content-type: text/javascript");
echo 'document.getElementById("identishare").style.display="inline-block";'."\n";
echo 'document.getElementById("identishare").style.width="140px";'."\n";
echo 'document.getElementById("identishare").style.overflow="hidden";'."\n";
echo 'document.getElementById("identishare").innerHTML="' . $style . '";';
}
?>
......@@ -39,8 +39,8 @@ class ShareButton {
$this->css = $this->url .'/css/socialshareprivacy.css';
$this->js = $this->url .'/js/jquery.privacysharebuttons.min.js';
$this->jquery_cookie = $this->url .'/js/jquery.cookie.min.js';
$this->jquery_ui_css = 'http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.21/themes/base/jquery-ui.css';
$this->images = $this->url .'/images/';
$this->libs = $this->url .'/libs/';
$this->services = array(
'twitter' => array(
'name' => 'Twitter',
......@@ -53,9 +53,8 @@ class ShareButton {
),
'identica' => array(
'name' => 'Identi.ca',
// 'specific-settings' => true,
// 'username' => 'reply_to',
'lib' => 'identishare.php',
'specific-settings' => true,
'username' => 'reply_to',
'jsconf' => array(
'txt_info' => __('Click here to enable the button','privacy-share-buttons')
......@@ -83,9 +82,7 @@ class ShareButton {
*/
);
$this->js_conf_default = array(
'txt_help' => __('When you activate these buttons by clicking on them, '
. 'some of your personal data will be transferred to third parties and can be stored by them. '
. 'For more information click on the <em> i </em>','privacy-share-buttons'),
'txt_help' => __('When you activate these buttons by clicking on them, some of your personal data will be transferred to third parties and can be stored by them. More information <em> <a href="https://github.com/controesempio/Privacy-Share-Buttons"> here</a></em>.','privacy-share-buttons'),
'settings_perma' => __('Permanently enable data transfer for:','privacy-share-buttons'),
);
$this->settings = new ShareButtonSettings($this->services);
......@@ -112,12 +109,13 @@ class ShareButton {
}
function enqueue_scripts() {
wp_register_script('jquery-cookie',$this->jquery_cookie);
wp_enqueue_script('social-share-privacy',$this->js,array('jquery','jquery-cookie'));
wp_register_script('jquery-cookie',$this->jquery_cookie,array('jquery'));
wp_enqueue_script('social-share-privacy',$this->js,array('jquery','jquery-cookie','jquery-ui-core','jquery-ui-button'));
wp_localize_script('social-share-privacy','socialshareprivacy_settings',$this->jsconf());
}
function enqueue_styles() {
wp_enqueue_style('jquery-ui',$this->jquery_ui_css);
wp_enqueue_style('privacy-share-buttons',$this->css);
}
......@@ -159,15 +157,13 @@ class ShareButton {
$conf['services'][$service]['dummy_img'] = $this->images.'dummy_'.$service.'.png';
if ($info['username'])
$conf['services'][$service][$info['username']] = $this->settings[$service.'-username'];
if ($info['lib'])
$conf['services'][$service][$service.'_lib'] = $this->libs . $info['lib'];
if ($info['jsconf'])
$conf['services'][$service] = array_merge($conf['services'][$service],$info['jsconf']);
} else {
$conf['services'][$service]['status'] = 'off';
// $conf['services'][$service]['status'] = 'off';
}
}
$conf['uri'] = get_permalink();
// $conf['uri'] = get_permalink();
return $conf;
}
}
......@@ -256,7 +252,7 @@ class ShareButtonSettings {
function username_field($id) {
$field = $this->settings_section."[$id]";
$value = $this->settings[$id];
echo "<input type='text' name='{$field}' value='{$value}' size='20' />";
echo "@<input type='text' name='{$field}' value='{$value}' size='20' />";
}
function add_default_fields($serviceid, $info) {
......@@ -339,4 +335,4 @@ class ShareButtonSettings {
}
}
new ShareButton();
\ No newline at end of file
new ShareButton();
......@@ -16,10 +16,6 @@ they are activated and become the real buttons. This allows to give control to t
sensible personal information to third-parties sites, and thus providing a nice compromise between privacy and social sharing.
* Stable tag should indicate the Subversion "tag" of the latest stable version, or "trunk," if you use `/trunk/` for
stable.
== Installation ==
1. Upload `privacy-share-buttons` to the `/wp-content/plugins/` directory
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment