WP Social Bookmarking Light - Version 1.6.8

Version Description

  • Added: Google +1 Button
Download this release

Release Info

Developer utahvich
Plugin Icon wp plugin WP Social Bookmarking Light
Version 1.6.8
Comparing to
See all releases

Code changes from version 1.6.7 to 1.6.8

modules/admin.php CHANGED
@@ -68,14 +68,14 @@ function wp_social_bookmarking_light_admin_head()
68
  margin: 0;
69
  padding: 5px;
70
  overflow: auto;
71
- width: 160px;
72
  height: 240px;
73
  float: left;
74
  border: 1px solid #999;
75
  background-color: #FFF;
76
  }
77
  #wsbl_sortable li, #wsbl_draggable li{
78
- width: 120px;
79
  height: 20px;
80
  font-size: 12px;
81
  margin: 0px auto;
@@ -126,15 +126,15 @@ function wsbl_get_service_codes()
126
  */
127
  function wsbl_has_option(service_id)
128
  {
129
- var services = wsbl_get_service_codes();
130
- var facebook_id = ['facebook_like', 'facebook_send'];
131
- if(jQuery.inArray(service_id, facebook_id) >= 0){
132
- for(var i in facebook_id){
133
- if(jQuery.inArray(facebook_id[i], services) >= 0){
134
- return true;
135
- }
136
- }
137
- }
138
  return jQuery.inArray(service_id, services) >= 0;
139
  }
140
 
@@ -143,10 +143,10 @@ function wsbl_has_option(service_id)
143
  */
144
  function wsbl_get_tab_id(service_id)
145
  {
146
- if(service_id == 'facebook_like' || service_id == 'facebook_send'){
147
- return 'facebook';
148
- }
149
- return service_id;
150
  }
151
 
152
  /**
@@ -154,8 +154,8 @@ function wsbl_get_tab_id(service_id)
154
  */
155
  function wsbl_tab_toggle(service_id, is_simply)
