Changeset 502289
- Timestamp:
- 02/08/2012 03:42:15 PM (14 years ago)
- Location:
- share-buttons-simple-use/trunk
- Files:
-
- 4 edited
-
readme.txt (modified) (2 diffs)
-
screenshot-1.png (modified) (previous)
-
screenshot-2.png (modified) (previous)
-
share-buttons-simple-use.php (modified) (12 diffs)
Legend:
- Unmodified
- Added
- Removed
-
share-buttons-simple-use/trunk/readme.txt
r368829 r502289 2 2 Contributors: s_ruben 3 3 Donate link: http://rubensargsyan.com/donate/ 4 Tags: share, share buttons, Facebook, facebook like, facebook like button, Twitter, tweet, tweet button, Google buzz, buzz, Google buzzbutton4 Tags: share, share buttons, Facebook, facebook like, facebook like button, Twitter, tweet, tweet button, Google plus, plus, Google plus button 5 5 Requires at least: 2.8 6 Tested up to: 3. 16 Tested up to: 3.3.1 7 7 Stable tag: trunk 8 8 9 A plugin which displays the share buttons (Facebook Like, Tweet and Google buzzbuttons) on the bottom or on the top of the posts and pages.9 A plugin which displays the share buttons (Facebook Like, Tweet and Google plus buttons) on the bottom or on the top of the posts and pages. 10 10 11 11 == Description == 12 12 13 Just activate this plugin and it will display the share buttons (Facebook Like, Tweet and Google buzzbuttons) on the bottom or on the top of the posts and pages.13 Just activate this plugin and it will display the share buttons (Facebook Like, Tweet and Google plus buttons) on the bottom or on the top of the posts and pages. 14 14 15 15 In the admin panel you can configure the settings of the plugin. You can change the share buttons settings and set the display settings. … … 42 42 * Now you can choose the share buttons you want to be shown. 43 43 * Add [share_buttons_simple_use] in any place of post(s) or page(s) where yo want the share buttons to be displayed. 44 45 = 1.3 = 46 * Google buzz button is removed. 47 * Google plus button is added. -
share-buttons-simple-use/trunk/share-buttons-simple-use.php
r368839 r502289 3 3 Plugin Name: Share Buttons Simple Use 4 4 Plugin URI: http://rubensargsyan.com/wordpress-plugin-share-buttons-simple-use/ 5 Description: This is a simple use plugin which displays the share buttons (Facebook Like, Tweet and Google buzzbuttons) on the bottom or on the top of the posts and pages. <a href="options-general.php?page=share-buttons-simple-use.php">Settings</a>6 Version: 1. 25 Description: This is a simple use plugin which displays the share buttons (Facebook Like, Tweet and Google plus buttons) on the bottom or on the top of the posts and pages. <a href="options-general.php?page=share-buttons-simple-use.php">Settings</a> 6 Version: 1.3 7 7 Author: Ruben Sargsyan 8 8 Author URI: http://rubensargsyan.com/ 9 9 */ 10 10 11 /* Copyright 201 0Ruben Sargsyan (email: [email protected])11 /* Copyright 2012 Ruben Sargsyan (email: [email protected]) 12 12 13 13 This program is free software; you can redistribute it and/or modify … … 29 29 $share_buttons_simple_use_plugin_title = "Share Buttons Simple Use"; 30 30 $share_buttons_simple_use_plugin_prefix = "share_buttons_simple_use_"; 31 $share_buttons_simple_use_version = "1. 2";31 $share_buttons_simple_use_version = "1.3"; 32 32 33 33 function load_share_buttons_simple_use(){ 34 34 $plugin_prefix = "share_buttons_simple_use_"; 35 $version = "1. 2";35 $version = "1.3"; 36 36 37 37 if(get_share_buttons_simple_use_settings()===false){ … … 42 42 add_option("share_buttons_simple_use_version",$version); 43 43 }elseif(get_option("share_buttons_simple_use_version")<$version){ 44 update_share_buttons_simple_use_settings(array("buzz_style"=>"small-count","display_tweet"=>"yes","display_fblike"=>"yes","display_buzz"=>"yes")); 44 $current_settings = get_share_buttons_simple_use_settings(); 45 46 unset($current_settings["buzz_style"]); 47 48 $settings = array_merge($current_settings,array("gplus_size"=>"standard","gplus_annotation"=>"inline","gplus_width"=>450)); 49 50 update_option($plugin_prefix."settings",$settings); 45 51 update_option("share_buttons_simple_use_version",$version); 46 52 } … … 56 62 $plugin_prefix = "share_buttons_simple_use_"; 57 63 58 $settings = array("tweet_data_count"=>"none","fblike_layout"=>"standard","fblike_show_faces"=>"true","fblike_width"=>450,"fblike_action"=>"like","fblike_font"=>"none","fblike_colorscheme"=>"light","fblike_height"=>80," buzz_style"=>"small-count","display_tweet"=>"yes","display_fblike"=>"yes","display_buzz"=>"yes","single_pages"=>"only_single_pages","pages"=>"false","placement"=>"at_the_bottom");64 $settings = array("tweet_data_count"=>"none","fblike_layout"=>"standard","fblike_show_faces"=>"true","fblike_width"=>450,"fblike_action"=>"like","fblike_font"=>"none","fblike_colorscheme"=>"light","fblike_height"=>80,"gplus_size"=>"standard","gplus_annotation"=>"inline","gplus_width"=>450,"display_tweet"=>"yes","display_fblike"=>"yes","display_gplus"=>"yes","single_pages"=>"only_single_pages","pages"=>"false","placement"=>"at_the_bottom"); 59 65 60 66 set_share_buttons_simple_use_settings($settings); … … 176 182 $fblike_height = 80; 177 183 } 178 switch($_POST[$share_buttons_simple_use_plugin_prefix."buzz_style"]){ 179 case "normal-count": 180 $buzz_style = "normal-count"; 181 break; 182 case "small-count": 183 $buzz_style = "small-count"; 184 break; 185 case "normal-button": 186 $buzz_style = "normal-button"; 187 break; 188 case "small-button": 189 $buzz_style = "small-button"; 190 break; 191 default: 192 $buzz_style = "small-count"; 184 switch($_POST[$share_buttons_simple_use_plugin_prefix."gplus_size"]){ 185 case "small": 186 $gplus_size = "small"; 187 break; 188 case "medium": 189 $gplus_size = "medium"; 190 break; 191 case "tall": 192 $gplus_size = "tall"; 193 break; 194 default: 195 $gplus_size = "standard"; 196 } 197 switch($_POST[$share_buttons_simple_use_plugin_prefix."gplus_annotation"]){ 198 case "inline": 199 $gplus_annotation = "inline"; 200 break; 201 case "none": 202 $gplus_annotation = "none"; 203 break; 204 default: 205 $gplus_annotation = "bubble"; 206 } 207 if(is_numeric($_POST[$share_buttons_simple_use_plugin_prefix."gplus_width"])){ 208 $gplus_width = intval($_POST[$share_buttons_simple_use_plugin_prefix."gplus_width"]); 209 }else{ 210 $gplus_width = 450; 193 211 } 194 212 if(isset($_POST[$share_buttons_simple_use_plugin_prefix."display_tweet"])){ … … 202 220 $display_fblike = "no"; 203 221 } 204 if(isset($_POST[$share_buttons_simple_use_plugin_prefix."display_ buzz"])){205 $display_ buzz= "yes";206 }else{ 207 $display_ buzz= "no";222 if(isset($_POST[$share_buttons_simple_use_plugin_prefix."display_gplus"])){ 223 $display_gplus = "yes"; 224 }else{ 225 $display_gplus = "no"; 208 226 } 209 227 if(isset($_POST[$share_buttons_simple_use_plugin_prefix."single_pages"])){ … … 228 246 } 229 247 230 $new_settings = array("tweet_data_count"=>$tweet_data_count,"fblike_layout"=>$fblike_layout,"fblike_show_faces"=>$fblike_show_faces,"fblike_width"=>$fblike_width,"fblike_action"=>$fblike_action,"fblike_font"=>$fblike_font,"fblike_colorscheme"=>$fblike_colorscheme,"fblike_height"=>$fblike_height," buzz_style"=>$buzz_style,"display_tweet"=>$display_tweet,"display_fblike"=>$display_fblike,"display_buzz"=>$display_buzz,"single_pages"=>$single_pages,"pages"=>$pages,"placement"=>$placement);248 $new_settings = array("tweet_data_count"=>$tweet_data_count,"fblike_layout"=>$fblike_layout,"fblike_show_faces"=>$fblike_show_faces,"fblike_width"=>$fblike_width,"fblike_action"=>$fblike_action,"fblike_font"=>$fblike_font,"fblike_colorscheme"=>$fblike_colorscheme,"fblike_height"=>$fblike_height,"gplus_size"=>$gplus_size,"gplus_annotation"=>$gplus_annotation,"gplus_width"=>$gplus_width,"display_tweet"=>$display_tweet,"display_fblike"=>$display_fblike,"display_gplus"=>$display_gplus,"single_pages"=>$single_pages,"pages"=>$pages,"placement"=>$placement); 231 249 232 250 update_share_buttons_simple_use_settings($new_settings); … … 247 265 ?> 248 266 <div class="wrap"> 249 <div style="float: right; margin: 20px 0 0 0"><a href="http://blorner.com" target="_blank"><img src="http://banners.blorner.com/blorner.com-468x60.jpg" alt="Blorner" style="border: none" /></a></div> 267 <div style="margin: 20px 0; text-align: center; display: inline-block"><div style="float: left"><div><a href="http://blorner.com?utm_source=share-buttons-simple-use&utm_medium=banner&utm_campaign=admin" target="_blank"><img src="http://banners.blorner.com/blorner.com-468x60.jpg" alt="Blorner" style="border: none" /></a></div><div style="margin-top: 30px"><a href="http://ref.webhostinghub.com/scripts/click.php?ref_id=rubensargsyan&ad_id=f860f28e" target="_top"><img src="http://ref.webhostinghub.com/accounts/default1/banners/hub_468_60_easy-1.gif" style="border: 0;" alt="" width="468" height="60" /></a><img style="border:0" src="http://ref.webhostinghub.com/scripts/imp.php?ref_id=rubensargsyan&ad_id=f860f28e" width="1" height="1" alt="" /></div></div><div style="float: right; margin-left: 50px; text-align: justify; width: 400px; border: 1px solid #DFDFDF; padding: 10px;"><div style="float: left; margin-right: 10px;"><a href="http://rubensargsyan.com/wordpress-plugin-ubm-premium/" target="_blank"><img src="http://rubensargsyan.com/images/ubm-premium.png" alt="UBM Premium" style="border: none" /></a></div><div style="font-size: 11px">UBM Premium is the ultimate banner manager WordPress plugin for the serious bloggers. Rotate banners based on performance, track outgoing clicks, control nofollow/dofollow and much more. The perfect solution for all affiliate marketers and webmasters.</div></div></div> 268 250 269 <h1><?php echo $share_buttons_simple_use_plugin_title; ?></h1> 251 270 <h2>Settings</h2> … … 332 351 </tr> 333 352 <tr> 334 <td colspan="2"><h3>Buzz Button Settings</h3></td> 335 </tr> 336 <tr> 337 <td width="15%" valign="middle"><strong>Style</strong></td> 338 <td width="85%"> 339 <label for="<?php echo($share_buttons_simple_use_plugin_prefix); ?>normal_count">normal-count:</label> <input name="<?php echo($share_buttons_simple_use_plugin_prefix); ?>buzz_style" id="<?php echo($share_buttons_simple_use_plugin_prefix); ?>normal_count" value="normal-count" type="radio" <?php if($settings["buzz_style"]=="normal-count"){ echo('checked="checked"'); } ?> /> <label for="<?php echo($share_buttons_simple_use_plugin_prefix); ?>small_count">small-count:</label> <input name="<?php echo($share_buttons_simple_use_plugin_prefix); ?>buzz_style" id="<?php echo($share_buttons_simple_use_plugin_prefix); ?>small_count" value="small-count" type="radio" <?php if($settings["buzz_style"]=="small-count"){ echo('checked="checked"'); } ?> /> <label for="<?php echo($share_buttons_simple_use_plugin_prefix); ?>normal_button">normal-button:</label> <input name="<?php echo($share_buttons_simple_use_plugin_prefix); ?>buzz_style" id="<?php echo($share_buttons_simple_use_plugin_prefix); ?>normal_button" value="normal-button" type="radio" <?php if($settings["buzz_style"]=="normal-button"){ echo('checked="checked"'); } ?> /> <label for="<?php echo($share_buttons_simple_use_plugin_prefix); ?>small_button">small-button:</label> <input name="<?php echo($share_buttons_simple_use_plugin_prefix); ?>buzz_style" id="<?php echo($share_buttons_simple_use_plugin_prefix); ?>small_button" value="small-button" type="radio" <?php if($settings["buzz_style"]=="small-button"){ echo('checked="checked"'); } ?> /> 353 <td colspan="2"><h3>Google Plus Button Settings</h3></td> 354 </tr> 355 <tr> 356 <td width="15%" valign="middle"><strong>Size</strong></td> 357 <td width="85%"> 358 <select name="<?php echo($share_buttons_simple_use_plugin_prefix); ?>gplus_size" id="<?php echo($share_buttons_simple_use_plugin_prefix); ?>gplus_size" style="width: 110px"> 359 <option value="standard" <?php if($settings["gplus_size"]=="standard"){ echo('selected="selected"'); } ?>>standard</option> 360 <option value="small" <?php if($settings["gplus_size"]=="small"){ echo('selected="selected"'); } ?>>small</option> 361 <option value="medium" <?php if($settings["gplus_size"]=="medium"){ echo('selected="selected"'); } ?>>medium</option> 362 <option value="tall" <?php if($settings["gplus_size"]=="tall"){ echo('selected="selected"'); } ?>>tall</option> 363 </select> 364 </td> 365 </tr> 366 <tr> 367 <td width="15%" valign="middle"><strong>Annotation</strong></td> 368 <td width="85%"> 369 <select name="<?php echo($share_buttons_simple_use_plugin_prefix); ?>gplus_annotation" id="<?php echo($share_buttons_simple_use_plugin_prefix); ?>gplus_annotation" style="width: 110px"> 370 <option value="bubble" <?php if($settings["gplus_annotation"]=="bubble"){ echo('selected="selected"'); } ?>>bubble</option> 371 <option value="inline" <?php if($settings["gplus_annotation"]=="inline"){ echo('selected="selected"'); } ?>>inline</option> 372 <option value="none" <?php if($settings["gplus_annotation"]=="none"){ echo('selected="selected"'); } ?>>none</option> 373 </select> 374 </td> 375 </tr> 376 <tr> 377 <td width="15%" valign="middle"><strong>Width</strong></td> 378 <td width="85%"> 379 <input type="text" name="<?php echo($share_buttons_simple_use_plugin_prefix); ?>gplus_width" id="<?php echo($share_buttons_simple_use_plugin_prefix); ?>gplus_width" value="<?php echo($settings["gplus_width"]); ?>" style="width: 60px" /> 340 380 </td> 341 381 </tr> … … 349 389 <td width="15%" valign="middle"><strong>Buttons</strong></td> 350 390 <td width="85%"> 351 <label for="<?php echo($share_buttons_simple_use_plugin_prefix); ?>display_tweet">Display tweet button</label>: <input type="checkbox" name="<?php echo($share_buttons_simple_use_plugin_prefix); ?>display_tweet" id="<?php echo($share_buttons_simple_use_plugin_prefix); ?>display_tweet" value="yes" <?php if($settings["display_tweet"]=="yes"){ echo('checked="checked"'); } ?> /> <label for="<?php echo($share_buttons_simple_use_plugin_prefix); ?>display_fblike">Display facebook like button</label>: <input type="checkbox" name="<?php echo($share_buttons_simple_use_plugin_prefix); ?>display_fblike" id="<?php echo($share_buttons_simple_use_plugin_prefix); ?>display_fblike" value="yes" <?php if($settings["display_fblike"]=="yes"){ echo('checked="checked"'); } ?> /> <label for="<?php echo($share_buttons_simple_use_plugin_prefix); ?>display_ buzz">Display buzz button</label>: <input type="checkbox" name="<?php echo($share_buttons_simple_use_plugin_prefix); ?>display_buzz" id="<?php echo($share_buttons_simple_use_plugin_prefix); ?>display_buzz" value="yes" <?php if($settings["display_buzz"]=="yes"){ echo('checked="checked"'); } ?> />391 <label for="<?php echo($share_buttons_simple_use_plugin_prefix); ?>display_tweet">Display tweet button</label>: <input type="checkbox" name="<?php echo($share_buttons_simple_use_plugin_prefix); ?>display_tweet" id="<?php echo($share_buttons_simple_use_plugin_prefix); ?>display_tweet" value="yes" <?php if($settings["display_tweet"]=="yes"){ echo('checked="checked"'); } ?> /> <label for="<?php echo($share_buttons_simple_use_plugin_prefix); ?>display_fblike">Display facebook like button</label>: <input type="checkbox" name="<?php echo($share_buttons_simple_use_plugin_prefix); ?>display_fblike" id="<?php echo($share_buttons_simple_use_plugin_prefix); ?>display_fblike" value="yes" <?php if($settings["display_fblike"]=="yes"){ echo('checked="checked"'); } ?> /> <label for="<?php echo($share_buttons_simple_use_plugin_prefix); ?>display_gplus">Display google plus button</label>: <input type="checkbox" name="<?php echo($share_buttons_simple_use_plugin_prefix); ?>display_gplus" id="<?php echo($share_buttons_simple_use_plugin_prefix); ?>display_gplus" value="yes" <?php if($settings["display_gplus"]=="yes"){ echo('checked="checked"'); } ?> /> 352 392 </td> 353 393 </tr> … … 395 435 $post = get_post($post_id); 396 436 397 $share_buttons = '<div class="share_buttons_simple_use_buttons" style="padding: 10px 0 ">';437 $share_buttons = '<div class="share_buttons_simple_use_buttons" style="padding: 10px 0; display: inline-block">'; 398 438 399 439 if($settings["display_tweet"]=="yes"){ 400 $share_buttons .= '<div style="float: left; vertical-align: top"><a href="http://twitter.com/share" class="twitter-share-button" data-url="'.get_permalink($post->ID).'" data-text="'.$post->post_title.'" data-count="'.$settings["tweet_data_count"].'">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div>'; 401 } 402 403 if($settings["display_buzz"]=="yes"){ 404 $share_buttons .= '<div style="float: left; vertical-align: top; margin-left: 10px;"><a title="Post to Google Buzz" class="google-buzz-button" href="http://www.google.com/buzz/post" data-button-style="'.$settings["buzz_style"].'" data-url="'.get_permalink($post->ID).'"></a><script type="text/javascript" src="http://www.google.com/buzz/api/button.js"></script></div>'; 440 $share_buttons .= '<div class="tweet_button" style="float: left; vertical-align: top"><a href="http://twitter.com/share" class="twitter-share-button" data-url="'.get_permalink($post->ID).'" data-text="'.$post->post_title.'" data-count="'.$settings["tweet_data_count"].'">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div>'; 441 } 442 443 if($settings["display_gplus"]=="yes"){ 444 $gplus_size = ""; 445 $gplus_annotation = ""; 446 447 if($settings["gplus_size"]!="standard"){ 448 $gplus_size = 'size="'.$settings["gplus_size"].'"'; 449 } 450 451 if($settings["gplus_annotation"]!="bubble"){ 452 $gplus_annotation = 'annotation="'.$settings["gplus_annotation"].'"'; 453 } 454 455 $share_buttons .= '<div class="google_plus_button" style="float: left; vertical-align: top; margin-left: 10px; max-width: 175px"><g:plusone '.$gplus_size.' '.$gplus_annotation.' width="'.$settings["gplus_width"].'"></g:plusone></div>'; 405 456 } 406 457 407 458 if($settings["display_fblike"]=="yes"){ 408 $share_buttons .= '<div style="display: inline; vertical-align: top; margin-left: 10px"><iframe src="http://www.facebook.com/plugins/like.php?href='.urlencode(get_permalink($post->ID)).'&layout='.$settings["fblike_layout"].'&show_faces='.$settings["fblike_show_faces"].'&width='.$settings["fblike_width"].'&action='.$settings["fblike_action"];459 $share_buttons .= '<div class="facebook_like_button" style="float: left; vertical-align: top; margin-left: 10px; max-width: 255px"><iframe src="http://www.facebook.com/plugins/like.php?href='.urlencode(get_permalink($post->ID)).'&layout='.$settings["fblike_layout"].'&show_faces='.$settings["fblike_show_faces"].'&width='.$settings["fblike_width"].'&action='.$settings["fblike_action"]; 409 460 if($settings["fblike_font"]!="none"){ 410 461 $share_buttons .= "&font=".$settings["fblike_font"]; … … 450 501 } 451 502 503 function share_buttons_simple_use_footer(){ 504 ?> 505 <script type="text/javascript"> 506 (function() { 507 var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true; 508 po.src = 'https://apis.google.com/js/plusone.js'; 509 var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s); 510 })(); 511 </script> 512 <?php 513 } 514 452 515 add_action('plugins_loaded','load_share_buttons_simple_use'); 453 516 add_action('admin_menu', 'share_buttons_simple_use_menu'); 517 add_action('wp_footer', 'share_buttons_simple_use_footer'); 454 518 add_filter('the_content', 'add_share_buttons_simple_use'); 455 519 add_filter('the_excerpt', 'add_share_buttons_simple_use');
Note: See TracChangeset
for help on using the changeset viewer.