Browse files

adding ver 4.2.2 from http://plugins.svn.wordpress.org/sociable/tags/…

  • Loading branch information...
1 parent 8bc33ed commit ab1ec33f749a92dbb38042748a84ba1c99632678 Matt Richmond committed Feb 15, 2012
View
81 css/sociable-admin.css
@@ -1,78 +1,159 @@
.sociablemenu li {
+
+
}
+
#sociable_site_list {
+
list-style-type: none;
+
margin: 0 auto;
+
padding: 0;
+
font-size: 80%;
+
+
}
+
#sociable_site_list li {
+
list-style-type: none;
+
cursor: move;
+
float: left;
+
margin: 2px 2px 0 0;
+
width: 153px;
+
height:45px;
+
text-align: left;
+
font-size: 10px;
+
padding: 4px;
+
+
}
+
#sociable_site_list li img {
+
margin-right:6px;
+
}
+
#sociable_site_list .active {
+
+
behavior: url('../wp-content/plugins/sociable/css/pie.htc');
+
-moz-border-radius: 5px;
+
-webkit-border-radius: 5px;
+
border-radius: 5px 5px 5px 5px;
+
background:#6da6d1;
+
+
}
+
#sociable_site_list .active img {
+
opacity: 1;
+
-moz-opacity: 1;
+
filter:alpha(opacity=100);
+
+
}
+
#sociable_site_list .inactive {
+
+
behavior: url('../wp-content/plugins/sociable/css/pie.htc');
+
-moz-border-radius: 5px;
+
-webkit-border-radius: 5px;
+
border-radius: 5px 5px 5px 5px;
+
background:#dddddd;
+
+
+
}
+
#sociable_site_list .inactive img {
+
opacity: .4;
+
-moz-opacity: .4;
+
filter:alpha(opacity=40);
+
+
}
+
#sociable_site_list li input {
+
height: 12px;
+
margin: 0 5px 8px 0;
+
padding: 0;
+
background: transparent;
+
border: none;
+
}
+
+
.soc_clear{
+
clear:both;
+
}
+
+
.items_li{
+
font-size:16px;
+
}
+
.sub_item_li {
margin-bottom: 16px;
+
margin-left: 54px;
+
margin-top: 6px;
+
font-size: 14px;
+
+}
+
+.default_values{
+ font-size: 9px;
+ color: #000000;
+ text-decoration: none;
}
View
583 css/toolbar.css
@@ -1,159 +1,424 @@
-
-
-.wpSocciableSmall-top{
-
- background-image:url('../images/toolbar/slide-sociable-top.png');
-
- width:62px;
-
- height:17px;
-
- background-repeat:no-repeat;
-
- border-left:solid 0px #ffffff;
-
- background-color:transparent;
-
- cursor:pointer;
-
-}
-
-.wpSocciableSmall-top-c{
-
- background-image:url('../images/toolbar/slide-sociable-top-c.png');
-
- width:70px;
-
- background-color:transparent;
-
- height:20px;
-
- border:solid 0px #ffffff;
-
- border-bottom:0px;
-
- cursor:pointer;
-
-}
-
-
-
-
-
-
-
-.wpSocciableSmall{/*
-
- background-image:url('../images/toolbar/slide-sociable.png');*/
-
- width:19px;
-
- height:66px;
-
- background-color:transparent;
-
- margin-left:-19px;
-
- /*width:30px;*/
-
- /*height:104px;*/
-
- /*margin-left:-27px;*/
-
- position:absolute;
-
- margin-top:120px;
-
- cursor:pointer;
-
-}
-
-
-
-
-
-.wpSocciableSmall-c{/*
-
- background-image:url('../images/toolbar/slide-sociable-c.png');*/
-
- width:19px;
-
- background-color:transparent;
-
- height:66px;
-
- margin-left:-18px;
-
- position:absolute;
-
- margin-top:120px;
-
- cursor:pointer;
-
-}
-
-
-
-
-
-
-
-.wpSocciableClose{
-
- /*background-image:url('../images/toolbar/slide-close.png');*/
-
- width:19px;
-
- height:17px;
-
- background-color:transparent;
-
- margin-left:-19px;
-
-
-
- position:absolute;
-
- margin-top:90px;
-
- cursor:pointer;
-
-}
-
-
-
-.wpSocciableClose-c{
-
- background-image:url('../images/toolbar/slide-close-c.png');
-
- width:19px;
-
- background-color:transparent;
-
- height:17px;
-
- margin-left:-18px;
-
- position:absolute;
-
- margin-top:90px;
-
- cursor:pointer;
-
-}
-
-.wpSocciableBig{
-
- background-image:url('../images/toolbar/slide-sociableBig.png');
-
- width:30px;
-
- background-color:transparent;
-
- height:104px;
-
- margin-left:-19px;
-
- position:absolute;
-
- margin-top:120px;
+
+
+
+.wpSocciableSmall-top{
+
+
+ background-image:url('../images/toolbar/slide-sociable-top.png');
+
+
+ width:62px;
+
+
+ height:17px;
+
+
+ background-repeat:no-repeat;
+
+
+ border-left:solid 0px #ffffff;
+
+
+ background-color:transparent;
+
+
+ cursor:pointer;
+
+
+}
+
+
+.wpSocciableSmall-top-c{
+
+
+ background-image:url('../images/toolbar/slide-sociable-top-c.png');
+
+
+ width:70px;
+
+
+ background-color:transparent;
+
+
+ height:20px;
+
+
+ border:solid 0px #ffffff;
+
+
+ border-bottom:0px;
+
+
+ cursor:pointer;
+
+
+}
+
+.wpSocciableSmall{/*
+
+
+ background-image:url('../images/toolbar/slide-sociable.png');*/
+
+
+ width:19px;
+
+
+ height:66px;
+
+
+ background-color:transparent;
+
+
+ margin-left:-19px;
+
+
+ /*width:30px;*/
+
+
+ /*height:104px;*/
+
+
+ /*margin-left:-27px;*/
+
+
+ position:absolute;
+
+
+ margin-top:120px;
+
+
+ cursor:pointer;
+
+
+}
+
+
+.wpSocciableSmall-c{/*
+
+
+ background-image:url('../images/toolbar/slide-sociable-c.png');*/
+
+
+ width:19px;
+
+
+ background-color:transparent;
+
+
+ height:66px;
+
+
+ margin-left:-18px;
+
+
+ position:absolute;
+
+
+ margin-top:120px;
+
+
+ cursor:pointer;
+
+
+}
+
+.wpSocciableClose{
+
+
+ /*background-image:url('../images/toolbar/slide-close.png');*/
+
+
+ width:19px;
+
+
+ height:17px;
+
+
+ background-color:transparent;
+
+
+ margin-left:-19px;
+
+ position:absolute;
+
+
+ margin-top:90px;
+
+
+ cursor:pointer;
+
+
+}
+
+
+.wpSocciableClose-c{
+
+
+ background-image:url('../images/toolbar/slide-close-c.png');
+
+
+ width:19px;
+
+
+ background-color:transparent;
+
+
+ height:17px;
+
+
+ margin-left:-18px;
+
+
+ position:absolute;
+
+
+ margin-top:90px;
+
+
+ cursor:pointer;
+
+
+}
+
+
+.wpSocciableBig{
+
+
+ background-image:url('../images/toolbar/slide-sociableBig.png');
+
+
+ width:30px;
+
+
+ background-color:transparent;
+
+
+ height:104px;
+
+
+ margin-left:-19px;
+
+
+ position:absolute;
+
+
+ margin-top:120px;
+
+
+ cursor:pointer;
+
+
+}
+
+.wpSocciableBig-c{
+
+
+ background-image:url('../images/toolbar/slide-sociableBig-c.png');
+
+
+ width:30px;
+
+
+ height:104px;
+
+
+ background-color:transparent;
+
+
+ margin-left:-19px;
+
+
+ position:absolute;
+
+
+ margin-top:120px;
+
+
+ cursor:pointer;
+
+
+}
+
+
+a{
+
+ text-decoration:none;
+
+}
+
+
+a:hover{
+
+
+ text-decoration:underline;
+
+}
+
+
+ul.toolbar{
+
+
+ margin:0px;
+
+
+ padding:0px;
+
+
+ list-style:none;
+
+
+ font-family:arial;
+
+
+ letter-spacing:-1.3px;
+
+
+ font-weight:bold;
+
+}
+
+
+ul.toolbar li{
+
+
+ margin:0px;
+
+
+ padding:0px;
+
+}
+
+
+.wpPlugin-MainFrame{
+
+
+}
+
+
+ul.toolbar li.item div{
+
+
+ margin:0px;
+
+
+ padding:0px;
+}
+
+
+ul.toolbar li.item div.title{
+
+
+ padding-top:2px;
+
+ padding-bottom:2px;
+
+ padding-left:2px;
+
+ cursor:pointer;
+
+
+ margin-bottom:2px;
+
+
+}
+
+
+ul.toolbar li.item div.boxTitle{ }
+
+
+ul.toolbar li.item div.boxTitleContent{
+
+ padding-top:5px;
+
+ padding-bottom:5px;
+
+ padding-right:5px;
+}
+
+
+ul.toolbar li.item div.content{
+
+
+ margin-bottom:5px;
+}
+
+
+
+ul.toolbar li.item div.title img{
+
+
+ float:right;
+
+
+}
+
+
+
+ul.toolbar li div img{
+
+
+ margin:1px;
+ border:0;
+
+ padding:0px;
+}
+
+
+.boxDialog{
+
+
+ letter-spacing:0px;
+
+
+ background:transparent;
+
+
+ margin:0px;
+
+
+ padding:0px;
+
+
+ position:absolute;
+
+}
+
+.boxBanner_ul{
+
+ float: left;
+ list-style: none outside none;
+ margin-right: 12px;
+ margin-left: 10px;
+ width: auto;
+ padding:0;
+}
+
+.boxCounters_ul{
+ list-style: none outside none;
+ margin: 10px 0 0;
+ text-align: justify;
+ width: 50px;
+ padding:0;
+}
+
+.boxCounters_ul li{
+ display: table;
+ height: auto;
+ margin-bottom: 8px !important;
+}
+
+.boxBanner_ul li{
+
+ float: left;
+ margin-right: 5px !important;
+}
+
+.boxBanner_ul_margin{
+
+ border-right: 1px solid #6A6A6A;
+ float: left;
+ height: 60px;
+ list-style: none outside none;
+ margin: 0;
+ padding:0;
+}
View
BIN images/toolbar/48f.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN images/toolbar/48i.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN images/toolbar/48rss.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN images/toolbar/48t.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN images/toolbar/inbound.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
2,792 includes/class-sociable_Admin_Options.php
2,742 additions, 50 deletions not shown because the diff is too large. Please use a local Git client to view these changes.
View
785 includes/skyscraper_output.php
@@ -1,633 +1,1250 @@
<?php
+
/*
+
* The Output And Shortcode Functions For sociable
+
*/
+
/*
+
* Returns The Skyscraper Output For The Global $post Object Do Not
+
*/
+
function diff_date($date1, $date2){
-
-
+
+
$date1 = mktime(substr($date1,8,2), substr($date1,10,2), substr($date1,12,2), substr($date1,4,2), substr($date1,6,2), substr($date1,0,4));
+
$date2 = mktime(substr($date2,8,2), substr($date2,10,2), substr($date2,12,2), substr($date2,4,2), substr($date2,6,2), substr($date2,0,4));
-
+
+
$diff_time = ceil((($date2 - $date1)/60));
+
return $diff_time;
}
+
+
+
function skyscraper_html( $where = "" ){
+
global $skyscraper_options, $wp_query;
+
if (!is_admin() || 1==1){
+
+
+
// echo "<script type='text/javascript'>";
+
// echo "var skyscraper_dir = '".SOCIABLE_HTTP_PATH."' ;";
+
// echo "</script>";
+
echo " var skyscraper_dir = document.createElement('input');
+
skyscraper_dir.id = 'skyscraper_dir';
+
skyscraper_dir.type = 'hidden';
+
skyscraper_dir.value = '".SOCIABLE_HTTP_PATH."';
+
document.body.appendChild(skyscraper_dir); ";
+
+
$widget_width = str_replace("px", "", $skyscraper_options["widget_width"]);
+
+
$widget_position = "null";
+
if (isset($skyscraper_options["widget_position"])){
+
$widget_position = 1;
+
}
+
+
$labels_color = $skyscraper_options["labels_color"];
+
$text_size = str_replace("px", "", $skyscraper_options["text_size"]);
+
$background_color = $skyscraper_options["background_color"];
+
+
$addWhere = "";
+
+
if ($where == ""){
+
$addWhere = "var div = document.createElement('div');
+
div.id = 'skyscraper';
+
document.body.appendChild(div);";
+
}
+
+
$url_site= $_SERVER["HTTP_HOST"].$_SERVER["REQUEST_URI"];
+
- $script = "
+
+ $script = "
+
+
+
- if (!document.getElementById('fb-root')){
+ if (!document.getElementById('fb-root')){
+
var div = document.createElement('div');
+
div.id = 'fb-root';
+
document.body.appendChild(div);
+
}
-
+
(function(d, s, id) {
+
var js, fjs = d.getElementsByTagName(s)[0];
+
if (d.getElementById(id)) return;
+
js = d.createElement(s); js.id = id;
+
js.src = \"http://connect.facebook.net/en_US/all.js#xfbml=1\";
+
fjs.parentNode.insertBefore(js, fjs);
+
}(document, 'script', 'facebook-jssdk'));
-
- (function() {
- var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;
- po.src = 'https://apis.google.com/js/plusone.js';
- var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
- })();
+
+
+
-
- (function() {
- var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;
- po.src = 'http://platform.twitter.com/widgets.js';
- var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
- })();
-
".$addWhere."
-
- jQuery(document).ready(function(){
-
+
+ jQuery(document).ready(function(){
+
oPlugin.toolbarStart('skyscraper', ".$widget_position.",230,".$widget_width.",'".$background_color."','".$labels_color."',false,'#6A6A6A',".$text_size.",'#587cc8');
-
+
".get_share_node()."
-
+
".get_counters_node()."
-
- ".get_latest_node()."
-
- ".get_mentions_node()."
-
+
+ ".get_social_banner_node()."
+
+ ".get_latest_node()."
+
+ ".get_mentions_node()."
+
".get_follow_us_node()."
-
+
".get_rss_node()."
-
- oPlugin.CreateGoToTop('New_Id_12','Top','<img src=\"".SOCIABLE_HTTP_PATH."images/toolbar/gototop.png\" style=\"width:30px;\" />');
-
-
- oPlugin.CreateGoToHome('New_Id_13','Go Home','<img src=\"".SOCIABLE_HTTP_PATH."images/toolbar/gotohome.png\" style=\"width:30px;\" />');
-
+
+ oPlugin.CreateGoToTop('New_Id_12','Top','<img src=\"".SOCIABLE_HTTP_PATH."images/toolbar/gototop.png\" style=\"width:30px;\" />');
+
+ oPlugin.CreateGoToHome('New_Id_13','Go Home','<img src=\"".SOCIABLE_HTTP_PATH."images/toolbar/gotohome.png\" style=\"width:30px;\" />');
+
});
-
+
+ ";
+
+ echo $script;
+ }
+
+}
+
+function get_social_banner_node(){
- ";
+ global $skyscraper_options;
+
+ global $title_shared;
+
+ global $url_shares;
- echo $script;
+ $social_banner_node = "";
- }
+
+ if(!empty($skyscraper_options["sociable_banner"])){
+
+ $follow_us = sc_follow_links(1);
+
+ $follow_buttons = $follow_us["follow_buttons"];
+
+ $follow_us_count = $follow_us["count"];
+
+ $width_banner = 200;
+
+ $social_banner_node = " var url = '". addslashes(trim($url_shares))."';
+ var title = '".addslashes(trim($title_shared)) ."';
+ var counter = '<ul class=\"boxBanner_ul\">';
+ counter += ' <li>';
+ counter += ' <div class=\"fb-like\" data-send=\"false\" data-layout=\"box_count\" data-width=\"50\" data-href=\"'+url+'\" data-show-faces=\"false\"></div>';
+
+ counter += ' </li>';
+ counter += ' <li>';
+ counter += ' <iframe width=\"100%\" scrolling=\"no\" frameborder=\"0\" title=\"+1\" vspace=\"0\" tabindex=\"-1\" style=\"position: static; left: 0pt; top: 0pt; width: 60px; margin: 0px; border-style: none; visibility: visible; height: 60px;\" src=\"https://plusone.google.com/_/+1/fastbutton?url='+url+'&amp;size=tall&amp;count=true&amp;hl=en-US&amp;jsh=m%3B%2F_%2Fapps-static%2F_%2Fjs%2Fgapi%2F__features__%2Frt%3Dj%2Fver%3Dt1NEBxIt2Qs.es_419.%2Fsv%3D1%2Fam%3D!Xq7AzNfn9_-I0e5PyA%2Fd%3D1%2F#id=I1_1328906079806&amp;parent='+url+'&amp;rpctoken=615138222&amp;_methods=onPlusOne%2C_ready%2C_close%2C_open%2C_resizeMe%2C_renderstart\" name=\"I1_1328906079806\" marginwidth=\"0\" marginheight=\"0\" id=\"I1_1328906079806\" hspace=\"0\" allowtransparency=\"true\"></iframe>';
+ counter += ' </li>';
+ counter += ' <li>';
+ counter += '<iframe scrolling=\"no\" frameborder=\"0\" allowtransparency=\"true\" src=\"http://platform.twitter.com/widgets/tweet_button.1326407570.html#_=1328815234500&amp;_version=2&amp;count=vertical&amp;enableNewSizing=false&amp;id=twitter-widget-0&amp;lang=en&amp;original_referer=+url+&amp;&amp;size=m&amp;text='+title+' <sociable> blogplay.com&amp;url='+url+'&amp;via=sociablesite\" class=\"twitter-share-button twitter-count-vertical\" style=\"width: 55px; height: 62px;\" title=\"Twitter Tweet Button\"></iframe>';
+ counter += ' </li>';
+ counter += '</ul>';";
+
+ if ($follow_us_count > 0){
+
+ $social_banner_node .= "
+ counter += '<ul class=\"boxBanner_ul_margin\">';
+ counter += '<li>';
+ counter += '</li>';
+ counter += '</ul>';";
+
+ $social_banner_node .= " counter += '".$follow_buttons."'; ";
+
+ if ($follow_us_count > 1){
+
+ $width_banner = $width_banner + (70 * $follow_us_count);
+ }
+ else{
+ $width_banner = $width_banner + (90 * $follow_us_count);
+ }
+
+
+ }
+
+ $label_text = trim($skyscraper_options["sociable_banner_text"]);
+
+ if (strlen($label_text) > 35){
+ // $label_text = substr($label_text,0,35);
+ }
+ $label_text = addslashes($label_text);
+
+ $social_banner_node .= "oPlugin.CreateNode('New_Id_14','".$label_text."', '', counter,'banner',80,".$width_banner.");";
+ $timer = ($skyscraper_options["sociable_banner_timer"] * 1000);
+
+ $colorBack = $skyscraper_options["sociable_banner_colorBack"];
+ $colorFont = $skyscraper_options["sociable_banner_colorFont"];
+ $colorLabel = $skyscraper_options["sociable_banner_colorLabel"];
+ $fontSize = $skyscraper_options["sociable_banner_fontSize"];
+
+ $social_banner_node .="setTimeout('showBanner(".$timer.",\"".$colorBack."\", \"".$colorLabel."\", \"".$colorFont."\", \"".$fontSize."\")', ".$timer.");";
+
+ }
+
+ return $social_banner_node;
}
+
function get_rss_node(){
+
$rss_node = "";
+
$latest_posts = "";
+
global $skyscraper_options;
+
+
$version = phpversion();
+
+
if ( substr($version,0,1) == 5 && isset($skyscraper_options["rss_feed"]) && $skyscraper_options["rss_feed"]!="http://"){
+
+
include("rss_php.php");
+
+
$rss = new rss_php;
+
$rss->load($skyscraper_options["rss_feed"]);
+
$items = $rss->getItems();
+
+
if (!empty($skyscraper_options["rss_feed"])){
+
+
if (count($items) > 0){
+
+
$cant = 0;
+
foreach($items as $item){
+
+
if ($cant <= $skyscraper_options["num_rss"]){
+
+
$title="";
+
if (isset($item["title"])){
+
$title = addslashes($item["title"]);
+
}
+
$description="";
+
if (isset($item["description"])){
+
$description = addslashes($item["description"]);
+
}
+
$guid="";
+
if (isset($item["link"])){
+
$guid = addslashes($item["link"]);
+
}
+
$pubDate="";
+
if (isset($item["pubDate"])){
+
$pubDate = ago(strtotime($item["pubDate"]));
+
}
+
+
$latest_posts .= "['".$title."','','".$description."','".$guid."','".$pubDate."'],";
+
}
+
else{
+
break;
+
}
+
$cant++;
+
}
+
$latest_posts = trim($latest_posts, ",");
+
}
+
}
+
}
+
+
if ($latest_posts != ""){
+
+
$rss_node = "var LatestBlogPostContent = [
+
".$latest_posts."
+
];
+
oPlugin.CreateNode('New_Id_5','Posts','',LatestBlogPostContent,'Notice',220,460);";
+
}
+
return $rss_node;
+
}
+
function get_latest_node(){
+
$latest_node = "";
+
global $skyscraper_options;
+
+
if ( isset($skyscraper_options["twitter_username"])){
+
+
$latest_tweets = get_option_tweets("skyscraper_latest");
+
if ($skyscraper_options["twitter_username"] != ""){
+
+
if ($latest_tweets != ""){
+
- $latest_node = "var LastestTwittsContent = [
+
+ $latest_node = "
+
+ var LastestTwittsContent = [
+
".$latest_tweets."
+
];
+
+
oPlugin.CreateNode('New_Id_3','Latest','',LastestTwittsContent,'Notice',220,460);";
+
}
+
}
+
}
+
return $latest_node;
+
}
+
function get_mentions_node(){
+
$mentions_node = "";
+
+
global $skyscraper_options;
+
+
if ( isset($skyscraper_options["twitter_username"])){
+
+
$mentions_tweets = get_option_tweets("skyscraper_mentions");
+
if ($skyscraper_options["twitter_username"] != ""){
+
+
if ($mentions_tweets != "" ){
+
+
$mentions_node = "var TweetsMentionsContent = [
+
".$mentions_tweets."
+
];
+
oPlugin.CreateNode('New_Id_4','Mentions','',TweetsMentionsContent,'Notice',220,460);";
+
}
+
}
+
}
+
return $mentions_node;
+
}
+
function get_counters_node(){
+
+
global $skyscraper_options;
+
global $title_shared;
- global $url_shares;
-
+
+ global $url_shares;
+
$counters_node = "";
- /*
-
- <script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script><span><a href="http://twitter.com/share" style="color:#ffffff" class="twitter-share-button" data-url="" data-text="" data-count="vertical" data-via="gBrowser" data-lang="en">Tweet</a></span>
-
- */
+
+
if ((!empty($skyscraper_options["counters"]["check"]))){
+
+
$counters_node = " var url = '". addslashes(trim($url_shares))."';
- var title = '".addslashes(trim($title_shared)) ."';
-
- var counter = '<table align=\"center\" cellspacing=\"0\" cellpadding=\"0\" ><tr><td style=\"height:72px;width:50px;\" align=\"center\">';
- counter += '<div class=\"fb-like\" data-send=\"false\" data-layout=\"box_count\" data-width=\"50\" data-href=\"'+url+'\" data-show-faces=\"false\"></div>';
- counter += '</td></tr>';
- counter += '<tr><td align=\"center\">';
- counter +=' <div class=\"g-plusone\" data-size=\"tall\" data-href=\"'+url+'\"></div>';
- counter += '</td></tr>';
- counter += '<tr><td align=\"center\" style=\"height:72px\">';
- counter += '<a href=\"https://twitter.com/share\" data-with=\"50\" data-text=\"'+ title +' (via @sociablesite) [skyscraper_counters] \" data-url=\"'+ url + '\" class=\"twitter-share-button\" data-count=\"vertical\">Tweet</a>';
- counter += '</td></tr>';
- counter += '</table>';
-
- oPlugin.CreateSimpleNode('New_Id_2','Counters<br/>', counter ,".$skyscraper_options["counters"]["folded"].");
- ";
+
+ var title = '".addslashes(trim($title_shared)) ."'; ";
+
+ $counters_node .= "
+ var counter = '<ul class= \"boxCounters_ul\">';
+
+ counter += '<li style=\"margin-left:2px\"><fb:like send=\"false\" layout=\"box_count\" show_faces=\"false\" font=\"\"></fb:like></li>';
+
+ counter +=' <li style=\"margin-left:0px\"><iframe width=\"100%\" scrolling=\"no\" frameborder=\"0\" title=\"+1\" vspace=\"0\" tabindex=\"-1\" style=\"position: static; left: 0pt; top: 0pt; width: 60px; margin: 0px; border-style: none; visibility: visible; height: 60px;\" src=\"https://plusone.google.com/_/+1/fastbutton?url='+url+'&amp;size=tall&amp;count=true&amp;hl=en-US&amp;jsh=m%3B%2F_%2Fapps-static%2F_%2Fjs%2Fgapi%2F__features__%2Frt%3Dj%2Fver%3Dt1NEBxIt2Qs.es_419.%2Fsv%3D1%2Fam%3D!Xq7AzNfn9_-I0e5PyA%2Fd%3D1%2F#id=I1_1328906079806&amp;parent='+url+'&amp;rpctoken=615138222&amp;_methods=onPlusOne%2C_ready%2C_close%2C_open%2C_resizeMe%2C_renderstart\" name=\"I1_1328906079806\" marginwidth=\"0\" marginheight=\"0\" id=\"I1_1328906079806\" hspace=\"0\" allowtransparency=\"true\"></iframe></li>';
+
+ counter += '<li style=\"margin-left:-2px\"><iframe scrolling=\"no\" frameborder=\"0\" allowtransparency=\"true\" src=\"http://platform.twitter.com/widgets/tweet_button.1326407570.html#_=1328815234500&amp;_version=2&amp;count=vertical&amp;enableNewSizing=false&amp;id=twitter-widget-0&amp;lang=en&amp;original_referer=+url+&amp;size=m&amp;text='+title+' (sociable) blogplay.com&amp;url='+url+'&amp;via=sociablesite\" class=\"twitter-share-button twitter-count-vertical\" style=\"width: 55px; height: 62px;\" title=\"Twitter Tweet Button\"></iframe></li>';
+
+ counter += '</ul>';";
}
-
+
+
+
+ $counters_node .= "oPlugin.CreateSimpleNode('New_Id_2','Counters<br/>', counter ,".$skyscraper_options["counters"]["folded"].");
+";
+
return $counters_node;
+
}
+
function get_share_node(){
+
+
global $skyscraper_options;
+
+
$share_node = "";
+
+
if (!empty($skyscraper_options["share"]["check"])){
+
$share_buttons = share_links();
+
$share_node = "oPlugin.CreateSimpleNode('New_Id_1','Share', '".$share_buttons."',".$skyscraper_options["share"]["folded"].");";
+
}
+
+
return $share_node;
+
}
+
function get_follow_us_node(){
+
$follow_us_node = "";
+
global $skyscraper_options;
+
+
if (isset($skyscraper_options["follow_us"])){
+
+
$follow_info = empty_accounts();
+
+
if ( $follow_info["active"] > 0 && ($follow_info["empty"] < $follow_info["active"])){
+
+ $follow_buttons = sc_follow_links();
+
+ $follow_us_node = "oPlugin.CreateNode('New_Id_6','Follow', '', '".$follow_buttons["follow_buttons"]."','Plano',40,140)";
- $follow_us_node = "oPlugin.CreateNode('New_Id_6','Follow', '', '".sc_follow_links()."','Plano',40,140)";
}
+
}
+
return $follow_us_node;
+
}
+
function empty_accounts(){
+
$empty = 0;
+
$active = 0;
+
global $skyscraper_options;
+
+
foreach($skyscraper_options["follow_us"] as $follow_us){
+
+
if (empty($follow_us["account"])){
+
$empty++;
+
}
+
+
if (isset($follow_us["active"])){
+
$active++;
+
}
+
}
+
+
return array("empty" =>$empty, "active"=>$active);
+
}
-function sc_follow_links(){
+
+function sc_follow_links($banner = 0){
+
global $skyscraper_options;
+
+ $follow_buttons = "<ul class=\'boxBanner_ul\'>";
+ $count_follow = 0;
- $follow_buttons = "";
-
- foreach($skyscraper_options["follow_us"] as $follow_us){
-
+ foreach($skyscraper_options["follow_us"] as $follow_us){
+
$follow_us["account"]= trim($follow_us["account"]);
-
+
if (!empty($follow_us["active"]) && !empty($follow_us["account"]) ){
-
+
$follow_us["account"] = str_replace("http://", "", $follow_us["account"]);
+
$follow_us["account"] = "http://".$follow_us["account"];
+
+ if ($banner==1){
+
+ $follow_us["logo"] = "48".$follow_us["logo"];
+ }
+
+ $follow_buttons .= "<li><a target=\'_blank\' rel=\'nofollow\' href=\'".$follow_us["account"]."\'><img src=\'".SOCIABLE_HTTP_PATH."images/toolbar/".$follow_us["logo"]."\' /></a></li>";
- $follow_buttons .= "<a target=\'_blank\' rel=\'nofollow\' href=\'".$follow_us["account"]."\'><img src=\'".SOCIABLE_HTTP_PATH."images/toolbar/".$follow_us["logo"]."\' /></a>";
+ $count_follow++;
}
+
}
- return $follow_buttons;
+ $follow_buttons .= "</ul>";
+
+ $return = array();
+ $return["count"] = $count_follow;
+ $return["follow_buttons"] = $follow_buttons;
+
+ return $return;
}
+
function share_links(){
+
+
$url = addslashes(get_bloginfo('wpurl'));
+
$blogname = addslashes(get_bloginfo('name'));
+
global $title_shared;
+
global $url_shares;
-
+
$page = trim(addslashes($url_shares));
- $permalink = trim(addslashes($url_shares));
+
+ $permalink = trim(addslashes($url_shares));
+
$title = trim(addslashes($title_shared));
+
+
$share_links = array();
+
$share_links = array(
-
-
+
+
"twitter" => array('favicon' => 't.png',
- 'url' => 'http://twitter.com/intent/tweet?text='.$title.'%20-%20'.$permalink.'%20(via%20@sociablesite) %23sociable [skyscraper_share]',
+
+ 'url' => 'http://twitter.com/intent/tweet?text='.urlencode($title).' - '.urlencode($url).' '.urlencode("{sociable}").' blogplay.com&via=sociablesite',
+
'title' => "Share on Twitter"),
+
+
"facebook" => array('favicon' => 'f.png',
+
'url' => 'http://www.facebook.com/share.php?u='.$permalink.'&amp;t='.$title.'',
+
'title' => "Share on Facebook"),
+
+
"google" => array('favicon' => 'g.png',
+
'url' => 'https://mail.google.com/mail/?view=cm&fs=1&to&su='.$title.'&body='.$permalink.'&ui=2&tf=1&shva=1',
+
'title' => "Share on Gmail"),
+
- "favorites" => array('favicon' => 'fv.png',
- 'url' => 'javascript:AddToFavorites();',
- 'title' => "Add to favorites - doesn\'t work in Chrome"),
+
+ "inbound" => array('favicon' => 'inbound.png',
+
+ 'url' => 'http://inbound.org/?url='.$permalink.'&title='.$title.'',
+
+ 'title' => "Share on inbound.org"),
+
+
"stumble" => array('favicon' => 's.png',
+
'url' => 'http://www.stumbleupon.com/submit?url='.$permalink.'&title='.$title.'',
+
'title' => "Share on StumpleUpon"),
+
+
"delicious" => array('favicon' => 'o.png',
+
'url' => 'http://delicious.com/post?url='.$permalink.'&amp;title='.$title.'&amp;notes=EXCERPT',
+
"title" => "Share on delicious"),
+
+
"reader" => array('favicon' => 'n.png',
+
'url' => 'http://www.google.com/reader/link?url='.$permalink.'&amp;title='.$title.'&amp;srcURL='.$permalink.'&amp;srcTitle='.$blogname.'',
+
"title" => "Share on Google Reader"),
+
+
"linkedin" => array('favicon' => 'i.png',
+
'url' => 'http://www.linkedin.com/shareArticle?mini=true&amp;url='.$permalink.'&amp;title='.$title.'&amp;source='.$blogname.'&amp;summary=EXCERPT',
+
"title" => "Share on LinkedIn")
+
+
);
+
+
$share_buttons = "";
+
+
foreach($share_links as $link){
+
+
$share_buttons .= "<a target=\'_blank\' rel=\'nofollow\' href=\'".addslashes($link["url"])."\' title=\'".addslashes($link["title"])."\'><img src=\'".SOCIABLE_HTTP_PATH."images/toolbar/".addslashes($link["favicon"])."\' /></a>";
+
}
+
+
return $share_buttons;
+
}
+
/*
+
* Template Tag To Echo The Sociable 2 HTML
+
*/
+
function do_skyscraper(){
+
echo skyscraper_html();
+
}
+
/*
+
* Sociable 2 Shortcode
+
*/
+
function skyscraper_shortcode(){
+
return skyscraper_html();
+
}
+
function auto_skyscraper($content, $admin = false){
+
global $skyscraper_options;
-// echo $_SERVER["REQUEST_URI"];
+
+
if ($admin){
- // die("acaa22");
+
$content = skyscraper_html();
+
return $content;
+
}
+
+
if( ! isset( $skyscraper_options['active'] )){
+
$content = "";
+
return $content;
+
}
+
+ echo "<pre>";
+ print_r ($skyscraper_options["locations"]);
+ echo "</pre>";
+
+
if( ! isset( $skyscraper_options['locations'] ) || ! is_array( $skyscraper_options['locations'] ) || empty( $skyscraper_options['locations'] ) ){
+
+
$content = "";
+
} else {
+
+
$locations = $skyscraper_options['locations'];
+
}
+
/*
+
* Determine if we are supposed to be displaying the output here.
+
*/
+
$display = false;
+
+
/*
+
* is_single is a unique case it still returning true
+
*/
+
+
//If We Can Verify That We are in the correct loaction, simply add something to the $display array, and test for a true result to continue.
+
foreach( $locations as $location => $val ){
+
+
//First We Handle is_single() so it returning true on Single Post Type Pages is not an issue, this is not the intended functionality of this plugin
+
if( $location == 'is_single' ){
+
//If we are not in a post, lets ignore this one for now
+
+
if( is_single() && get_post_type() == 'post' ){
+
$display = true;
+
break;
+
} else {
+
continue; // So not to trigger is_single later in this loop, but still be allowed to handle others
+
}
+
+
} elseif( strpos( $location , 'is_single_posttype_' ) === 0 ){ //Now We Need To Check For The Variable Names, Taxonomy Archives, Post Type Archives and Single Custom Post Types.
+
+
//Single Custom Post Type
+
$post_type = str_replace( 'is_single_posttype_' , '' , $location );
+
if( is_single() && get_post_type() == $post_type ){
+
$display = true;
+
break;
+
}
+
+
} elseif( strpos( $location , 'is_posttype_archive_' ) === 0 ){
+
+
//Custom Post Type Archive
+
$post_type = str_replace( 'is_posttype_archive_' , '' , $location );
+
if( is_post_type_archive( $post_type ) ){
+
$display = true;
+
break;
+
}
+
+
} elseif( strpos( $location , 'is_taxonomy_archive_' ) === 0 ) {
+
+
//Taxonomy Archive
+
$taxonomy = str_replace( 'is_taxonomy_archive_' , '' , $location );
+
if( is_tax( $taxonomy ) ){
+
$display = true;
+
break;
+
}
+
+
} elseif( function_exists( $location ) ) {
+
+
//Standard conditional tag, these will return BOOL
+
if( call_user_func( $location ) === true ){
+
$display = true;
+
break;
+
}
+
+
} else {
+
continue;
+
}
+
+
+
}
+
+
//If We have passed all the checks and are looking in the right place lets do this thang
+
if( isset( $skyscraper_options['automatic_mode'] ) && $display === true ){
+
if (isset($skyscraper_options["topandbottom"])){
+
$content = skyscraper_html();
+
}else{
+
$content = skyscraper_html();
+
}
+
}
+
else{
+
$content = skyscraper_html();
+
}
+
+
+
+
return $content;
+
}
+
function get_tweets_username($username_complete){
+
+
if (function_exists('curl_init')) {
+
+
// last tweets
+
$username = str_replace("@", "", $username_complete);
+
$url = "https://api.twitter.com/1/statuses/user_timeline/".$username.".json";
+
$latest = curl_call($url);
+
$latest_row = parser_twitter_results($latest,0);
+
update_option( "skyscraper_latest", $latest_row );
+
+
// last mentions
+
$url = "http://search.twitter.com/search.json?q=@".$username."&rpp=5&include_entities=true&result_type=mixed";
+
$mentions = curl_call($url);
+
+
if (count($mentions["results"]) > 1){
+
+
$mentions_row = parser_twitter_results($mentions["results"],1);
+
update_option( "skyscraper_mentions", $mentions_row );
+
}
+
}
+
}
+
function ago($time){
+
$periods = array("second", "minute", "hour", "day", "week", "month", "year", "decade");
+
$lengths = array("60","60","24","7","4.35","12","10");
+
$now = time();
+
$difference = $now - $time;
+
$tense = "ago";
+
for($j = 0; $difference >= $lengths[$j] && $j < count($lengths)-1; $j++) {
+
$difference /= $lengths[$j];
+
}
+
$difference = round($difference);
+
if($difference != 1) {
+
$periods[$j].= "s";
+
}
+
return $difference." ".$periods[$j]."ago";
+
}
+
function parser_twitter_results($results = array(), $mention){
+
+
$options_latest = array();
+
$options_latest = array("date" => date("YmdHis"));
+
global $skyscraper_options;
+
$i = 0;
+
+
if (is_array($results)){
+
+
foreach($results as $tweet){
+
+
$options_latest[$i] = array();
+
$options_latest[$i]["text"] = $tweet["text"];
+
$options_latest[$i]["created_at"] = ago(strtotime($tweet["created_at"]));
+
+
if ($mention){
+
$options_latest[$i]["name"] = $tweet["from_user_name"];
+
}
+
else{
+
$options_latest[$i]["name"] = $tweet["user"]["name"];
+
}
+
+
$i++;
+
if ($i == $skyscraper_options["num_tweets"]){
+
break;
+
}
+
}
+
}
+
+
return $options_latest;
+
}
+
function curl_call($url){
+
+
$ch = curl_init();
+
curl_setopt($ch, CURLOPT_URL, $url);
+
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
+
curl_setopt($ch, CURLOPT_TIMEOUT, 3);
+
curl_setopt($ch, CURLINFO_HEADER_OUT, true);
+
$output = curl_exec($ch);
+
$info = curl_getinfo($ch);
+
curl_close($ch);
+
+
if ($info["http_code"] == "200"){
+
+
$return = json_decode($output,1);
+
}
+
else{
+
$return = false;
+
}
+
+
return $return;
+
}
+
function get_option_tweets($option){
+
+
global $skyscraper_options;
+
$skyscraper_latest = get_option($option);
+
+
if (empty($skyscraper_latest)){
+
+
get_tweets_username($skyscraper_options["twitter_username"]);
+
$skyscraper_latest = get_option($option);
+
}
+
else{
+
+
// 5 minutes
+
if (diff_date($skyscraper_latest["date"], date("YmdHis")) > 5){
+
+
get_tweets_username($skyscraper_options["twitter_username"]);
+
$skyscraper_latest = get_option($option);
+
}
+
}
+
+
+
return generate_tweets_box_content($skyscraper_latest);
+
}
+
function generate_tweets_box_content($tweets){
+
$content = "";
+
if (isset($tweets["date"])){
+
unset($tweets["date"]);
+
}
+
+
+
foreach($tweets as $tweet){
+
+
$tweet["name"] = addslashes($tweet["name"]);
+
$tweet["text"] = addslashes($tweet["text"]);
+
+
$content .= "['".$tweet["name"]."','".$tweet["name"]."','".$tweet["text"]."','','".$tweet["created_at"]."'],";
+
}
+
$content = trim(trim(trim($content), ","));
+
+
return $content;
+
}
+
if (!empty($_GET["sky"])){
+
add_action('wp_ajax_my_action', 'my_action_callback');
+
function my_action_callback() {
+
global $wpdb; global $skyscraper_options; // this is how you get access to the database
+
$whatever = intval( $_POST['whatever'] );
+
$whatever += 10;
+
echo $whatever;
+
die(); // this is required to return a proper result
+
}
+
}
+
?>
View
764 includes/sociable_output.php
@@ -1,759 +1,1517 @@
<?php
+
+
/*
+
+
* The Output And Shortcode Functions For sociable
+
+
*/
+
/*
+
+
* Returns The Sociable Output For The Global $post Object Do Not
+
+
*/
+
+
+
+
+
+
+
function sociable_html( $display = array(),$location = "" ){
+
+
global $sociable_options, $wp_query, $post;
+
+
//ra( $sociable_options );
+
+
$sociable_known_sites = get_option( 'sociable_known_sites' );
+
+
+
+
if( ! $post ){
+
+
$post = get_post( $post_id = 1 );
+
+
}
+
+
+
+
if ( get_post_meta($post->ID,'_sociableoff',true)) {
+
+
return "";
+
+
}
+
+
+
$active_sites = $sociable_options['active_sites'];
+
// Get The Image Path
+
+
//$imagepath = _get_sociable_image_path();
+
// if no sites are specified, display all active
+
+
// have to check $active_sites has content because WP
+
+
// won't save an empty array as an option
+
+
if ( empty($display) && isset( $active_sites ) )
+
+
$display = $active_sites;
+
+
// if no sites are active, display nothing
+
+
if ( empty($display) )
+
+
return "";
+
// Load the post's and blog's data
+
+
$blogname = urlencode(get_bloginfo('name')." ".get_bloginfo('description'));
+
+
$blogrss = get_bloginfo('rss2_url');
+
+
+
+
// Grab the excerpt, if there is no excerpt, create one
+
+
$excerpt = urlencode(strip_tags(strip_shortcodes($post->post_excerpt)));
+
+
if ($excerpt == "") {
+
+
$excerpt = urlencode(substr(strip_tags(strip_shortcodes($post->post_content)),0,250));
+
+
}
+
+
+
+
// Clean the excerpt for use with links
+
+
$excerpt = str_replace('+','%20',$excerpt);
+
+
$permalink = urlencode(get_permalink($post->ID));
+
+