156
  {
157
- var has_option = wsbl_has_option(service_id);
158
- var tab_id = wsbl_get_tab_id(service_id);
159
 
160
  var tab_id_settings = "#" + tab_id + "_settings";
161
  if(is_simply){
@@ -180,7 +180,7 @@ function wsbl_update_services(is_simply)
180
  jQuery("#services_id").val(vals);
181
 
182
  is_simply = is_simply || false;
183
- var services = ['mixi', 'twitter', 'hatena_button', 'facebook_like', 'facebook_send', 'gree', 'evernote', 'tumblr', 'atode'];
184
  for(var i in services){
185
  wsbl_tab_toggle(services[i], is_simply);
186
  }
@@ -248,7 +248,7 @@ jQuery(document).ready(function(){
248
  function wp_social_bookmarking_light_options_page()
249
  {
250
  if( isset( $_POST['save'] ) ){
251
- $options = wp_social_bookmarking_light_save_options($_POST);
252
  echo '<div class="updated"><p><strong>'.__( 'Options saved.', WP_SOCIAL_BOOKMARKING_LIGHT_DOMAIN ).'</strong></p></div>';
253
  }
254
  else if( isset( $_POST['restore'] ) ){
@@ -277,6 +277,7 @@ function wp_social_bookmarking_light_options_page()
277
  <li id='evernote_settings'><a href="#tabs-8"><span><?php _el("evernote") ?></span></a></li>
278
  <li id='tumblr_settings'><a href="#tabs-9"><span><?php _el("tumblr") ?></span></a></li>
279
  <li id='atode_settings'><a href="#tabs-10"><span><?php _el("atode") ?></span></a></li>
 
280
  </ul>
281
 
282
  <!-- General -->
@@ -650,6 +651,90 @@ function wp_social_bookmarking_light_options_page()
650
  </tr>
651
  </table>
652
  </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
653
 
654
  </div>
655
  <p class="submit">
@@ -683,6 +768,7 @@ function wp_social_bookmarking_light_options_page()
683
  <tr><td>choix</td><td>Choix</td></tr>
684
  <tr><td>google</td><td>Google Bookmarks</td></tr>
685
  <tr><td>google_buzz</td><td>Google Buzz</td></tr>
 
686
  <tr><td>delicious</td><td>Delicious</td></tr>
687
  <tr><td>digg</td><td>Digg</td></tr>
688
  <tr><td>friendfeed</td><td>FriendFeed</td></tr>
68
  margin: 0;
69
  padding: 5px;
70
  overflow: auto;
71
+ width: 165px;
72
  height: 240px;
73
  float: left;
74
  border: 1px solid #999;
75
  background-color: #FFF;
76
  }
77
  #wsbl_sortable li, #wsbl_draggable li{
78
+ width: 135px;
79
  height: 20px;
80
  font-size: 12px;
81
  margin: 0px auto;
126
  */
127
  function wsbl_has_option(service_id)
128
  {
129
+ var services = wsbl_get_service_codes();
130
+ var facebook_id = ['facebook_like', 'facebook_send'];
131
+ if(jQuery.inArray(service_id, facebook_id) >= 0){
132
+ for(var i in facebook_id){
133
+ if(jQuery.inArray(facebook_id[i], services) >= 0){
134
+ return true;
135
+ }
136
+ }
137
+ }
138
  return jQuery.inArray(service_id, services) >= 0;
139
  }
140
 
143
  */
144
  function wsbl_get_tab_id(service_id)
145
  {
146
+ if(service_id == 'facebook_like' || service_id == 'facebook_send'){
147
+ return 'facebook';
148
+ }
149
+ return service_id;
150
  }
151
 
152
  /**
154
  */
155
  function wsbl_tab_toggle(service_id, is_simply)
156
  {
157
+ var has_option = wsbl_has_option(service_id);
158
+ var tab_id = wsbl_get_tab_id(service_id);
159
 
160
  var tab_id_settings = "#" + tab_id + "_settings";
161
  if(is_simply){
180
  jQuery("#services_id").val(vals);
181
 
182
  is_simply = is_simply || false;
183
+ var services = ['mixi', 'twitter', 'hatena_button', 'facebook_like', 'facebook_send', 'gree', 'evernote', 'tumblr', 'atode', 'google_plus_one'];
184
  for(var i in services){
185
  wsbl_tab_toggle(services[i], is_simply);
186
  }
248
  function wp_social_bookmarking_light_options_page()
249
  {
250
  if( isset( $_POST['save'] ) ){
251
+ $options = wp_social_bookmarking_light_save_options($_POST);
252
  echo '<div class="updated"><p><strong>'.__( 'Options saved.', WP_SOCIAL_BOOKMARKING_LIGHT_DOMAIN ).'</strong></p></div>';
253
  }
254
  else if( isset( $_POST['restore'] ) ){
277
  <li id='evernote_settings'><a href="#tabs-8"><span><?php _el("evernote") ?></span></a></li>
278
  <li id='tumblr_settings'><a href="#tabs-9"><span><?php _el("tumblr") ?></span></a></li>
279
  <li id='atode_settings'><a href="#tabs-10"><span><?php _el("atode") ?></span></a></li>
280
+ <li id='google_plus_one_settings'><a href="#tabs-11"><span><?php _el("google_plus_one") ?></span></a></li>
281
  </ul>
282
 
283
  <!-- General -->
651
  </tr>
652
  </table>
653
  </div>
654
+
655
+ <!-- google +1 -->
656
+ <div id="tabs-11">
657
+ <table class='form-table'>
658
+ <tr>
659
+ <th scope="row">Button size:</th>
660
+ <td>
661
+ <select name='google_plus_one_button_size'>
662
+ <option value='small' <?php if( $options['google_plus_one']['button_size'] == 'small' ) echo 'selected'; ?>>small</option>
663
+ <option value='medium' <?php if( $options['google_plus_one']['button_size'] == 'medium' ) echo 'selected'; ?>>medium</option>
664
+ </select>
665
+ </td>
666
+ </tr>
667
+ <tr>
668
+ <th scope="row">Language:</th>
669
+ <td>
670
+ <select name='google_plus_one_lang'>
671
+ <?php
672
+ $langs = array(
673
+ "ar" => "Arabic",
674
+ "ar" => "Arabic",
675
+ "bg" => "Bulgarian",
676
+ "ca" => "Catalan",
677
+ "zh-CN" => "Chinese (Simplified)",
678
+ "zh-TW" => "Chinese (Traditional)",
679
+ "hr" => "Croatian",
680
+ "cs" => "Czech",
681
+ "da" => "Danish",
682
+ "nl" => "Dutch",
683
+ "en-US" => "English (US)",
684
+ "en-GB" => "English (UK)",
685
+ "et" => "Estonian",
686
+ "fil" => "Filipino",
687
+ "fi" => "Finnish",
688
+ "fr" => "French",
689
+ "de" => "German",
690
+ "el" => "Greek",
691
+ "iw" => "Hebrew",
692
+ "hi" => "Hindi",
693
+ "hu" => "Hungarian",
694
+ "id" => "Indonesian",
695
+ "it" => "Italian",
696
+ "ja" => "Japanese",
697
+ "ko" => "Korean",
698
+ "lv" => "Latvian",
699
+ "lt" => "Lithuanian",
700
+ "ms" => "Malay",
701
+ "no" => "Norwegian",
702
+ "fa" => "Persian",
703
+ "pl" => "Polish",
704
+ "pt-BR" => "Portuguese (Brazil)",
705
+ "pt-PT" => "Portuguese (Portugal)",
706
+ "ro" => "Romanian",
707
+ "ru" => "Russian",
708
+ "sr" => "Serbian",
709
+ "sv" => "Swedish",
710
+ "sk" => "Slovak",
711
+ "sl" => "Slovenian",
712
+ "es" => "Spanish",
713
+ "es-419" => "Spanish (Latin America)",
714
+ "th" => "Thai",
715
+ "tr" => "Turkish",
716
+ "uk" => "Ukrainian",
717
+ "vi" => "Vietnamese",
718
+ );
719
+ foreach($langs as $key => $val){
720
+ $selected = $options['google_plus_one']['lang'] == $key ? "selected" : "";
721
+ echo "<option $selected value='$key'>$val</option>\n";
722
+ }
723
+ ?>
724
+ </select>
725
+ </td>
726
+ </tr>
727
+ <tr>
728
+ <th scope="row">Include count:</th>
729
+ <td>
730
+ <select name='google_plus_one_count'>
731
+ <option value='true' <?php if( $options['google_plus_one']['count'] == true ) echo 'selected'; ?>>Yes</option>
732
+ <option value='false' <?php if( $options['google_plus_one']['count'] == false ) echo 'selected'; ?>>No</option>
733
+ </select>
734
+ </td>
735
+ </tr>
736
+ </table>
737
+ </div>
738
 
739
  </div>
740
  <p class="submit">
768
  <tr><td>choix</td><td>Choix</td></tr>
769
  <tr><td>google</td><td>Google Bookmarks</td></tr>
770
  <tr><td>google_buzz</td><td>Google Buzz</td></tr>
771
+ <tr><td>google_plus_one</td><td>Google +1</td></tr>
772
  <tr><td>delicious</td><td>Delicious</td></tr>
773
  <tr><td>digg</td><td>Digg</td></tr>
774
  <tr><td>friendfeed</td><td>FriendFeed</td></tr>
modules/content.php CHANGED
@@ -92,6 +92,11 @@ function wp_social_bookmarking_light_wp_head()
92
  $locale = ($locale == '' ? 'en_US' : $locale);
93
  echo '<script src="http://connect.facebook.net/'.$locale.'/all.js#xfbml=1"></script>'."\n";
94
  }
 
 
 
 
 
95
 
96
  // css
97
  $padding_top = $options['style']['padding_top'];
92
  $locale = ($locale == '' ? 'en_US' : $locale);
93
  echo '<script src="http://connect.facebook.net/'.$locale.'/all.js#xfbml=1"></script>'."\n";
94
  }
95
+ // Google +1
96
+ if(in_array('google_plus_one', $services)){
97
+ $lang = $options['google_plus_one']['lang'];
98
+ echo '<script src="http://apis.google.com/js/plusone.js">{lang:\''.$lang.'\'}</script>'."\n";
99
+ }
100
 
101
  // css
102
  $padding_top = $options['style']['padding_top'];
modules/options.php CHANGED
@@ -53,6 +53,9 @@ function wp_social_bookmarking_light_default_options()
53
  'evernote' => array('button_type' => 'article-clipper'),
54
  'tumblr' => array('button_type' => '1'),
55
  'atode' => array('button_type' => 'iconsja'),
 
 
 
56
  );
57
  }
58
 
@@ -88,8 +91,8 @@ function wp_social_bookmarking_light_save_options($data)
88
  "single_page" => $data["single_page"] == 'true',
89
  "is_page" => $data["is_page"] == 'true',
90
  'style' => array('padding_top' => $data["style_padding_top"],
91
- 'padding_bottom' => $data["style_padding_bottom"]),
92
- "mixi" => array('check_key' => $data["mixi_check_key"],
93
  'check_robots' => $data["mixi_check_robots"],
94
  'button' => $data['mixi_button']),
95
  "twitter" => array('via' => $data['twitter_via'],
@@ -112,6 +115,9 @@ function wp_social_bookmarking_light_save_options($data)
112
  'evernote' => array('button_type' => $data['evernote_button_type']),
113
  'tumblr' => array('button_type' => $data['tumblr_button_type']),
114
  'atode' => array('button_type' => $data['atode_button_type']),
 
 
 
115
  );
116
  update_option( 'wp_social_bookmarking_light_options', $options );
117
  return $options;
53
  'evernote' => array('button_type' => 'article-clipper'),
54
  'tumblr' => array('button_type' => '1'),
55
  'atode' => array('button_type' => 'iconsja'),
56
+ 'google_plus_one' => array('button_size' => 'medium',
57
+ 'lang' => 'en-US',
58
+ 'count' => true),
59
  );
60
  }
61
 
91
  "single_page" => $data["single_page"] == 'true',
92
  "is_page" => $data["is_page"] == 'true',
93
  'style' => array('padding_top' => $data["style_padding_top"],
94
+ 'padding_bottom' => $data["style_padding_bottom"]),
95
+ "mixi" => array('check_key' => $data["mixi_check_key"],
96
  'check_robots' => $data["mixi_check_robots"],
97
  'button' => $data['mixi_button']),
98
  "twitter" => array('via' => $data['twitter_via'],
115
  'evernote' => array('button_type' => $data['evernote_button_type']),
116
  'tumblr' => array('button_type' => $data['tumblr_button_type']),
117
  'atode' => array('button_type' => $data['atode_button_type']),
118
+ 'google_plus_one' => array('button_size' => $data['google_plus_one_button_size'],
119
+ 'lang' => $data['google_plus_one_lang'],
120
+ 'count' => $data['google_plus_one_count'] == 'true'),
121
  );
122
  update_option( 'wp_social_bookmarking_light_options', $options );
123
  return $options;
modules/services.php CHANGED
@@ -308,7 +308,18 @@ class WpSocialBookmarkingLight
308
  $icon = WP_SOCIAL_BOOKMARKING_LIGHT_IMAGES_URL."/google-buzz.png";
309
  return $this->link( $url, $alt, $icon, 16, 16 );
310
  }
311
-
 
 
 
 
 
 
 
 
 
 
 
312
  /**
313
  * @brief Delicious
314
  */
308
  $icon = WP_SOCIAL_BOOKMARKING_LIGHT_IMAGES_URL."/google-buzz.png";
309
  return $this->link( $url, $alt, $icon, 16, 16 );
310
  }
311
+ /**
312
+ * @brief Google Buzz
313
+ */
314
+ function google_plus_one()
315
+ {
316
+ $options = wp_social_bookmarking_light_options();
317
+ $button_size = $options['google_plus_one']['button_size'];
318
+ $include_count = $options['google_plus_one']['count'] ? '' : 'count="false"';
319
+ $raw = '<g:plusone size="'.$button_size.'" '.$include_count.' href="'.$this->url.'"></g:plusone>';
320
+ return $this->link_raw($raw);
321
+ }
322
+
323
  /**
324
  * @brief Delicious
325
  */
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link:
4
  Tags: links, social, bookmarks, bookmarking, Hatena, Livedoor Clip, BuzzURL, @nifty clip, Twitter, Tumblr, FC2 Bookmark, newsing, Choix, Yahoo!JAPAN Bookmark, Yahoo!Buzz, Google Bookmark, Delicious, Digg, FriendFeed, Google Buzz, Facebook, reddit, LinkedIn, Evernote, Instapaper, StumbleUpon, mixi, gree, atode, toread
5
  Requires at least: 2.9.0
6
  Tested up to: 3.1.2
7
- Stable tag: 1.6.7
8
 
9
  This plugin inserts social share links at the top or bottom of each post.
10
 
@@ -30,6 +30,7 @@ This is the list of used social sites:
30
  * Yahoo!Buzz
31
  * Google Bookmark
32
  * Google Buzz
 
33
  * Delicious
34
  * Digg
35
  * FriendFeed
@@ -56,6 +57,9 @@ This is the list of used social sites:
56
 
57
  == Changelog ==
58
 
 
 
 
59
  = 1.6.7 =
60
  * Bug fixed: Facebook like button did not work on IE.
61
 
4
  Tags: links, social, bookmarks, bookmarking, Hatena, Livedoor Clip, BuzzURL, @nifty clip, Twitter, Tumblr, FC2 Bookmark, newsing, Choix, Yahoo!JAPAN Bookmark, Yahoo!Buzz, Google Bookmark, Delicious, Digg, FriendFeed, Google Buzz, Facebook, reddit, LinkedIn, Evernote, Instapaper, StumbleUpon, mixi, gree, atode, toread
5
  Requires at least: 2.9.0
6
  Tested up to: 3.1.2
7
+ Stable tag: 1.6.8
8
 
9
  This plugin inserts social share links at the top or bottom of each post.
10
 
30
  * Yahoo!Buzz
31
  * Google Bookmark
32
  * Google Buzz
33
+ * Google +1
34
  * Delicious
35
  * Digg
36
  * FriendFeed
57
 
58
  == Changelog ==
59
 
60
+ = 1.6.8 =
61
+ * Added: Google +1 Button
62
+
63
  = 1.6.7 =
64
  * Bug fixed: Facebook like button did not work on IE.
65
 
wp-social-bookmarking-light.php CHANGED
@@ -5,7 +5,7 @@ Plugin URI: http://www.ninxit.com/blog/2010/06/13/wp-social-bookmarking-light/
5
  Description: This plugin inserts social share links at the top or bottom of each post.
6
  Author: utahta
7
  Author URI: http://www.ninxit.com/blog/
8
- Version: 1.6.7
9
  */
10
  /*
11
  Copyright 2010 utahta (email : labs.ninxit@gmail.com)
5
  Description: This plugin inserts social share links at the top or bottom of each post.
6
  Author: utahta
7
  Author URI: http://www.ninxit.com/blog/
8
+ Version: 1.6.8
9
  */
10
  /*
11
  Copyright 2010 utahta (email : labs.ninxit@gmail.com)