WP Social Bookmarking Light - Version 1.6.5

Version Description

  • Added: Facebook Send Button.
  • Added: Options for gree.
  • Updated: Options for Facebook Like Button.
Download this release

Release Info

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

Code changes from version 1.6.4 to 1.6.5

.gitignore ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
1
+ .buildpath
2
+ .project
3
+ .settings/
4
+ .svn/
5
+ .svnignore
6
+
7
+
modules/admin.php ADDED
@@ -0,0 +1,637 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ Copyright 2010 utahta (email : labs.ninxit@gmail.com)
4
+
5
+ This program is free software; you can redistribute it and/or modify
6
+ it under the terms of the GNU General Public License as published by
7
+ the Free Software Foundation; either version 2 of the License, or
8
+ (at your option) any later version.
9
+
10
+ This program is distributed in the hope that it will be useful,
11
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
+ GNU General Public License for more details.
14
+
15
+ You should have received a copy of the GNU General Public License
16
+ along with this program; if not, write to the Free Software
17
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18
+ */
19
+
20
+ /**
21
+ * use jquery in admin page
22
+ */
23
+ function wp_social_bookmarking_light_admin_print_scripts()
24
+ {
25
+ wp_enqueue_script('jquery');
26
+ wp_enqueue_script('jquery-ui-core');
27
+ wp_enqueue_script('jquery-ui-tabs');
28
+ wp_enqueue_script('jquery-ui-sortable');
29
+ wp_enqueue_script('jquery-ui-draggable');
30
+ }
31
+
32
+ /**
33
+ * use jquery-ui in admin page
34
+ */
35
+ function wp_social_bookmarking_light_admin_print_styles()
36
+ {
37
+ wp_enqueue_style('jquery-ui-tabs', WP_SOCIAL_BOOKMARKING_LIGHT_URL."/libs/jquery/css/pepper-grinder/jquery-ui-1.8.6.custom.css");
38
+ }
39
+
40
+ /**
41
+ * admin header
42
+ */
43
+ function wp_social_bookmarking_light_admin_head()
44
+ {
45
+ ?>
46
+ <style type="text/css">
47
+ .wsbl_options{
48
+ border: 1px solid #CCCCCC;
49
+ background-color: #F8F8EB;
50
+ vertical-align: top;
51
+ margin: 0px 10px 10px 0px;
52
+ padding: 0px;
53
+ }
54
+ .wsbl_options th{
55
+ background-color: #E8E8DB;
56
+ text-align: center;
57
+ margin: 0px;
58
+ padding: 3px;
59
+ }
60
+ .wsbl_options td{en
61
+ text-align: left;
62
+ margin: 0px;
63
+ padding: 3px;
64
+ }
65
+
66
+ #wsbl_sortable, #wsbl_draggable {
67
+ list-style-type: none;
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;
82
+ padding: 3px;
83
+ border: 1px solid #999;
84
+ background-color: #F8F8EB;
85
+ cursor: pointer;
86
+ }
87
+ .wsbl_sortable_highlight {
88
+ border: 1px dashed #333 !important;
89
+ background-color: transparent !important;
90
+ }
91
+ .wsbl_txt_draggable{
92
+ float:left;
93
+ }
94
+ .wsbl_img_draggable{
95
+ margin-left: auto;
96
+ margin-right: 0;
97
+ text-align: right;
98
+ display: none;
99
+ }
100
+ .wsbl_point_left{
101
+ float: left;
102
+ height : 240px ;
103
+ margin: 0 20px;
104
+ }
105
+ .wsbl_point_left img{
106
+ margin-top: 90px;
107
+ }
108
+ </style>
109
+
110
+ <script type="text/javascript" charset="utf-8">
111
+ //<![CDATA[
112
+
113
+ /**
114
+ * get services
115
+ */
116
+ function wsbl_get_service_codes()
117
+ {
118
+ var val = jQuery("#services_id").val();
119
+ return jQuery.map(val.split(","), function(n, i){
120
+ return jQuery.trim(n);
121
+ });
122
+ }
123
+
124
+ /**
125
+ * has option
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
+
141
+ /**
142
+ * get tab 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
+ /**
153
+ * tab toggle
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){
162
+ has_option ? jQuery(tab_id_settings).show() : jQuery(tab_id_settings).hide();
163
+ }
164
+ else{
165
+ has_option ? jQuery(tab_id_settings).slideDown() : jQuery(tab_id_settings).slideUp();
166
+ }
167
+ }
168
+
169
+ /**
170
+ * update services
171
+ */
172
+ function wsbl_update_services(is_simply)
173
+ {
174
+ var vals = "";
175
+ var service = jQuery("#wsbl_sortable .wsbl_txt_draggable");
176
+ service.each(function(){
177
+ vals += vals == "" ? "" : ",";
178
+ vals += jQuery(this).text();
179
+ });
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']
184
+ for(var i in services){
185
+ wsbl_tab_toggle(services[i], is_simply);
186
+ }
187
+ }
188
+
189
+ /**
190
+ * set sortable
191
+ */
192
+ function wsbl_update_sortable()
193
+ {
194
+ jQuery("#wsbl_sortable .wsbl_img_draggable").each(function(){
195
+ var button = jQuery(this);
196
+ button.css("display", "block"); // show delete button.
197
+ var img = jQuery("img", button);
198
+ img.mousedown(function(){
199
+ var p = jQuery(this).parents("li");
200
+ p.slideUp("fast", function(){
201
+ p.remove();
202
+ wsbl_update_services();
203
+ });
204
+ });
205
+ img.attr('src', '<?php echo WP_SOCIAL_BOOKMARKING_LIGHT_IMAGES_URL."/close_button.png"?>');
206
+ img.hover(
207
+ function(){
208
+ jQuery(this).attr('src', '<?php echo WP_SOCIAL_BOOKMARKING_LIGHT_IMAGES_URL."/close_button2.png"?>');
209
+ },
210
+ function(){
211
+ jQuery(this).attr('src', '<?php echo WP_SOCIAL_BOOKMARKING_LIGHT_IMAGES_URL."/close_button.png"?>');
212
+ }
213
+ );
214
+ });
215
+ }
216
+
217
+ // main
218
+ jQuery(document).ready(function(){
219
+ jQuery("#wsbl_sortable").sortable({
220
+ placeholder: "wsbl_sortable_highlight",
221
+ update:function(e, ui){
222
+ wsbl_update_sortable();
223
+ wsbl_update_services();
224
+ }
225
+ });
226
+
227
+ jQuery("#wsbl_draggable li").draggable({
228
+ connectToSortable:"#wsbl_sortable",
229
+ helper:'clone',
230
+ revert:"invalid"
231
+ });
232
+ jQuery("#wsbl_draggable, #wsbl_sortable").disableSelection();
233
+
234
+ wsbl_update_sortable();
235
+ wsbl_update_services(true);
236
+
237
+ jQuery("#tabs").tabs();
238
+ });
239
+ //]]>
240
+ </script>
241
+
242
+ <?php
243
+ }
244
+
245
+ /**
246
+ * admin page
247
+ */
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'] ) ){
255
+ $options = wp_social_bookmarking_light_restore_default_options();
256
+ echo '<div class="updated"><p><strong>'.__( 'Restore defaults.', WP_SOCIAL_BOOKMARKING_LIGHT_DOMAIN ).'</strong></p></div>';
257
+ }
258
+ else{
259
+ $options = wp_social_bookmarking_light_options();
260
+ }
261
+ $class_methods = wp_social_bookmarking_light_get_class_methods();
262
+ ?>
263
+
264
+ <div class="wrap">
265
+ <h2>WP Social Bookmarking Light</h2>
266
+
267
+ <form method='POST' action="<?php echo $_SERVER['REQUEST_URI'] ?>">
268
+
269
+ <div id="tabs">
270
+ <ul>
271
+ <li><a href="#tabs-1"><span><?php _e("General Settings") ?></span></a></li>
272
+ <li id='mixi_settings'><a href="#tabs-2"><span><?php _el("mixi") ?></span></a></li>
273
+ <li id='twitter_settings'><a href="#tabs-3"><span><?php _el("twitter") ?></span></a></li>
274
+ <li id='hatena_button_settings'><a href="#tabs-4"><span><?php _el("hatena_button") ?></span></a></li>
275
+ <li id='facebook_settings'><a href="#tabs-5"><span><?php _el("facebook") ?></span></a></li>
276
+ <li id='gree_settings'><a href="#tabs-7"><span><?php _el("gree") ?></span></a></li>
277
+ </ul>
278
+
279
+ <!-- General -->
280
+ <div id="tabs-1">
281
+ <table class='form-table'>
282
+ <tr>
283
+ <th scope="row"><?php _el('Position') ?>:</th>
284
+ <td>
285
+ <select name='position'>
286
+ <option value='top' <?php if( $options['position'] == 'top' ) echo 'selected'; ?>>Top</option>
287
+ <option value='bottom' <?php if( $options['position'] == 'bottom' ) echo 'selected'; ?>>Bottom</option>
288
+ <option value='none' <?php if( $options['position'] == 'none' ) echo 'selected'; ?>>None</option>
289
+ </select>
290
+ </td>
291
+ </tr>
292
+ <tr>
293
+ <th scope="row"><?php _el('Singular') ?>:</th>
294
+ <td>
295
+ <select name='single_page'>
296
+ <option value='true' <?php if( $options['single_page'] == true ) echo 'selected'; ?>>Enabled</option>
297
+ <option value='false' <?php if( $options['single_page'] == false ) echo 'selected'; ?>>Disabled</option>
298
+ </select>
299
+ </td>
300
+ </tr>
301
+ <tr>
302
+ <th scope="row"><?php _el('Page') ?>:</th>
303
+ <td>
304
+ <select name='is_page'>
305
+ <option value='true' <?php if( $options['is_page'] == true ) echo 'selected'; ?>>Enabled</option>
306
+ <option value='false' <?php if( $options['is_page'] == false ) echo 'selected'; ?>>Disabled</option>
307
+ </select>
308
+ </td>
309
+ </tr>
310
+ <tr>
311
+ <th scope="row"><?php _el('Services') ?>: <br/> <span style="font-size:10px">(drag-and-drop)</span></th>
312
+ <td>
313
+ <input type="text" id='services_id' name='services' value="<?php echo $options['services'] ?>"size=120 style="font-size:12px;" onclick="this.select(0, this.value.length)" readonly/>
314
+ <br />
315
+ <br />
316
+ <ul id="wsbl_sortable">
317
+ <?php
318
+ foreach( explode(",", $options['services']) as $service ){
319
+ $service = trim($service);
320
+ if($service != ''){
321
+ if(in_array($service, $class_methods)){
322
+ echo "<li>"
323
+ ."<div class='wsbl_txt_draggable'>$service</div>"
324
+ ."<div class='wsbl_img_draggable'><img src=''></div>"
325
+ ."<br clear='both'>"
326
+ ."</li>\n";
327
+ }
328
+ }
329
+ }
330
+ ?>
331
+ </ul>
332
+ <div class="wsbl_point_left"><img src='<?php echo WP_SOCIAL_BOOKMARKING_LIGHT_IMAGES_URL."/point_left.png"?>'></div>
333
+ <ul id="wsbl_draggable">
334
+ <?php
335
+ foreach($class_methods as $method){
336
+ echo "<li>"
337
+ ."<div class='wsbl_txt_draggable'>$method</div>"
338
+ ."<div class='wsbl_img_draggable'><img src=''></div>"
339
+ ."<br clear='both'>"
340
+ ."</li>\n";
341
+ }
342
+ ?>
343
+ </ul>
344
+ <br clear="both"/>
345
+ </td>
346
+ </tr>
347
+ </table>
348
+ </div>
349
+
350
+ <!-- mixi -->
351
+ <div id="tabs-2">
352
+ <table class='form-table'>
353
+ <tr>
354
+ <th scope="row">Check Key:</th>
355
+ <td>
356
+ <input type="text" name='mixi_check_key' value="<?php echo $options['mixi']["check_key"] ?>" size=50 />
357
+ </td>
358
+ </tr>
359
+ <tr>
360
+ <th scope="row">Check Robots:</th>
361
+ <td>
362
+ <input type="text" name='mixi_check_robots' value="<?php echo $options['mixi']["check_robots"] ?>" size=50 />
363
+ </td>
364
+ </tr>
365
+ <tr>
366
+ <th scope="row">Layout:</th>
367
+ <td>
368
+ <select name='mixi_button'>
369
+ <option value='button-1' <?php if( $options['mixi']['button'] == 'button-1' ) echo 'selected'; ?>>button-1</option>
370
+ <option value='button-2' <?php if( $options['mixi']['button'] == 'button-2' ) echo 'selected'; ?>>button-2</option>
371
+ <option value='button-3' <?php if( $options['mixi']['button'] == 'button-3' ) echo 'selected'; ?>>button-3</option>
372
+ <option value='button-4' <?php if( $options['mixi']['button'] == 'button-4' ) echo 'selected'; ?>>button-4</option>
373
+ </select>
374
+ </td>
375
+ </tr>
376
+ </table>
377
+ </div>
378
+
379
+ <!-- Twitter -->
380
+ <div id="tabs-3">
381
+ <table class='form-table'>
382
+ <tr>
383
+ <th scope="row">Via: <br> <span style="font-size:10px">(your twitter account)</span></th>
384
+ <td>
385
+ <input type="text" name='twitter_via' value="<?php echo $options['twitter']['via'] ?>" size=50 />
386
+ </td>
387
+ </tr>
388
+ <tr>
389
+ <th scope="row">Language:</th>
390
+ <td>
391
+ <select name='twitter_lang'>
392
+ <option value='en' <?php if( $options['twitter']['lang'] == 'en' ) echo 'selected'; ?>>English</option>
393
+ <option value='fr' <?php if( $options['twitter']['lang'] == 'fr' ) echo 'selected'; ?>>French</option>
394
+ <option value='de' <?php if( $options['twitter']['lang'] == 'de' ) echo 'selected'; ?>>German</option>
395
+ <option value='es' <?php if( $options['twitter']['lang'] == 'es' ) echo 'selected'; ?>>Spanish</option>
396
+ <option value='ja' <?php if( $options['twitter']['lang'] == 'ja' ) echo 'selected'; ?>>Japanese</option>
397
+ </select>
398
+ </td>
399
+ </tr>
400
+ <tr>
401
+ <th scope="row">Count:</th>
402
+ <td>
403
+ <select name='twitter_count'>
404
+ <option value='none' <?php if( $options['twitter']['count'] == 'none' ) echo 'selected'; ?>>none</option>
405
+ <option value='horizontal' <?php if( $options['twitter']['count'] == 'horizontal' ) echo 'selected'; ?>>horizontal</option>
406
+ </select>
407
+ </td>
408
+ </tr>
409
+ <tr>
410
+ <th scope="row">Width:</th>
411
+ <td>
412
+ <input type="text" name='twitter_width' value="<?php echo $options['twitter']['width'] ?>" size=20 />
413
+ </td>
414
+ </tr>
415
+ <tr>
416
+ <th scope="row">Height:</th>
417
+ <td>
418
+ <input type="text" name='twitter_height' value="<?php echo $options['twitter']['height'] ?>" size=20 />
419
+ </td>
420
+ </tr>
421
+ </table>
422
+ </div>
423
+
424
+ <!-- hatena button -->
425
+ <div id="tabs-4">
426
+ <table class='form-table'>
427
+ <tr>
428
+ <th scope="row">Layout:</th>
429
+ <td>
430
+ <select name='hatena_button_layout'>
431
+ <option value='standard' <?php if( $options['hatena_button']['layout'] == 'standard' ) echo 'selected'; ?>>standard</option>
432
+ <option value='simple' <?php if( $options['hatena_button']['layout'] == 'simple' ) echo 'selected'; ?>>simple</option>
433
+ </select>
434
+ </td>
435
+ </tr>
436
+ </table>
437
+ </div>
438
+
439
+ <!-- facebook -->
440
+ <div id="tabs-5">
441
+ <!-- General -->
442
+ <strong>General</strong>
443
+ <table class='form-table'>
444
+ <tr>
445
+ <th scope="row">Locale:</th>
446
+ <td>
447
+ <input type="text" name='facebook_locale' value="<?php echo $options['facebook']["locale"] ?>" /><br/>
448
+ <span>en_US, ja_JP, fr_FR ...</span> see more <a href='http://developers.facebook.com/docs/internationalization/' target=_blank>facebook docs</a>
449
+ </td>
450
+ </tr>
451
+ </table>
452
+ <br/>
453
+
454
+ <!-- Like Button -->
455
+ <strong>Like Button</strong>
456
+ <table class='form-table'>
457
+ <tr>
458
+ <th scope="row">Version:</th>
459
+ <td>
460
+ <select name='facebook_like_version'>
461
+ <option value='iframe' <?php if( $options['facebook_like']['version'] == 'iframe' ) echo 'selected'; ?>>iframe</option>
462
+ <option value='xfbml' <?php if( $options['facebook_like']['version'] == 'xfbml' ) echo 'selected'; ?>>xfbml</option>
463
+ </select>
464
+ </td>
465
+ </tr>
466
+ <tr>
467
+ <th scope="row">Action:</th>
468
+ <td>
469
+ <select name='facebook_like_action'>
470
+ <option value='like' <?php if( $options['facebook_like']['action'] == 'like' ) echo 'selected'; ?>>like</option>
471
+ <option value='recommend' <?php if( $options['facebook_like']['action'] == 'recommend' ) echo 'selected'; ?>>recommend</option>
472
+ </select>
473
+ </td>
474
+ </tr>
475
+ <tr>
476
+ <th scope="row">Color Scheme:</th>
477
+ <td>
478
+ <select name='facebook_like_colorscheme'>
479
+ <option value='light' <?php if( $options['facebook_like']['colorscheme'] == 'light' ) echo 'selected'; ?>>light</option>
480
+ <option value='dark' <?php if( $options['facebook_like']['colorscheme'] == 'dark' ) echo 'selected'; ?>>dark</option>
481
+ </select>
482
+ </td>
483
+ </tr>
484
+ <tr>
485
+ <th scope="row">Send button:<br> <span style="font-size:10px">(confirm width size)</span></th>
486
+ <td>
487
+ <select name='facebook_like_send'>
488
+ <option value='true' <?php if( $options['facebook_like']['send'] == true ) echo 'selected'; ?>>Enable</option>
489
+ <option value='false' <?php if( $options['facebook_like']['send'] == false ) echo 'selected'; ?>>Disable</option>
490
+ </select>
491
+ </td>
492
+ </tr>
493
+ <tr>
494
+ <th scope="row">Width:</th>
495
+ <td>
496
+ <input type="text" name='facebook_like_width' value="<?php echo $options['facebook_like']['width'] ?>" size=20 />
497
+ </td>
498
+ </tr>
499
+ <tr>
500
+ <th scope="row">Font:</th>
501
+ <td>
502
+ <select name='facebook_like_font'>
503
+ <option value='' <?php if( $options['facebook_like']['font'] == '' ) echo 'selected'; ?>></option>
504
+ <option value='arial' <?php if( $options['facebook_like']['font'] == 'arial' ) echo 'selected'; ?>>arial</option>
505
+ <option value='lucida+grande' <?php if( $options['facebook_like']['font'] == 'lucida+grande' ) echo 'selected'; ?>>lucida grande</option>
506
+ <option value='tahoma' <?php if( $options['facebook_like']['font'] == 'tahoma' ) echo 'selected'; ?>>tahoma</option>
507
+ <option value='trebuchet+ms' <?php if( $options['facebook_like']['font'] == 'trebuchet+ms' ) echo 'selected'; ?>>trebuchet ms</option>
508
+ <option value='verdana' <?php if( $options['facebook_like']['font'] == 'verdana' ) echo 'selected'; ?>>verdana</option>
509
+ </select>
510
+ </td>
511
+ </tr>
512
+ </table>
513
+ <br/>
514
+
515
+ <!-- Send Button -->
516
+ <strong>Send Button</strong>
517
+ <table class='form-table'>
518
+ <tr>
519
+ <th scope="row">Color Scheme:</th>
520
+ <td>
521
+ <select name='facebook_send_colorscheme'>
522
+ <option value='light' <?php if( $options['facebook_send']['colorscheme'] == 'light' ) echo 'selected'; ?>>light</option>
523
+ <option value='dark' <?php if( $options['facebook_send']['colorscheme'] == 'dark' ) echo 'selected'; ?>>dark</option>
524
+ </select>
525
+ </td>
526
+ </tr>
527
+ <tr>
528
+ <th scope="row">Font:</th>
529
+ <td>
530
+ <select name='facebook_send_font'>
531
+ <option value='' <?php if( $options['facebook_send']['font'] == '' ) echo 'selected'; ?>></option>
532
+ <option value='arial' <?php if( $options['facebook_send']['font'] == 'arial' ) echo 'selected'; ?>>arial</option>
533
+ <option value='lucida+grande' <?php if( $options['facebook_send']['font'] == 'lucida+grande' ) echo 'selected'; ?>>lucida grande</option>
534
+ <option value='tahoma' <?php if( $options['facebook_send']['font'] == 'tahoma' ) echo 'selected'; ?>>tahoma</option>
535
+ <option value='trebuchet+ms' <?php if( $options['facebook_send']['font'] == 'trebuchet+ms' ) echo 'selected'; ?>>trebuchet ms</option>
536
+ <option value='verdana' <?php if( $options['facebook_send']['font'] == 'verdana' ) echo 'selected'; ?>>verdana</option>
537
+ </select>
538
+ </td>
539
+ </tr>
540
+ </table>
541
+ </div>
542
+
543
+ <!-- gree -->
544
+ <div id="tabs-7">
545
+ <table class='form-table'>
546
+ <tr>
547
+ <th scope="row">Button type:</th>
548
+ <td>
549
+ <select name='gree_button_type'>
550
+ <option value='0' <?php if( $options['gree']['button_type'] == '0' ) echo 'selected'; ?>><?php _el("iine") ?></option>
551
+ <option value='1' <?php if( $options['gree']['button_type'] == '1' ) echo 'selected'; ?>><?php _el("kininaru") ?></option>
552
+ <option value='2' <?php if( $options['gree']['button_type'] == '2' ) echo 'selected'; ?>><?php _el("osusume") ?></option>
553
+ <option value='3' <?php if( $options['gree']['button_type'] == '3' ) echo 'selected'; ?>><?php _el("share") ?></option>
554
+ <option value='4' <?php if( $options['gree']['button_type'] == '4' ) echo 'selected'; ?>><?php _el("logo") ?></option>
555
+ </select>
556
+ </td>
557
+ </tr>
558
+ <tr>
559
+ <th scope="row">Button size:</th>
560
+ <td>
561
+ <select name='gree_button_size'>
562
+ <option value='16' <?php if( $options['gree']['button_size'] == '16' ) echo 'selected'; ?>>16</option>
563
+ <option value='20' <?php if( $options['gree']['button_size'] == '20' ) echo 'selected'; ?>>20</option>
564
+ </select>
565
+ </td>
566
+ </tr>
567
+ </table>
568
+ </div>
569
+
570
+ </div>
571
+ <p class="submit">
572
+ <input class="button-primary" type="submit" name='save' value='<?php _e('Save Changes') ?>' />
573
+ <input type="submit" name='restore' value='<?php _e('Restore defaults') ?>' />
574
+ </p>
575
+ </form>
576
+
577
+ <table class='wsbl_options'>
578
+ <tr><th><?php _el("Service Code") ?></th><th><?php _el("Explain") ?></th></tr>
579
+ <tr><td>hatena</td><td>Hatena Bookmark</td></tr>
580
+ <tr><td>hatena_users</td><td>Hatena Bookmark Users</td></tr>
581
+ <tr><td>hatena_button</td><td>Hatena Bookmark Button</td></tr>
582
+ <tr><td>twib</td><td>Twib - Twitter</td></tr>
583
+ <tr><td>twib_users</td><td>Twib Users - Twitter</td></tr>
584
+ <tr><td>tweetmeme</td><td>TweetMeme - Twitter</td></tr>
585
+ <tr><td>twitter</td><td>Tweet Button - Twitter</td></tr>
586
+ <tr><td>livedoor</td><td>Livedoor Clip</td></tr>
587
+ <tr><td>livedoor_users</td><td>Livedoor Clip Users</td></tr>
588
+ <tr><td>yahoo</td><td>Yahoo!JAPAN Bookmark</td></tr>
589
+ <tr><td>yahoo_users</td><td>Yahoo!JAPAN Bookmark Users</td></tr>
590
+ <tr><td>yahoo_buzz</td><td>Yahoo!Buzz</td></tr>
591
+ <tr><td>buzzurl</td><td>BuzzURL</td></tr>
592
+ <tr><td>buzzurl_users</td><td>BuzzURL Users</td></tr>
593
+ <tr><td>nifty</td><td>@nifty Clip</td></tr>
594
+ <tr><td>nifty_users</td><td>@nifty Clip Users</td></tr>
595
+ <tr><td>tumblr</td><td>Tumblr</td></tr>
596
+ <tr><td>fc2</td><td>FC2 Bookmark</td></tr>
597
+ <tr><td>fc2_users</td><td>FC2 Bookmark Users</td></tr>
598
+ <tr><td>newsing</td><td>newsing</td></tr>
599
+ <tr><td>choix</td><td>Choix</td></tr>
600
+ <tr><td>google</td><td>Google Bookmarks</td></tr>
601
+ <tr><td>google_buzz</td><td>Google Buzz</td></tr>
602
+ <tr><td>delicious</td><td>Delicious</td></tr>
603
+ <tr><td>digg</td><td>Digg</td></tr>
604
+ <tr><td>friendfeed</td><td>FriendFeed</td></tr>
605
+ <tr><td>facebook</td><td>Facebook Share</td></tr>
606
+ <tr><td>facebook_like</td><td>Facebook Like Button</td></tr>
607
+ <tr><td>facebook_send</td><td>Facebook Send Button</td></tr>
608
+ <tr><td>reddit</td><td>reddit</td></tr>
609
+ <tr><td>linkedin</td><td>LinkedIn</td></tr>
610
+ <tr><td>evernote</td><td>Evernote</td></tr>
611
+ <tr><td>instapaper</td><td>Instapaper</td></tr>
612
+ <tr><td>stumbleupon</td><td>StumbleUpon</td></tr>
613
+ <tr><td>mixi</td><td>mixi Check (require <a href="http://developer.mixi.co.jp/connect/mixi_plugin/mixi_check/mixicheck" onclick="window.open('http://developer.mixi.co.jp/connect/mixi_plugin/mixi_check/mixicheck'); return false;" >mixi check key</a>)</td></tr>
614
+ <tr><td>gree</td><td>GREE Social Feedback</td></tr>
615
+ </table>
616
+ </div>
617
+
618
+ <?php
619
+ }
620
+
621
+ /**
622
+ * admin menu
623
+ */
624
+ function wp_social_bookmarking_light_admin_menu()
625
+ {
626
+ if( function_exists('add_options_page') ){
627
+ $page = add_options_page( 'WP Social Bookmarking Light',
628
+ 'WP Social Bookmarking Light',
629
+ 'manage_options',
630
+ __FILE__,
631
+ 'wp_social_bookmarking_light_options_page' );
632
+
633
+ add_action('admin_print_styles-'.$page, 'wp_social_bookmarking_light_admin_print_styles');
634
+ add_action('admin_print_scripts-'.$page, 'wp_social_bookmarking_light_admin_print_scripts');
635
+ add_action('admin_head-'.$page, 'wp_social_bookmarking_light_admin_head');
636
+ }
637
+ }
modules/content.php ADDED
@@ -0,0 +1,126 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ Copyright 2010 utahta (email : labs.ninxit@gmail.com)
4
+
5
+ This program is free software; you can redistribute it and/or modify
6
+ it under the terms of the GNU General Public License as published by
7
+ the Free Software Foundation; either version 2 of the License, or
8
+ (at your option) any later version.
9
+
10
+ This program is distributed in the hope that it will be useful,
11
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
+ GNU General Public License for more details.
14
+
15
+ You should have received a copy of the GNU General Public License
16
+ along with this program; if not, write to the Free Software
17
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18
+ */
19
+
20
+ /**
21
+ * html format
22
+ *
23
+ * @param string $services
24
+ * @param string $link
25
+ * @param string $title
26
+ */
27
+ function wp_social_bookmarking_light_output( $services, $link, $title )
28
+ {
29
+ $wp = new WpSocialBookmarkingLight( $link, $title, get_bloginfo('name') );
30
+ $class_methods = wp_social_bookmarking_light_get_class_methods();
31
+ $out = '';
32
+ foreach( explode(",", $services) as $service ){
33
+ $service = trim($service);
34
+ if($service != ''){
35
+ if(in_array($service, $class_methods)){
36
+ $out .= '<div>'.call_user_func( array( $wp, $service ) ).'</div>'; // A WpSocialBookmarkingLight method is called.
37
+ }
38
+ else{
39
+ $out .= "<div>[`$service` not found]</div>";
40
+ }
41
+ }
42
+ }
43
+ if( $out == '' ){
44
+ return $out;
45
+ }
46
+ return "<div class='wp_social_bookmarking_light'>{$out}</div><br class='wp_social_bookmarking_light_clear' />";
47
+ }
48
+
49
+ /**
50
+ * echo html format
51
+ *
52
+ * @param string $services
53
+ * @param string $link
54
+ * @param string $title
55
+ */
56
+ function wp_social_bookmarking_light_output_e( $services=null, $link=null, $title=null )
57
+ {
58
+ if($services == null){
59
+ $options = wp_social_bookmarking_light_options();
60
+ $services = $options['services'];
61
+ }
62
+ echo wp_social_bookmarking_light_output( $services, $link, $title );
63
+ }
64
+
65
+ /**
66
+ * add_action wp_head
67
+ */
68
+ function wp_social_bookmarking_light_wp_head()
69
+ {
70
+ ?>
71
+ <!-- BEGIN: WP Social Bookmarking Light -->
72
+ <?php
73
+ // load options
74
+ $options = wp_social_bookmarking_light_options();
75
+ $services = explode(",", $options['services']);
76
+
77
+ // mixi-check-robots
78
+ if(in_array('mixi', $services)){
79
+ ?>
80
+ <meta name="mixi-check-robots" content="<?php echo $options['mixi']['check_robots'] ?>" />
81
+ <?php
82
+ }
83
+
84
+ ?>
85
+ <style type="text/css">
86
+ div.wp_social_bookmarking_light{border:0 !important;padding:0 !important;margin:0 !important;}
87
+ div.wp_social_bookmarking_light div{float:left !important;border:0 !important;padding:0 4px 0 0 !important;margin:0 !important;height:21px !important;text-indent:0 !important;}
88
+ div.wp_social_bookmarking_light img{border:0 !important;padding:0;margin:0;vertical-align:top !important;}
89
+ .wp_social_bookmarking_light_clear{clear:both !important;}
90
+ a.wp_social_bookmarking_light_instapaper {display: inline-block;font-family: 'Lucida Grande', Verdana, sans-serif;font-weight: bold;font-size: 11px;-webkit-border-radius: 8px;-moz-border-radius: 8px;color: #fff;background-color: #626262;border: 1px solid #626262;padding: 0px 3px 0px;text-shadow: #3b3b3b 1px 1px 0px;min-width: 62px;text-align: center;vertical-align:top;line-height:21px;}
91
+ a.wp_social_bookmarking_light_instapaper, a.wp_social_bookmarking_light_instapaper:hover, a.wp_social_bookmarking_light_instapaper:active, a.wp_social_bookmarking_light_instapaper:visited {color: #fff; text-decoration: none; outline: none;}
92
+ .wp_social_bookmarking_light_instapaper:focus {outline: none;}
93
+ </style>
94
+ <!-- END: WP Social Bookmarking Light -->
95
+ <?php
96
+ }
97
+
98
+ /**
99
+ * add_filter the_content.
100
+ */
101
+ function wp_social_bookmarking_light_the_content( $content )
102
+ {
103
+ if( is_feed() || is_404() || is_robots() || is_comments_popup() || (function_exists( 'is_ktai' ) && is_ktai()) ){
104
+ return $content;
105
+ }
106
+
107
+ $options = wp_social_bookmarking_light_options();
108
+ if( $options['single_page'] && !is_singular() ){
109
+ return $content;
110
+ }
111
+ if( !$options['is_page'] && is_page() ){
112
+ return $content;
113
+ }
114
+
115
+ $out = wp_social_bookmarking_light_output( $options['services'], get_permalink(), get_the_title() );
116
+ if( $out == '' ){
117
+ return $content;
118
+ }
119
+ if( $options['position'] == 'top' ){
120
+ return "{$out}{$content}";
121
+ }
122
+ else if( $options['position'] == 'bottom' ){
123
+ return "{$content}{$out}";
124
+ }
125
+ return $content;
126
+ }
modules/options.php ADDED
@@ -0,0 +1,118 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ Copyright 2010 utahta (email : labs.ninxit@gmail.com)
4
+
5
+ This program is free software; you can redistribute it and/or modify
6
+ it under the terms of the GNU General Public License as published by
7
+ the Free Software Foundation; either version 2 of the License, or
8
+ (at your option) any later version.
9
+
10
+ This program is distributed in the hope that it will be useful,
11
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
+ GNU General Public License for more details.
14
+
15
+ You should have received a copy of the GNU General Public License
16
+ along with this program; if not, write to the Free Software
17
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18
+ */
19
+
20
+ /**
21
+ * default option
22
+ */
23
+ function wp_social_bookmarking_light_default_options()
24
+ {
25
+ return array( "services" => "hatena, hatena_users, facebook, google_buzz, yahoo, livedoor, friendfeed, tweetmeme",
26
+ "position" => "top",
27
+ "single_page" => true,
28
+ "is_page" => true,
29
+ "mixi" => array('check_key' => '',
30
+ 'check_robots' => 'noimage',
31
+ 'button' => 'button-3'),
32
+ "twitter" => array('via' => "",
33
+ 'lang' => "en",
34
+ 'count' => 'horizontal',
35
+ 'width' => '130',
36
+ 'height' => '20'),
37
+ "hatena_button" => array('layout' => 'standard'),
38
+ 'facebook' => array('locale' => 'ja_JP'),
39
+ 'facebook_like' => array('version' => 'xfbml',
40
+ 'action' => 'like',
41
+ 'colorscheme' => 'light',
42
+ 'send' => false,
43
+ 'width' => '100',
44
+ 'font' => '',
45
+ 'locale' => ''),
46
+ 'facebook_send' => array('colorscheme' => 'light',
47
+ 'font' => '',
48
+ 'locale' => ''),
49
+ 'gree' => array('button_type' => '4',
50
+ 'button_size' => '16'),
51
+ );
52
+ }
53
+
54
+ /**
55
+ * option
56
+ */
57
+ function wp_social_bookmarking_light_options()
58
+ {
59
+ $options = get_option("wp_social_bookmarking_light_options", array());
60
+
61
+ // array merge recursive overwrite (1 depth)
62
+ $default_options = wp_social_bookmarking_light_default_options();
63
+ foreach( $default_options as $key => $val ){
64
+ if(is_array($default_options[$key])){
65
+ if(!array_key_exists($key, $options) || !is_array($options[$key])){
66
+ $options[$key] = array();
67
+ }
68
+ $options[$key] = array_merge($default_options[$key], $options[$key]);
69
+ }
70
+ }
71
+ return array_merge( wp_social_bookmarking_light_default_options(), $options );
72
+ }
73
+
74
+ /**
75
+ * save options
76
+ *
77
+ * @param array $data ($_POST)
78
+ */
79
+ function wp_social_bookmarking_light_save_options($data)
80
+ {
81
+ $options = array("services" => $data["services"],
82
+ "position" => $data["position"],
83
+ "single_page" => $data["single_page"] == 'true',
84
+ "is_page" => $data["is_page"] == 'true',
85
+ "mixi" => array('check_key' => $data["mixi_check_key"],
86
+ 'check_robots' => $data["mixi_check_robots"],
87
+ 'button' => $data['mixi_button']),
88
+ "twitter" => array('via' => $data['twitter_via'],
89
+ 'lang' => $data['twitter_lang'],
90
+ 'count' => $data['twitter_count'],
91
+ 'width' => $data['twitter_width'],
92
+ 'height' => $data['twitter_height']),
93
+ 'hatena_button' => array('layout' => $data['hatena_button_layout']),
94
+ 'facebook' => array('locale' => trim($data['facebook_locale'])),
95
+ 'facebook_like' => array('version' => $data['facebook_like_version'],
96
+ 'action' => $data['facebook_like_action'],
97
+ 'colorscheme' => $data['facebook_like_colorscheme'],
98
+ 'send' => $data['facebook_like_send'] == 'true',
99
+ 'width' => $data['facebook_like_width'],
100
+ 'font' => $data['facebook_like_font']),
101
+ 'facebook_send' => array('colorscheme' => $data['facebook_send_colorscheme'],
102
+ 'font' => $data['facebook_send_font']),
103
+ 'gree' => array('button_type' => $data['gree_button_type'],
104
+ 'button_size' => $data['gree_button_size']),
105
+ );
106
+ update_option( 'wp_social_bookmarking_light_options', $options );
107
+ return $options;
108
+ }
109
+
110
+ /**
111
+ * restore default options
112
+ */
113
+ function wp_social_bookmarking_light_restore_default_options()
114
+ {
115
+ $options = wp_social_bookmarking_light_default_options();
116
+ update_option( 'wp_social_bookmarking_light_options', $options );
117
+ return $options;
118
+ }
modules/services.php ADDED
@@ -0,0 +1,518 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ Copyright 2010 utahta (email : labs.ninxit@gmail.com)
4
+
5
+ This program is free software; you can redistribute it and/or modify
6
+ it under the terms of the GNU General Public License as published by
7
+ the Free Software Foundation; either version 2 of the License, or
8
+ (at your option) any later version.
9
+
10
+ This program is distributed in the hope that it will be useful,
11
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
+ GNU General Public License for more details.
14
+
15
+ You should have received a copy of the GNU General Public License
16
+ along with this program; if not, write to the Free Software
17
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18
+ */
19
+
20
+ /**
21
+ * Services
22
+ */
23
+ class WpSocialBookmarkingLight
24
+ {
25
+ var $url;
26
+ var $title;
27
+ var $encode_url;
28
+ var $encode_title;
29
+ var $encode_blogname;
30
+
31
+ function WpSocialBookmarkingLight( $url, $title, $blogname )
32
+ {
33
+ $title = $this->to_utf8( $title );
34
+ $blogname = $this->to_utf8( $blogname );
35
+ $this->url = $url;
36
+ $this->title = $title;
37
+ $this->encode_url = rawurlencode( $url );
38
+ $this->encode_title = rawurlencode( $title );
39
+ $this->encode_blogname = rawurlencode( $blogname );
40
+ }
41
+
42
+ function to_utf8( $str )
43
+ {
44
+ $charset = get_option( 'blog_charset' );
45
+ if( strcasecmp( $charset, 'UTF-8' ) != 0 && function_exists('mb_convert_encoding') ){
46
+ $str = mb_convert_encoding( $str, 'UTF-8', $charset );
47
+ }
48
+ return $str;
49
+ }
50
+
51
+ function link_raw( $url ){
52
+ return $url;
53
+ }
54
+ function link( $url, $alt, $icon, $width, $height ){
55
+ $width = $width ? "width='$width'" : "";
56
+ $height = $height ? "height='$height'" : "";
57
+ return "<a href='{$url}' title='{$alt}' rel=nofollow class='wp_social_bookmarking_light_a' target=_blank>"
58
+ ."<img src='{$icon}' alt='{$alt}' title='{$alt}' $width $height class='wp_social_bookmarking_light_img' />"
59
+ ."</a>";
60
+ }
61
+
62
+ /**
63
+ * @brief Hatena Bookmark
64
+ */
65
+ function hatena()
66
+ {
67
+ $url = "http://b.hatena.ne.jp/add?mode=confirm&url={$this->encode_url}&title={$this->encode_title}";
68
+ $alt = __( "Bookmark this on Hatena Bookmark", WP_SOCIAL_BOOKMARKING_LIGHT_DOMAIN );
69
+ $icon = WP_SOCIAL_BOOKMARKING_LIGHT_IMAGES_URL."/hatena.gif";
70
+ return $this->link( $url, $alt, $icon, 16, 12 );
71
+ }
72
+ function hatena_users()
73
+ {
74
+ $url = "http://b.hatena.ne.jp/entry/{$this->url}";
75
+ $alt = sprintf( __("Hatena Bookmark - %s", WP_SOCIAL_BOOKMARKING_LIGHT_DOMAIN), $this->title );
76
+ $icon = "http://b.hatena.ne.jp/entry/image/{$this->url}";
77
+ return $this->link( $url, $alt, $icon, null, null );
78
+ }
79
+ function hatena_button()
80
+ {
81
+ $options = wp_social_bookmarking_light_options();
82
+ $url = "http://b.hatena.ne.jp/entry/{$this->url}";
83
+ $title = $this->title;
84
+ $alt = __( "Bookmark this on Hatena Bookmark", WP_SOCIAL_BOOKMARKING_LIGHT_DOMAIN );
85
+ return $this->link_raw('<a href="'.$url.'"'
86
+ .' class="hatena-bookmark-button"'
87
+ .' data-hatena-bookmark-title="'.$title.'"'
88
+ .' data-hatena-bookmark-layout="'.$options['hatena_button']['layout'].'"'
89
+ .' title="'.$alt.'">'
90
+ .' <img src="http://b.st-hatena.com/images/entry-button/button-only.gif"'
91
+ .' alt="'.$alt.'" width="20" height="20" style="border: none;" /></a>'
92
+ .'<script type="text/javascript" src="http://b.st-hatena.com/js/bookmark_button.js" charset="utf-8" async="async"></script>');
93
+ }
94
+
95
+ /**
96
+ * @brief twib
97
+ */
98
+ function twib()
99
+ {
100
+ $url = "http://twib.jp/share?url={$this->encode_url}";
101
+ $alt = __( "Post to Twitter", WP_SOCIAL_BOOKMARKING_LIGHT_DOMAIN );
102
+ $icon = WP_SOCIAL_BOOKMARKING_LIGHT_IMAGES_URL."/twib.gif";
103
+ return $this->link( $url, $alt, $icon, 18, 18 );
104
+ }
105
+ function twib_users()
106
+ {
107
+ $url = "http://twib.jp/url/{$this->url}";
108
+ $alt = sprintf( __("Tweets - %s", WP_SOCIAL_BOOKMARKING_LIGHT_DOMAIN), $this->title );
109
+ $icon = "http://image.twib.jp/counter/{$this->url}";
110
+ return $this->link( $url, $alt, $icon, null, null );
111
+ }
112
+
113
+ /**
114
+ * @brief tweetmeme
115
+ */
116
+ function tweetmeme()
117
+ {
118
+ return $this->link_raw( "<script type='text/javascript'>"
119
+ ."tweetmeme_style = 'compact';"
120
+ ."tweetmeme_url='{$this->url}';"
121
+ ."</script>"
122
+ ."<script type='text/javascript' src='http://tweetmeme.com/i/scripts/button.js'></script>" );
123
+ }
124
+
125
+ /**
126
+ * @brief twitter
127
+ */
128
+ function twitter()
129
+ {
130
+ $options = wp_social_bookmarking_light_options();
131
+ $twitter = $options['twitter'];
132
+ $width = $twitter['width'] != '' ? $twitter['width'] : '120';
133
+ $height = $twitter['height'] != '' ? $twitter['height'] : '20';
134
+ return $this->link_raw('<iframe allowtransparency="true" frameborder="0" scrolling="no"'
135
+ .' src="http://platform.twitter.com/widgets/tweet_button.html'
136
+ .'?url='.$this->encode_url
137
+ .'&amp;text='.$this->encode_title
138
+ .($twitter['via'] != '' ? '&amp;via='.$twitter['via'] : '')
139
+ .'&amp;lang='.$twitter['lang']
140
+ .'&amp;count='.$twitter['count']
141
+ .'"'
142
+ .' style="width:'.$width.'px; height:'.$twitter['height'].'px;">'
143
+ .'</iframe>');
144
+ }
145
+
146
+ /**
147
+ * @brief Livedoor Clip
148
+ */
149
+ function livedoor()
150
+ {
151
+ $url = "http://clip.livedoor.com/redirect?link={$this->encode_url}&title={$this->encode_blogname}%20-%20{$this->encode_title}&ie=utf-8";
152
+ $alt = __( "Bookmark this on Livedoor Clip", WP_SOCIAL_BOOKMARKING_LIGHT_DOMAIN );
153
+ $icon = WP_SOCIAL_BOOKMARKING_LIGHT_IMAGES_URL."/livedoor.gif";
154
+ return $this->link( $url, $alt, $icon, 16, 16 );
155
+ }
156
+ function livedoor_users()
157
+ {
158
+ $url = "http://clip.livedoor.com/page/{$this->url}";
159
+ $alt = sprintf( __("Livedoor Clip - %s", WP_SOCIAL_BOOKMARKING_LIGHT_DOMAIN), $this->title );
160
+ $icon = "http://image.clip.livedoor.com/counter/{$this->url}";
161
+ return $this->link( $url, $alt, $icon, null, null );
162
+ }
163
+
164
+ /**
165
+ * @brief Yahoo!JAPAN Bookmark
166
+ */
167
+ function yahoo()
168
+ {
169
+ $url = "http://bookmarks.yahoo.co.jp/bookmarklet/showpopup?t={$this->encode_title}&u={$this->encode_url}&ei=UTF-8";
170
+ $alt = __( "Bookmark this on Yahoo Bookmark", WP_SOCIAL_BOOKMARKING_LIGHT_DOMAIN );
171
+ $icon = WP_SOCIAL_BOOKMARKING_LIGHT_IMAGES_URL."/yahoo.gif";
172
+ return $this->link( $url, $alt, $icon, 16, 16 );
173
+ }
174
+ function yahoo_users()
175
+ {
176
+ return $this->link_raw( "<script src='http://num.bookmarks.yahoo.co.jp/numimage.js?disptype=small'></script>" );
177
+ }
178
+
179
+ /**
180
+ * @brief Yahoo Buzz
181
+ */
182
+ function yahoo_buzz()
183
+ {
184
+ $url = "http://buzz.yahoo.com/buzz?targetUrl={$this->encode_url}&headline={$this->encode_title}";
185
+ $alt = __( "Buzz This", WP_SOCIAL_BOOKMARKING_LIGHT_DOMAIN );
186
+ $icon = WP_SOCIAL_BOOKMARKING_LIGHT_IMAGES_URL."/yahoo_buzz.png";
187
+ return $this->link( $url, $alt, $icon, 16, 16 );
188
+ }
189
+
190
+ /**
191
+ * @brief BuzzURL
192
+ */
193
+ function buzzurl()
194
+ {
195
+ $url = "http://buzzurl.jp/entry/{$this->url}";
196
+ $alt = __( "Bookmark this on BuzzURL", WP_SOCIAL_BOOKMARKING_LIGHT_DOMAIN );
197
+ $icon = WP_SOCIAL_BOOKMARKING_LIGHT_IMAGES_URL."/buzzurl.gif";
198
+ return $this->link( $url, $alt, $icon, 21, 15 );
199
+ }
200
+ function buzzurl_users()
201
+ {
202
+ $url = "http://buzzurl.jp/entry/{$this->url}";
203
+ $alt = sprintf( __("BuzzURL - %s", WP_SOCIAL_BOOKMARKING_LIGHT_DOMAIN), $this->title );
204
+ $icon = "http://api.buzzurl.jp/api/counter/v1/image?url={$this->encode_url}";
205
+ return $this->link( $url, $alt, $icon, null, null );
206
+ }
207
+
208
+ /**
209
+ * @brief nifty clip
210
+ */
211
+ function nifty()
212
+ {
213
+ $url = "http://clip.nifty.com/create?url={$this->encode_url}&title={$this->encode_title}";
214
+ $alt = __( "Bookmark this on @nifty clip", WP_SOCIAL_BOOKMARKING_LIGHT_DOMAIN );
215
+ $icon = WP_SOCIAL_BOOKMARKING_LIGHT_IMAGES_URL."/nifty.gif";
216
+ return $this->link( $url, $alt, $icon, 16, 16 );
217
+ }
218
+ function nifty_users()
219
+ {
220
+ $url = '#';
221
+ $alt = sprintf( __("@nifty clip - %s", WP_SOCIAL_BOOKMARKING_LIGHT_DOMAIN), $this->title );
222
+ $icon = "http://api.clip.nifty.com/api/v1/image/counter/{$this->url}";
223
+ return $this->link( $url, $alt, $icon, null, null );
224
+ }
225
+
226
+ /**
227
+ * @brief Tumblr
228
+ */
229
+ function tumblr()
230
+ {
231
+ $url = "http://www.tumblr.com/share?v=3&u={$this->encode_url}&t={$this->encode_title}";
232
+ $alt = __( "Share on Tumblr", WP_SOCIAL_BOOKMARKING_LIGHT_DOMAIN );
233
+ $icon = WP_SOCIAL_BOOKMARKING_LIGHT_IMAGES_URL."/tumblr.png";
234
+ return $this->link( $url, $alt, $icon, 16, 16 );
235
+ }
236
+
237
+ /**
238
+ * @brief FC2 Bookmark
239
+ */
240
+ function fc2()
241
+ {
242
+ $url = "http://bookmark.fc2.com/user/post?url={$this->encode_url}&title={$this->encode_title}";
243
+ $alt = __( "Bookmark this on FC2 Bookmark", WP_SOCIAL_BOOKMARKING_LIGHT_DOMAIN );
244
+ $icon = WP_SOCIAL_BOOKMARKING_LIGHT_IMAGES_URL."/fc2.gif";
245
+ return $this->link( $url, $alt, $icon, 16, 16 );
246
+ }
247
+ function fc2_users()
248
+ {
249
+ $url = "http://bookmark.fc2.com/search/detail?url={$this->encode_url}";
250
+ $alt = sprintf( __("FC2 Bookmark - %s", WP_SOCIAL_BOOKMARKING_LIGHT_DOMAIN), $this->title );
251
+ $icon = "http://bookmark.fc2.com/image/users/{$this->url}";
252
+ return $this->link( $url, $alt, $icon, null, null );
253
+ }
254
+
255
+ /**
256
+ * @brief newsing
257
+ */
258
+ function newsing()
259
+ {
260
+ $url = "http://newsing.jp/nbutton?url={$this->encode_url}&title={$this->encode_title}";
261
+ $alt = __( "Newsing it!", WP_SOCIAL_BOOKMARKING_LIGHT_DOMAIN );
262
+ $icon = WP_SOCIAL_BOOKMARKING_LIGHT_IMAGES_URL."/newsing.gif";
263
+ return $this->link( $url, $alt, $icon, 16, 16 );
264
+ }
265
+
266
+ /**
267
+ * @brief Choix
268
+ */
269
+ function choix()
270
+ {
271
+ $url = "http://www.choix.jp/bloglink/{$this->url}";
272
+ $alt = __( "Choix it!", WP_SOCIAL_BOOKMARKING_LIGHT_DOMAIN );
273
+ $icon = WP_SOCIAL_BOOKMARKING_LIGHT_IMAGES_URL."/choix.gif";
274
+ return $this->link( $url, $alt, $icon, 16, 16 );
275
+ }
276
+
277
+ /**
278
+ * @brief Google Bookmarks
279
+ */
280
+ function google()
281
+ {
282
+ $url = "http://www.google.com/bookmarks/mark?op=add&bkmk={$this->encode_url}&title={$this->encode_title}";
283
+ $alt = __( "Bookmark this on Google Bookmarks", WP_SOCIAL_BOOKMARKING_LIGHT_DOMAIN );
284
+ $icon = WP_SOCIAL_BOOKMARKING_LIGHT_IMAGES_URL."/google.png";
285
+ return $this->link( $url, $alt, $icon, 16, 16 );
286
+ }
287
+
288
+ /**
289
+ * @brief Google Buzz
290
+ */
291
+ function google_buzz()
292
+ {
293
+ $url = "http://www.google.com/buzz/post?url={$this->encode_url}&message={$this->encode_title}";
294
+ $alt = __( "Post to Google Buzz", WP_SOCIAL_BOOKMARKING_LIGHT_DOMAIN );
295
+ $icon = WP_SOCIAL_BOOKMARKING_LIGHT_IMAGES_URL."/google-buzz.png";
296
+ return $this->link( $url, $alt, $icon, 16, 16 );
297
+ }
298
+
299
+ /**
300
+ * @brief Delicious
301
+ */
302
+ function delicious()
303
+ {
304
+ $url = "http://delicious.com/save?url={$this->encode_url}&title={$this->encode_title}";
305
+ $alt = __( "Bookmark this on Delicious", WP_SOCIAL_BOOKMARKING_LIGHT_DOMAIN );
306
+ $icon = WP_SOCIAL_BOOKMARKING_LIGHT_IMAGES_URL."/delicious.png";
307
+ return $this->link( $url, $alt, $icon, 16, 16 );
308
+ }
309
+
310
+ /**
311
+ * @brief Digg
312
+ */
313
+ function digg()
314
+ {
315
+ $url = "http://digg.com/submit?url={$this->encode_url}&title={$this->encode_title}";
316
+ $alt = __( "Bookmark this on Digg", WP_SOCIAL_BOOKMARKING_LIGHT_DOMAIN );
317
+ $icon = WP_SOCIAL_BOOKMARKING_LIGHT_IMAGES_URL."/digg.png";
318
+ return $this->link( $url, $alt, $icon, 16, 16 );
319
+ }
320
+
321
+ /**
322
+ * @brief Friend feed
323
+ */
324
+ function friendfeed()
325
+ {
326
+ $url = "http://friendfeed.com/?url={$this->encode_url}&title={$this->encode_title}";
327
+ $alt = __( "Share on FriendFeed", WP_SOCIAL_BOOKMARKING_LIGHT_DOMAIN );
328
+ $icon = WP_SOCIAL_BOOKMARKING_LIGHT_IMAGES_URL."/friendfeed.png";
329
+ return $this->link( $url, $alt, $icon, 16, 16 );
330
+ }
331
+
332
+ /**
333
+ * @brief Facebook
334
+ */
335
+ function facebook()
336
+ {
337
+ $url = "http://www.facebook.com/share.php?u={$this->encode_url}&t={$this->encode_title}";
338
+ $alt = __( "Share on Facebook", WP_SOCIAL_BOOKMARKING_LIGHT_DOMAIN );
339
+ $icon = WP_SOCIAL_BOOKMARKING_LIGHT_IMAGES_URL."/facebook.png";
340
+ return $this->link( $url, $alt, $icon, 16, 16 );
341
+ }
342
+
343
+ /**
344
+ * @brief Facebook Like Button
345
+ */
346
+ function facebook_like()
347
+ {
348
+ $options = wp_social_bookmarking_light_options();
349
+ $version = $options['facebook_like']['version'];
350
+ $action = $options['facebook_like']['action'];
351
+ $colorscheme = $options['facebook_like']['colorscheme'];
352
+ $send = $options['facebook_like']['send'] ? 'true' : 'false';
353
+ $width = $options['facebook_like']['width'];
354
+ $font = $options['facebook_like']['font'];
355
+ $locale = $options['facebook']['locale'];
356
+
357
+ if($version == 'iframe'){
358
+ return $this->link_raw('<iframe src="http://www.facebook.com/plugins/like.php?href='.$this->encode_url
359
+ .'&amp;send='.$send
360
+ .'&amp;layout=button_count'
361
+ .'&amp;show_faces=false'
362
+ .'&amp;width='.$width
363
+ .'&amp;action='.$action
364
+ .'&amp;colorscheme='.$colorscheme
365
+ .($font == '' ? '' : '&amp;font='.$font)
366
+ .($locale == '' ? '' : '$amp;locale='.$locale)
367
+ .'&amp;height=21"'
368
+ .' scrolling="no" frameborder="0"'
369
+ .' style="border:none; overflow:hidden; width:'.$width.'px; height:21px;"'
370
+ .' allowTransparency="true"></iframe>');
371
+ }
372
+ else{
373
+ $locale = ($locale == '' ? 'en_US' : $locale);
374
+ return $this->link_raw('<script src="http://connect.facebook.net/'.$locale.'/all.js#xfbml=1"></script>'
375
+ .'<fb:like '
376
+ .'href="'.$this->url.'" '
377
+ .'send="'.$send.'" '
378
+ .'layout="button_count" '
379
+ .'width="'.$width.'" '
380
+ .'show_faces="false" '
381
+ .'action="'.$action.'" '
382
+ .'colorscheme="'.$colorscheme.'" '
383
+ .'font="'.$font.'">'
384
+ .'</fb:like>');
385
+ }
386
+ }
387
+
388
+ /**
389
+ * @brief Facebook Send
390
+ */
391
+ function facebook_send()
392
+ {
393
+ $options = wp_social_bookmarking_light_options();
394
+ $url = $this->url;
395
+ $font = $options['facebook_send']['font'];
396
+ $colorscheme = $options['facebook_send']['colorscheme'];
397
+ $locale = $options['facebook']['locale'];
398
+ $locale = ($locale == '' ? 'en_US' : $locale);
399
+
400
+ return $this->link_raw('<script src="http://connect.facebook.net/'.$locale.'/all.js#xfbml=1"></script>'
401
+ .'<fb:send href="'.$url.'" font="'.$font.'" colorscheme="'.$colorscheme.'"></fb:send>');
402
+ }
403
+
404
+ /**
405
+ * @brief reddit
406
+ */
407
+ function reddit()
408
+ {
409
+ $url = "http://www.reddit.com/submit?url={$this->encode_url}&title={$this->encode_title}";
410
+ $alt = __( "Share on reddit", WP_SOCIAL_BOOKMARKING_LIGHT_DOMAIN );
411
+ $icon = WP_SOCIAL_BOOKMARKING_LIGHT_IMAGES_URL."/reddit.png";
412
+ return $this->link( $url, $alt, $icon, 16, 16 );
413
+ }
414
+
415
+ /**
416
+ * @brief LinkedIn
417
+ */
418
+ function linkedin()
419
+ {
420
+ $url = "http://www.linkedin.com/shareArticle?mini=true&url={$this->encode_url}&title={$this->encode_title}";
421
+ $alt = __( "Share on LinkedIn", WP_SOCIAL_BOOKMARKING_LIGHT_DOMAIN );
422
+ $icon = WP_SOCIAL_BOOKMARKING_LIGHT_IMAGES_URL."/linkedin.png";
423
+ return $this->link( $url, $alt, $icon, 16, 16 );
424
+ }
425
+
426
+ /**
427
+ * @brief Evernote
428
+ */
429
+ function evernote()
430
+ {
431
+ $icon = WP_SOCIAL_BOOKMARKING_LIGHT_IMAGES_URL."/evernote.png";
432
+ $script = "(function(){EN_CLIP_HOST='http://www.evernote.com';try{var x=document.createElement('SCRIPT');x.type='text/javascript';x.src=EN_CLIP_HOST+'/public/bookmarkClipper.js?'+(new Date().getTime()/100000);document.getElementsByTagName('head')[0].appendChild(x);}catch(e){location.href=EN_CLIP_HOST+'/clip.action?url='+encodeURIComponent(location.href)+'&title='+encodeURIComponent(document.title);}})();";
433
+ $img = "<img src='${icon}' width='16' height='16' />";
434
+ return $this->link_raw( "<a href='#' title='Clip to Evernote' onclick=\"${script} return false;\">${img}</a>" );
435
+ }
436
+
437
+ /**
438
+ * @brief Instapaper
439
+ */
440
+ function instapaper()
441
+ {
442
+ $href = "javascript:function iprl5(){var d=document,z=d.createElement(&#039;scr&#039;+&#039;ipt&#039;),b=d.body,l=d.location;try{if(!b)throw(0);d.title=&#039;(Saving...) &#039;+d.title;z.setAttribute(&#039;src&#039;,l.protocol+&#039;//www.instapaper.com/j/GKo8MDzHWjRx?u=&#039;+encodeURIComponent(l.href)+&#039;&amp;t=&#039;+(new Date().getTime()));b.appendChild(z);}catch(e){alert(&#039;Please wait until the page has loaded.&#039;);}}iprl5();void(0)";
443
+ return $this->link_raw( '<a href="'.$href.'" class="wp_social_bookmarking_light_instapaper" style="line-height:17px !important" title="Read Later">Read Later</a>' );
444
+ }
445
+
446
+ /**
447
+ * @brief StumbleUpon
448
+ */
449
+ function stumbleupon()
450
+ {
451
+ $url = "http://www.stumbleupon.com/submit?url={$this->encode_url}&title={$this->encode_title}";
452
+ $alt = __( "Share on StumbleUpon", WP_SOCIAL_BOOKMARKING_LIGHT_DOMAIN );
453
+ $icon = WP_SOCIAL_BOOKMARKING_LIGHT_IMAGES_URL."/stumbleupon.png";
454
+ return $this->link( $url, $alt, $icon, 16, 16 );
455
+ }
456
+
457
+ /**
458
+ * @brief mixi Check
459
+ */
460
+ function mixi()
461
+ {
462
+ $options = wp_social_bookmarking_light_options();
463
+ $data_button = $options['mixi']['button'];
464
+ $data_key = $options['mixi']['check_key'];
465
+
466
+ return $this->link_raw( '<a href="http://mixi.jp/share.pl" class="mixi-check-button"'
467
+ ." data-url='{$this->url}'"
468
+ ." data-button='{$data_button}'"
469
+ ." data-key='{$data_key}'>Check</a>"
470
+ .'<script type="text/javascript" src="http://static.mixi.jp/js/share.js"></script>' );
471
+ }
472
+
473
+ /**
474
+ * @brief GREE Social Feedback
475
+ */
476
+ function gree()
477
+ {
478
+ $options = wp_social_bookmarking_light_options();
479
+ $url = $this->encode_url;
480
+ $type = $options['gree']['button_type'];
481
+ $size = $options['gree']['button_size'];
482
+ switch($type){
483
+ case '0': $btn_type = 'btn_iine'; break;
484
+ case '1': $btn_type = 'btn_kininaru'; break;
485
+ case '2': $btn_type = 'btn_osusume'; break;
486
+ case '3': $btn_type = 'btn_share'; break;
487
+ case '4': $btn_type = 'btn_logo'; break;
488
+ default: $btn_type = 'btn_logo';
489
+ }
490
+ $alt = __( "Share on GREE", WP_SOCIAL_BOOKMARKING_LIGHT_DOMAIN );
491
+ return $this->link_raw('<a href="http://gree.jp/?mode=share&act=write'
492
+ .'&url='.$url
493
+ .'&button_type='.$type
494
+ .'&button_size='.$size
495
+ .'&guid=ON" '
496
+ .'title="'.$alt.'" target=_blank>'
497
+ .'<img alt="'.$alt.'" title="'.$alt.'" '
498
+ .'src="http://i.share.gree.jp/img/share/button/'.$btn_type.'_'.$size.'.png">'
499
+ .'</a>');
500
+ }
501
+ }
502
+
503
+ /**
504
+ * class method
505
+ * @return array
506
+ */
507
+ function wp_social_bookmarking_light_get_class_methods(){
508
+ $all_methods = get_class_methods('WpSocialBookmarkingLight');
509
+ $except_methods = array('WpSocialBookmarkingLight', 'to_utf8', 'link_raw', 'link', 'get_methods');
510
+ $methods = array();
511
+ foreach($all_methods as $method){
512
+ if(in_array($method, $except_methods)){
513
+ continue;
514
+ }
515
+ $methods[] = $method;
516
+ }
517
+ return $methods;
518
+ }
readme.txt CHANGED
@@ -1,10 +1,10 @@
1
  === WP Social Bookmarking Light ===
2
  Contributors: utahvich
3
- Donate link: http://pledgie.com/campaigns/14051
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
5
  Requires at least: 2.9.0
6
- Tested up to: 3.0.3
7
- Stable tag: 1.6.4
8
 
9
  This plugin inserts social share links at the top or bottom of each post.
10
 
@@ -17,6 +17,7 @@ This is the list of used social sites:
17
  * Hatena
18
  * Facebook
19
  * Facebook Like Button
 
20
  * Twitter
21
  * Livedoor Clip
22
  * BuzzURL
@@ -54,6 +55,11 @@ This is the list of used social sites:
54
 
55
  == Changelog ==
56
 
 
 
 
 
 
57
  = 1.6.4 =
58
  * Updated: Administration Page.
59
 
@@ -69,8 +75,8 @@ This is the list of used social sites:
69
  = 1.6.0 =
70
  * Added: Hatena Bookmark Button.
71
  * Updated: Administration Page.
72
- * Bug fixed: Twitter button did not work on the top page. [yuya-takeyama](https://gist.github.com/675159)++
73
- * Bug fixed: Mixi button did not work on the top page.
74
 
75
  = 1.5.2 =
76
  * Added Facebook Like Button.
1
  === WP Social Bookmarking Light ===
2
  Contributors: utahvich
3
+ 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
5
  Requires at least: 2.9.0
6
+ Tested up to: 3.1.1
7
+ Stable tag: 1.6.5
8
 
9
  This plugin inserts social share links at the top or bottom of each post.
10
 
17
  * Hatena
18
  * Facebook
19
  * Facebook Like Button
20
+ * Facebook Send Button
21
  * Twitter
22
  * Livedoor Clip
23
  * BuzzURL
55
 
56
  == Changelog ==
57
 
58
+ = 1.6.5 =
59
+ * Added: Facebook Send Button.
60
+ * Added: Options for gree.
61
+ * Updated: Options for Facebook Like Button.
62
+
63
  = 1.6.4 =
64
  * Updated: Administration Page.
65
 
75
  = 1.6.0 =
76
  * Added: Hatena Bookmark Button.
77
  * Updated: Administration Page.
78
+ * Bug fixed: The twitter button did not work on the top page. [yuya-takeyama](https://gist.github.com/675159)++
79
+ * Bug fixed: The mixi button did not work on the top page.
80
 
81
  = 1.5.2 =
82
  * Added Facebook Like Button.
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.4
9
  */
10
  /*
11
  Copyright 2010 utahta (email : labs.ninxit@gmail.com)
@@ -25,772 +25,28 @@ along with this program; if not, write to the Free Software
25
  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
26
  */
27
 
 
 
28
  define( "WP_SOCIAL_BOOKMARKING_LIGHT_URL", WP_PLUGIN_URL."/wp-social-bookmarking-light" );
29
  define( "WP_SOCIAL_BOOKMARKING_LIGHT_IMAGES_URL", WP_SOCIAL_BOOKMARKING_LIGHT_URL."/images" );
30
  define( "WP_SOCIAL_BOOKMARKING_LIGHT_DOMAIN", "wp-social-bookmarking-light" );
31
 
32
- load_plugin_textdomain( WP_SOCIAL_BOOKMARKING_LIGHT_DOMAIN,
33
- "wp-content/plugins/wp-social-bookmarking-light/po" );
34
-
35
- class WpSocialBookmarkingLight
36
- {
37
- var $url;
38
- var $title;
39
- var $encode_url;
40
- var $encode_title;
41
- var $encode_blogname;
42
-
43
- function WpSocialBookmarkingLight( $url, $title, $blogname )
44
- {
45
- $title = $this->to_utf8( $title );
46
- $blogname = $this->to_utf8( $blogname );
47
- $this->url = $url;
48
- $this->title = $title;
49
- $this->encode_url = rawurlencode( $url );
50
- $this->encode_title = rawurlencode( $title );
51
- $this->encode_blogname = rawurlencode( $blogname );
52
- }
53
-
54
- function to_utf8( $str )
55
- {
56
- $charset = get_settings( 'blog_charset' );
57
- if( strcasecmp( $charset, 'UTF-8' ) != 0 && function_exists('mb_convert_encoding') ){
58
- $str = mb_convert_encoding( $str, 'UTF-8', $charset );
59
- }
60
- return $str;
61
- }
62
-
63
- function link_raw( $url ){
64
- return $url;
65
- }
66
- function link( $url, $alt, $icon, $width, $height ){
67
- $width = $width ? "width='$width'" : "";
68
- $height = $height ? "height='$height'" : "";
69
- return "<a href='{$url}' title='{$alt}' rel=nofollow class='wp_social_bookmarking_light_a' target=_blank>"
70
- ."<img src='{$icon}' alt='{$alt}' title='{$alt}' $width $height class='wp_social_bookmarking_light_img' />"
71
- ."</a>";
72
- }
73
-
74
- /**
75
- * @brief Hatena Bookmark
76
- */
77
- function hatena()
78
- {
79
- $url = "http://b.hatena.ne.jp/add?mode=confirm&url={$this->encode_url}&title={$this->encode_title}";
80
- $alt = __( "Bookmark this on Hatena Bookmark", WP_SOCIAL_BOOKMARKING_LIGHT_DOMAIN );
81
- $icon = WP_SOCIAL_BOOKMARKING_LIGHT_IMAGES_URL."/hatena.gif";
82
- return $this->link( $url, $alt, $icon, 16, 12 );
83
- }
84
- function hatena_users()
85
- {
86
- $url = "http://b.hatena.ne.jp/entry/{$this->url}";
87
- $alt = sprintf( __("Hatena Bookmark - %s", WP_SOCIAL_BOOKMARKING_LIGHT_DOMAIN), $this->title );
88
- $icon = "http://b.hatena.ne.jp/entry/image/{$this->url}";
89
- return $this->link( $url, $alt, $icon, null, null );
90
- }
91
- function hatena_button()
92
- {
93
- $options = wp_social_bookmarking_light_options();
94
- $url = "http://b.hatena.ne.jp/entry/{$this->url}";
95
- $title = $this->title;
96
- $alt = __( "Bookmark this on Hatena Bookmark", WP_SOCIAL_BOOKMARKING_LIGHT_DOMAIN );
97
- return $this->link_raw('<a href="'.$url.'"'
98
- .' class="hatena-bookmark-button"'
99
- .' data-hatena-bookmark-title="'.$title.'"'
100
- .' data-hatena-bookmark-layout="'.$options['hatena_button']['layout'].'"'
101
- .' title="'.$alt.'">'
102
- .' <img src="http://b.st-hatena.com/images/entry-button/button-only.gif"'
103
- .' alt="'.$alt.'" width="20" height="20" style="border: none;" /></a>'
104
- .'<script type="text/javascript" src="http://b.st-hatena.com/js/bookmark_button.js" charset="utf-8" async="async"></script>');
105
- }
106
-
107
- /**
108
- * @brief twib
109
- */
110
- function twib()
111
- {
112
- $url = "http://twib.jp/share?url={$this->encode_url}";
113
- $alt = __( "Post to Twitter", WP_SOCIAL_BOOKMARKING_LIGHT_DOMAIN );
114
- $icon = WP_SOCIAL_BOOKMARKING_LIGHT_IMAGES_URL."/twib.gif";
115
- return $this->link( $url, $alt, $icon, 18, 18 );
116
- }
117
- function twib_users()
118
- {
119
- $url = "http://twib.jp/url/{$this->url}";
120
- $alt = sprintf( __("Tweets - %s", WP_SOCIAL_BOOKMARKING_LIGHT_DOMAIN), $this->title );
121
- $icon = "http://image.twib.jp/counter/{$this->url}";
122
- return $this->link( $url, $alt, $icon, null, null );
123
- }
124
-
125
- /**
126
- * @brief tweetmeme
127
- */
128
- function tweetmeme()
129
- {
130
- return $this->link_raw( "<script type='text/javascript'>"
131
- ."tweetmeme_style = 'compact';"
132
- ."tweetmeme_url='{$this->url}';"
133
- ."</script>"
134
- ."<script type='text/javascript' src='http://tweetmeme.com/i/scripts/button.js'></script>" );
135
- }
136
-
137
- /**
138
- * @brief twitter
139
- */
140
- function twitter()
141
- {
142
- $options = wp_social_bookmarking_light_options();
143
- $twitter = $options['twitter'];
144
- return $this->link_raw('<iframe allowtransparency="true" frameborder="0" scrolling="no"'
145
- .' src="http://platform.twitter.com/widgets/tweet_button.html'
146
- .'?url='.$this->encode_url
147
- .'&amp;text='.$this->encode_title
148
- .'&amp;via='.$twitter['via']
149
- .'&amp;lang='.$twitter['lang']
150
- .'&amp;count='.$twitter['count']
151
- .'"'
152
- .' style="width:'.$twitter['width'].'px; height:'.$twitter['height'].'px;">'
153
- .'</iframe>');
154
- }
155
-
156
- /**
157
- * @brief Livedoor Clip
158
- */
159
- function livedoor()
160
- {
161
- $url = "http://clip.livedoor.com/redirect?link={$this->encode_url}&title={$this->encode_blogname}%20-%20{$this->encode_title}&ie=utf-8";
162
- $alt = __( "Bookmark this on Livedoor Clip", WP_SOCIAL_BOOKMARKING_LIGHT_DOMAIN );
163
- $icon = WP_SOCIAL_BOOKMARKING_LIGHT_IMAGES_URL."/livedoor.gif";
164
- return $this->link( $url, $alt, $icon, 16, 16 );
165
- }
166
- function livedoor_users()
167
- {
168
- $url = "http://clip.livedoor.com/page/{$this->url}";
169
- $alt = sprintf( __("Livedoor Clip - %s", WP_SOCIAL_BOOKMARKING_LIGHT_DOMAIN), $this->title );
170
- $icon = "http://image.clip.livedoor.com/counter/{$this->url}";
171
- return $this->link( $url, $alt, $icon, null, null );
172
- }
173
-
174
- /**
175
- * @brief Yahoo!JAPAN Bookmark
176
- */
177
- function yahoo()
178
- {
179
- $url = "http://bookmarks.yahoo.co.jp/bookmarklet/showpopup?t={$this->encode_title}&u={$this->encode_url}&ei=UTF-8";
180
- $alt = __( "Bookmark this on Yahoo Bookmark", WP_SOCIAL_BOOKMARKING_LIGHT_DOMAIN );
181
- $icon = WP_SOCIAL_BOOKMARKING_LIGHT_IMAGES_URL."/yahoo.gif";
182
- return $this->link( $url, $alt, $icon, 16, 16 );
183
- }
184
- function yahoo_users()
185
- {
186
- return $this->link_raw( "<script src='http://num.bookmarks.yahoo.co.jp/numimage.js?disptype=small'></script>" );
187
- }
188
-
189
- /**
190
- * @brief Yahoo Buzz
191
- */
192
- function yahoo_buzz()
193
- {
194
- $url = "http://buzz.yahoo.com/buzz?targetUrl={$this->encode_url}&headline={$this->encode_title}";
195
- $alt = __( "Buzz This", WP_SOCIAL_BOOKMARKING_LIGHT_DOMAIN );
196
- $icon = WP_SOCIAL_BOOKMARKING_LIGHT_IMAGES_URL."/yahoo_buzz.png";
197
- return $this->link( $url, $alt, $icon, 16, 16 );
198
- }
199
-
200
- /**
201
- * @brief BuzzURL
202
- */
203
- function buzzurl()
204
- {
205
- $url = "http://buzzurl.jp/entry/{$this->url}";
206
- $alt = __( "Bookmark this on BuzzURL", WP_SOCIAL_BOOKMARKING_LIGHT_DOMAIN );
207
- $icon = WP_SOCIAL_BOOKMARKING_LIGHT_IMAGES_URL."/buzzurl.gif";
208
- return $this->link( $url, $alt, $icon, 21, 15 );
209
- }
210
- function buzzurl_users()
211
- {
212
- $url = "http://buzzurl.jp/entry/{$this->url}";
213
- $alt = sprintf( __("BuzzURL - %s", WP_SOCIAL_BOOKMARKING_LIGHT_DOMAIN), $this->title );
214
- $icon = "http://api.buzzurl.jp/api/counter/v1/image?url={$this->encode_url}";
215
- return $this->link( $url, $alt, $icon, null, null );
216
- }
217
-
218
- /**
219
- * @brief nifty clip
220
- */
221
- function nifty()
222
- {
223
- $url = "http://clip.nifty.com/create?url={$this->encode_url}&title={$this->encode_title}";
224
- $alt = __( "Bookmark this on @nifty clip", WP_SOCIAL_BOOKMARKING_LIGHT_DOMAIN );
225
- $icon = WP_SOCIAL_BOOKMARKING_LIGHT_IMAGES_URL."/nifty.gif";
226
- return $this->link( $url, $alt, $icon, 16, 16 );
227
- }
228
- function nifty_users()
229
- {
230
- $url = '#';
231
- $alt = sprintf( __("@nifty clip - %s", WP_SOCIAL_BOOKMARKING_LIGHT_DOMAIN), $this->title );
232
- $icon = "http://api.clip.nifty.com/api/v1/image/counter/{$this->url}";
233
- return $this->link( $url, $alt, $icon, null, null );
234
- }
235
-
236
- /**
237
- * @brief Tumblr
238
- */
239
- function tumblr()
240
- {
241
- $url = "http://www.tumblr.com/share?v=3&u={$this->encode_url}&t={$this->encode_title}";
242
- $alt = __( "Share on Tumblr", WP_SOCIAL_BOOKMARKING_LIGHT_DOMAIN );
243
- $icon = WP_SOCIAL_BOOKMARKING_LIGHT_IMAGES_URL."/tumblr.png";
244
- return $this->link( $url, $alt, $icon, 16, 16 );
245
- }
246
-
247
- /**
248
- * @brief FC2 Bookmark
249
- */
250
- function fc2()
251
- {
252
- $url = "http://bookmark.fc2.com/user/post?url={$this->encode_url}&title={$this->encode_title}";
253
- $alt = __( "Bookmark this on FC2 Bookmark", WP_SOCIAL_BOOKMARKING_LIGHT_DOMAIN );
254
- $icon = WP_SOCIAL_BOOKMARKING_LIGHT_IMAGES_URL."/fc2.gif";
255
- return $this->link( $url, $alt, $icon, 16, 16 );
256
- }
257
- function fc2_users()
258
- {
259
- $url = "http://bookmark.fc2.com/search/detail?url={$this->encode_url}";
260
- $alt = sprintf( __("FC2 Bookmark - %s", WP_SOCIAL_BOOKMARKING_LIGHT_DOMAIN), $this->title );
261
- $icon = "http://bookmark.fc2.com/image/users/{$this->url}";
262
- return $this->link( $url, $alt, $icon, null, null );
263
- }
264
-
265
- /**
266
- * @brief newsing
267
- */
268
- function newsing()
269
- {
270
- $url = "http://newsing.jp/nbutton?url={$this->encode_url}&title={$this->encode_title}";
271
- $alt = __( "Newsing it!", WP_SOCIAL_BOOKMARKING_LIGHT_DOMAIN );
272
- $icon = WP_SOCIAL_BOOKMARKING_LIGHT_IMAGES_URL."/newsing.gif";
273
- return $this->link( $url, $alt, $icon, 16, 16 );
274
- }
275
-
276
- /**
277
- * @brief Choix
278
- */
279
- function choix()
280
- {
281
- $url = "http://www.choix.jp/bloglink/{$this->url}";
282
- $alt = __( "Choix it!", WP_SOCIAL_BOOKMARKING_LIGHT_DOMAIN );
283
- $icon = WP_SOCIAL_BOOKMARKING_LIGHT_IMAGES_URL."/choix.gif";
284
- return $this->link( $url, $alt, $icon, 16, 16 );
285
- }
286
-
287
- /**
288
- * @brief Google Bookmarks
289
- */
290
- function google()
291
- {
292
- $url = "http://www.google.com/bookmarks/mark?op=add&bkmk={$this->encode_url}&title={$this->encode_title}";
293
- $alt = __( "Bookmark this on Google Bookmarks", WP_SOCIAL_BOOKMARKING_LIGHT_DOMAIN );
294
- $icon = WP_SOCIAL_BOOKMARKING_LIGHT_IMAGES_URL."/google.png";
295
- return $this->link( $url, $alt, $icon, 16, 16 );
296
- }
297
-
298
- /**
299
- * @brief Google Buzz
300
- */
301
- function google_buzz()
302
- {
303
- $url = "http://www.google.com/buzz/post?url={$this->encode_url}&message={$this->encode_title}";
304
- $alt = __( "Post to Google Buzz", WP_SOCIAL_BOOKMARKING_LIGHT_DOMAIN );
305
- $icon = WP_SOCIAL_BOOKMARKING_LIGHT_IMAGES_URL."/google-buzz.png";
306
- return $this->link( $url, $alt, $icon, 16, 16 );
307
- }
308
-
309
- /**
310
- * @brief Delicious
311
- */
312
- function delicious()
313
- {
314
- $url = "http://delicious.com/save?url={$this->encode_url}&title={$this->encode_title}";
315
- $alt = __( "Bookmark this on Delicious", WP_SOCIAL_BOOKMARKING_LIGHT_DOMAIN );
316
- $icon = WP_SOCIAL_BOOKMARKING_LIGHT_IMAGES_URL."/delicious.png";
317
- return $this->link( $url, $alt, $icon, 16, 16 );
318
- }
319
-
320
- /**
321
- * @brief Digg
322
- */
323
- function digg()
324
- {
325
- $url = "http://digg.com/submit?url={$this->encode_url}&title={$this->encode_title}";
326
- $alt = __( "Bookmark this on Digg", WP_SOCIAL_BOOKMARKING_LIGHT_DOMAIN );
327
- $icon = WP_SOCIAL_BOOKMARKING_LIGHT_IMAGES_URL."/digg.png";
328
- return $this->link( $url, $alt, $icon, 16, 16 );
329
- }
330
-
331
- /**
332
- * @brief Friend feed
333
- */
334
- function friendfeed()
335
- {
336
- $url = "http://friendfeed.com/?url={$this->encode_url}&title={$this->encode_title}";
337
- $alt = __( "Share on FriendFeed", WP_SOCIAL_BOOKMARKING_LIGHT_DOMAIN );
338
- $icon = WP_SOCIAL_BOOKMARKING_LIGHT_IMAGES_URL."/friendfeed.png";
339
- return $this->link( $url, $alt, $icon, 16, 16 );
340
- }
341
-
342
- /**
343
- * @brief Facebook
344
- */
345
- function facebook()
346
- {
347
- $url = "http://www.facebook.com/share.php?u={$this->encode_url}&t={$this->encode_title}";
348
- $alt = __( "Share on Facebook", WP_SOCIAL_BOOKMARKING_LIGHT_DOMAIN );
349
- $icon = WP_SOCIAL_BOOKMARKING_LIGHT_IMAGES_URL."/facebook.png";
350
- return $this->link( $url, $alt, $icon, 16, 16 );
351
- }
352
-
353
- /**
354
- * @brief Facebook Like Button
355
- */
356
- function facebook_like()
357
- {
358
- $options = wp_social_bookmarking_light_options();
359
- $action = $options['facebook_like']['action'];
360
- $colorscheme = $options['facebook_like']['colorscheme'];
361
-
362
- return $this->link_raw('<iframe src="http://www.facebook.com/plugins/like.php?href='.$this->encode_url
363
- .'&amp;layout=button_count'
364
- .'&amp;show_faces=false'
365
- .'&amp;width=80'
366
- .'&amp;action='.$action
367
- .'&amp;colorscheme='.$colorscheme
368
- .'&amp;height=20"'
369
- .' scrolling="no" frameborder="0"'
370
- .' style="border:none; overflow:hidden; width:100px; height:20px;"'
371
- .' allowTransparency="true"></iframe>');
372
- }
373
-
374
- /**
375
- * @brief reddit
376
- */
377
- function reddit()
378
- {
379
- $url = "http://www.reddit.com/submit?url={$this->encode_url}&title={$this->encode_title}";
380
- $alt = __( "Share on reddit", WP_SOCIAL_BOOKMARKING_LIGHT_DOMAIN );
381
- $icon = WP_SOCIAL_BOOKMARKING_LIGHT_IMAGES_URL."/reddit.png";
382
- return $this->link( $url, $alt, $icon, 16, 16 );
383
- }
384
-
385
- /**
386
- * @brief LinkedIn
387
- */
388
- function linkedin()
389
- {
390
- $url = "http://www.linkedin.com/shareArticle?mini=true&url={$this->encode_url}&title={$this->encode_title}";
391
- $alt = __( "Share on LinkedIn", WP_SOCIAL_BOOKMARKING_LIGHT_DOMAIN );
392
- $icon = WP_SOCIAL_BOOKMARKING_LIGHT_IMAGES_URL."/linkedin.png";
393
- return $this->link( $url, $alt, $icon, 16, 16 );
394
- }
395
-
396
- /**
397
- * @brief Evernote
398
- */
399
- function evernote()
400
- {
401
- $icon = WP_SOCIAL_BOOKMARKING_LIGHT_IMAGES_URL."/evernote.png";
402
- $script = "(function(){EN_CLIP_HOST='http://www.evernote.com';try{var x=document.createElement('SCRIPT');x.type='text/javascript';x.src=EN_CLIP_HOST+'/public/bookmarkClipper.js?'+(new Date().getTime()/100000);document.getElementsByTagName('head')[0].appendChild(x);}catch(e){location.href=EN_CLIP_HOST+'/clip.action?url='+encodeURIComponent(location.href)+'&title='+encodeURIComponent(document.title);}})();";
403
- $img = "<img src='${icon}' width='16' height='16' />";
404
- return $this->link_raw( "<a href='#' title='Clip to Evernote' onclick=\"${script} return false;\">${img}</a>" );
405
- }
406
-
407
- /**
408
- * @brief Instapaper
409
- */
410
- function instapaper()
411
- {
412
- $href = "javascript:function iprl5(){var d=document,z=d.createElement(&#039;scr&#039;+&#039;ipt&#039;),b=d.body,l=d.location;try{if(!b)throw(0);d.title=&#039;(Saving...) &#039;+d.title;z.setAttribute(&#039;src&#039;,l.protocol+&#039;//www.instapaper.com/j/GKo8MDzHWjRx?u=&#039;+encodeURIComponent(l.href)+&#039;&amp;t=&#039;+(new Date().getTime()));b.appendChild(z);}catch(e){alert(&#039;Please wait until the page has loaded.&#039;);}}iprl5();void(0)";
413
- return $this->link_raw( '<a href="'.$href.'" class="wp_social_bookmarking_light_instapaper" style="line-height:17px !important" title="Read Later">Read Later</a>' );
414
- }
415
-
416
- /**
417
- * @brief StumbleUpon
418
- */
419
- function stumbleupon()
420
- {
421
- $url = "http://www.stumbleupon.com/submit?url={$this->encode_url}&title={$this->encode_title}";
422
- $alt = __( "Share on StumbleUpon", WP_SOCIAL_BOOKMARKING_LIGHT_DOMAIN );
423
- $icon = WP_SOCIAL_BOOKMARKING_LIGHT_IMAGES_URL."/stumbleupon.png";
424
- return $this->link( $url, $alt, $icon, 16, 16 );
425
- }
426
-
427
- /**
428
- * @brief mixi Check
429
- */
430
- function mixi()
431
- {
432
- $options = wp_social_bookmarking_light_options();
433
- $data_button = $options['mixi']['button'];
434
- $data_key = $options['mixi']['check_key'];
435
-
436
- return $this->link_raw( '<a href="http://mixi.jp/share.pl" class="mixi-check-button"'
437
- ." data-url='{$this->url}'"
438
- ." data-button='{$data_button}'"
439
- ." data-key='{$data_key}'>Check</a>"
440
- .'<script type="text/javascript" src="http://static.mixi.jp/js/share.js"></script>' );
441
- }
442
-
443
- /**
444
- * @brief GREE Social Feedback
445
- */
446
- function gree()
447
- {
448
- $url = "http://gree.jp/?mode=share&act=write&url={$this->encode_url}&title={$this->encode_title}&site_type=website";
449
- $alt = __( "Share on GREE", WP_SOCIAL_BOOKMARKING_LIGHT_DOMAIN );
450
- $icon = WP_SOCIAL_BOOKMARKING_LIGHT_IMAGES_URL."/gree.png";
451
- return $this->link( $url, $alt, $icon, 16, 16 );
452
- }
453
-
454
- }
455
-
456
- function wp_social_bookmarking_light_get_class_methods(){
457
- $all_methods = get_class_methods('WpSocialBookmarkingLight');
458
- $except_methods = array('WpSocialBookmarkingLight', 'to_utf8', 'link_raw', 'link', 'get_methods');
459
- $methods = array();
460
- foreach($all_methods as $method){
461
- if(in_array($method, $except_methods)){
462
- continue;
463
- }
464
- $methods[] = $method;
465
- }
466
- return $methods;
467
- }
468
-
469
- function wp_social_bookmarking_light_default_options()
470
- {
471
- return array( "services" => "hatena, hatena_users, facebook, google_buzz, yahoo, livedoor, friendfeed, tweetmeme",
472
- "position" => "top",
473
- "single_page" => true,
474
- "is_page" => true,
475
- "mixi" => array('check_key' => '',
476
- 'check_robots' => 'noimage',
477
- 'button' => 'button-3'),
478
- "twitter" => array('via' => "",
479
- 'lang' => "en",
480
- 'count' => 'horizontal',
481
- 'width' => '130',
482
- 'height' => '20'),
483
- "hatena_button" => array('layout' => 'standard'),
484
- 'facebook_like' => array('action' => 'like',
485
- 'colorscheme' => 'light'),
486
- );
487
- }
488
-
489
- function wp_social_bookmarking_light_options()
490
- {
491
- $options = get_option("wp_social_bookmarking_light_options", array());
492
-
493
- // Compatibility version 1.5.2 or less
494
- if(!is_array($options['mixi'])){
495
- $options['mixi'] = array();
496
- if(isset($options['mixi_check_key']) || isset($options['mixi_check_robots'])){
497
- $options['mixi']['check_key'] = $options['mixi_check_key'];
498
- $options['mixi']['check_robots'] = $options['mixi_check_robots'];
499
- unset($options['mixi_check_key']);
500
- unset($options['mixi_check_robots']);
501
- }
502
- }
503
-
504
- // array merge recursive overwrite (1 depth)
505
- $default_options = wp_social_bookmarking_light_default_options();
506
- foreach( $default_options as $key => $val ){
507
- if(is_array($default_options[$key])){
508
- if(!is_array($options[$key])){
509
- $options[$key] = array();
510
- }
511
- $options[$key] = array_merge($default_options[$key], $options[$key]);
512
- }
513
- }
514
- return array_merge( wp_social_bookmarking_light_default_options(), $options );
515
- }
516
-
517
- function wp_social_bookmarking_light_wp_head()
518
- {
519
- // for mixi Check
520
- $options = wp_social_bookmarking_light_options();
521
- foreach( explode(",", $options['services']) as $service ){
522
- $service = trim($service);
523
- if( "mixi" == $service ){
524
- ?>
525
- <meta name="mixi-check-robots" content="<?php echo $options['mixi']['check_robots'] ?>" />
526
- <?php
527
- break;
528
- }
529
- }
530
-
531
- ?>
532
- <style type="text/css">
533
- div.wp_social_bookmarking_light{border:0 !important;padding:0 !important;margin:0 !important;}
534
- div.wp_social_bookmarking_light div{float:left !important;border:0 !important;padding:0 4px 0 0 !important;margin:0 !important;height:20px !important;text-indent:0 !important;}
535
- div.wp_social_bookmarking_light img{border:0 !important;padding:0;margin:0;vertical-align:top !important;}
536
- .wp_social_bookmarking_light_clear{clear:both !important;}
537
- a.wp_social_bookmarking_light_instapaper {display: inline-block;font-family: 'Lucida Grande', Verdana, sans-serif;font-weight: bold;font-size: 11px;-webkit-border-radius: 8px;-moz-border-radius: 8px;color: #fff;background-color: #626262;border: 1px solid #626262;padding: 0px 3px 0px;text-shadow: #3b3b3b 1px 1px 0px;min-width: 62px;text-align: center;vertical-align:top;line-height:20px;}
538
- a.wp_social_bookmarking_light_instapaper, a.wp_social_bookmarking_light_instapaper:hover, a.wp_social_bookmarking_light_instapaper:active, a.wp_social_bookmarking_light_instapaper:visited {color: #fff; text-decoration: none; outline: none;}
539
- .wp_social_bookmarking_light_instapaper:focus {outline: none;}
540
- </style>
541
- <?php
542
- }
543
-
544
- function wp_social_bookmarking_light_output( $services, $link, $title )
545
- {
546
- $wp = new WpSocialBookmarkingLight( $link, $title, get_bloginfo('name') );
547
- $class_methods = wp_social_bookmarking_light_get_class_methods();
548
- $out = '';
549
- foreach( explode(",", $services) as $service ){
550
- $service = trim($service);
551
- if($service != ''){
552
- if(in_array($service, $class_methods)){
553
- $out .= '<div>'.call_user_func( array( $wp, $service ) ).'</div>'; // A WpSocialBookmarkingLight method is called.
554
- }
555
- else{
556
- $out .= "<div>[`$service` not found]</div>";
557
- }
558
- }
559
- }
560
- if( $out == '' ){
561
- return $out;
562
- }
563
- return "<div class='wp_social_bookmarking_light'>{$out}</div><br class='wp_social_bookmarking_light_clear' />";
564
  }
565
 
566
- function wp_social_bookmarking_light_output_e( $services=null, $link=null, $title=null )
567
- {
568
- if($services == null){
569
- $options = wp_social_bookmarking_light_options();
570
- $services = $options['services'];
571
- }
572
- echo wp_social_bookmarking_light_output( $services, $link, $title );
573
- }
574
-
575
- function wp_social_bookmarking_light_the_content( $content )
576
- {
577
- if( is_feed() || is_404() || is_robots() || is_comments_popup() || (function_exists( 'is_ktai' ) && is_ktai()) ){
578
- return $content;
579
- }
580
-
581
- $options = wp_social_bookmarking_light_options();
582
- if( $options['single_page'] && !is_singular() ){
583
- return $content;
584
- }
585
- if( !$options['is_page'] && is_page() ){
586
- return $content;
587
- }
588
-
589
- $out = wp_social_bookmarking_light_output( $options['services'], get_permalink(), get_the_title() );
590
- if( $out == '' ){
591
- return $content;
592
- }
593
- if( $options['position'] == 'top' ){
594
- return "{$out}{$content}";
595
- }
596
- else if( $options['position'] == 'bottom' ){
597
- return "{$content}{$out}";
598
- }
599
- return $content;
600
- }
601
 
602
- // admin pages
603
- function wp_social_bookmarking_light_admin_print_scripts()
604
- {
605
- wp_enqueue_script('jquery');
606
- wp_enqueue_script('jquery-ui-core');
607
- wp_enqueue_script('jquery-ui-tabs');
608
- wp_enqueue_script('jquery-ui-sortable');
609
- wp_enqueue_script('jquery-ui-draggable');
610
- }
611
 
612
- function wp_social_bookmarking_light_admin_print_styles()
613
- {
614
- wp_enqueue_style('jquery-ui-tabs', WP_SOCIAL_BOOKMARKING_LIGHT_URL."/libs/jquery/css/pepper-grinder/jquery-ui-1.8.6.custom.css");
615
- }
616
-
617
- function wp_social_bookmarking_light_admin_head()
618
- {
619
- ?>
620
- <style type="text/css">
621
- .wsbl_options{
622
- border: 1px solid #CCCCCC;
623
- background-color: #F8F8EB;
624
- vertical-align: top;
625
- margin: 0px 10px 10px 0px;
626
- padding: 0px;
627
- }
628
- .wsbl_options th{
629
- background-color: #E8E8DB;
630
- text-align: center;
631
- margin: 0px;
632
- padding: 3px;
633
- }
634
- .wsbl_options td{en
635
- text-align: left;
636
- margin: 0px;
637
- padding: 3px;
638
- }
639
-
640
- #wsbl_sortable, #wsbl_draggable {
641
- list-style-type: none;
642
- margin: 0;
643
- padding: 5px;
644
- overflow: auto;
645
- width: 160px;
646
- height: 240px;
647
- float: left;
648
- border: 1px solid #999;
649
- background-color: #FFF;
650
- }
651
- #wsbl_sortable li, #wsbl_draggable li{
652
- width: 120px;
653
- height: 20px;
654
- font-size: 12px;
655
- margin: 0px auto;
656
- padding: 3px;
657
- border: 1px solid #999;
658
- background-color: #F8F8EB;
659
- cursor: pointer;
660
- }
661
- .wsbl_sortable_highlight {
662
- border: 1px dashed #333 !important;
663
- background-color: transparent !important;
664
- }
665
- .wsbl_txt_draggable{
666
- float:left;
667
- }
668
- .wsbl_img_draggable{
669
- margin-left: auto;
670
- margin-right: 0;
671
- text-align: right;
672
- display: none;
673
- }
674
- .wsbl_point_left{
675
- float: left;
676
- height : 240px ;
677
- margin: 0 20px;
678
- }
679
- .wsbl_point_left img{
680
- margin-top: 90px;
681
- }
682
- </style>
683
-
684
- <script type="text/javascript" charset="utf-8">
685
- //<![CDATA[
686
-
687
- function wsbl_get_service_codes()
688
- {
689
- var val = jQuery("#services_id").val();
690
- return jQuery.map(val.split(","), function(n, i){
691
- return jQuery.trim(n);
692
- });
693
- }
694
-
695
- function wsbl_options_toggle(service_id, is_simply)
696
- {
697
- var has_option = jQuery.inArray(service_id, wsbl_get_service_codes()) >= 0;
698
-
699
- var service_id_settings = "#" + service_id + "_settings";
700
- if(is_simply){
701
- has_option ? jQuery(service_id_settings).show() : jQuery(service_id_settings).hide();
702
- }
703
- else{
704
- has_option ? jQuery(service_id_settings).slideDown() : jQuery(service_id_settings).slideUp();
705
- }
706
- }
707
-
708
- function wsbl_update_services(is_simply)
709
- {
710
- var vals = "";
711
- var service = jQuery("#wsbl_sortable .wsbl_txt_draggable");
712
- service.each(function(){
713
- vals += vals == "" ? "" : ",";
714
- vals += jQuery(this).text();
715
- });
716
- jQuery("#services_id").val(vals);
717
-
718
- is_simply = is_simply || false;
719
- wsbl_options_toggle("mixi", is_simply);
720
- wsbl_options_toggle("twitter", is_simply);
721
- wsbl_options_toggle("hatena_button", is_simply);
722
- wsbl_options_toggle("facebook_like", is_simply);
723
- }
724
-
725
- function wsbl_update_sortable()
726
- {
727
- jQuery("#wsbl_sortable .wsbl_img_draggable").each(function(){
728
- var button = jQuery(this);
729
- button.css("display", "block"); // show delete button.
730
- var img = jQuery("img", button);
731
- img.mousedown(function(){
732
- var p = jQuery(this).parents("li");
733
- p.slideUp("fast", function(){
734
- p.remove();
735
- wsbl_update_services();
736
- });
737
- });
738
- img.attr('src', '<?php echo WP_SOCIAL_BOOKMARKING_LIGHT_IMAGES_URL."/close_button.png"?>');
739
- img.hover(
740
- function(){
741
- jQuery(this).attr('src', '<?php echo WP_SOCIAL_BOOKMARKING_LIGHT_IMAGES_URL."/close_button2.png"?>');
742
- },
743
- function(){
744
- jQuery(this).attr('src', '<?php echo WP_SOCIAL_BOOKMARKING_LIGHT_IMAGES_URL."/close_button.png"?>');
745
- }
746
- );
747
- });
748
- }
749
-
750
- // read onece
751
- jQuery(document).ready(function(){
752
- jQuery("#wsbl_sortable").sortable({
753
- placeholder: "wsbl_sortable_highlight",
754
- update:function(e, ui){
755
- wsbl_update_sortable();
756
- wsbl_update_services();
757
- }
758
- });
759
-
760
- jQuery("#wsbl_draggable li").draggable({
761
- connectToSortable:"#wsbl_sortable",
762
- helper:'clone',
763
- revert:"invalid"
764
- });
765
- jQuery("#wsbl_draggable, #wsbl_sortable").disableSelection();
766
-
767
- wsbl_update_sortable();
768
- wsbl_update_services(true);
769
-
770
- jQuery("#tabs").tabs();
771
- });
772
- //]]>
773
- </script>
774
-
775
- <?php
776
- }
777
-
778
- function wp_social_bookmarking_light_admin_menu()
779
- {
780
- if( function_exists('add_options_page') ){
781
- $page = add_options_page( 'WP Social Bookmarking Light',
782
- 'WP Social Bookmarking Light',
783
- 'manage_options',
784
- __FILE__,
785
- 'wp_social_bookmarking_light_options_page' );
786
-
787
- add_action('admin_print_styles-'.$page, 'wp_social_bookmarking_light_admin_print_styles');
788
- add_action('admin_print_scripts-'.$page, 'wp_social_bookmarking_light_admin_print_scripts');
789
- add_action('admin_head-'.$page, 'wp_social_bookmarking_light_admin_head');
790
- }
791
- }
792
-
793
- // initialize all
794
  function wp_social_bookmarking_light_init()
795
  {
796
  add_action( 'wp_head', 'wp_social_bookmarking_light_wp_head' );
@@ -799,285 +55,4 @@ function wp_social_bookmarking_light_init()
799
  }
800
  add_action( 'init', 'wp_social_bookmarking_light_init' );
801
 
802
- // options page
803
- function wp_social_bookmarking_light_options_page()
804
- {
805
- if( isset( $_POST['save'] ) ){
806
- $options = array("services" => $_POST["services"],
807
- "position" => $_POST["position"],
808
- "single_page" => $_POST["single_page"] == 'true',
809
- "is_page" => $_POST["is_page"] == 'true',
810
- "mixi" => array('check_key' => $_POST["mixi_check_key"],
811
- 'check_robots' => $_POST["mixi_check_robots"],
812
- 'button' => $_POST['mixi_button']),
813
- "twitter" => array('via' => $_POST['twitter_via'],
814
- 'lang' => $_POST['twitter_lang'],
815
- 'count' => $_POST['twitter_count'],
816
- 'width' => $_POST['twitter_width'],
817
- 'height' => $_POST['twitter_height']),
818
- 'hatena_button' => array('layout' => $_POST['hatena_button_layout']),
819
- 'facebook_like' => array('action' => $_POST['facebook_like_action'],
820
- 'colorscheme' => $_POST['facebook_like_colorscheme']),
821
- );
822
- update_option( 'wp_social_bookmarking_light_options', $options );
823
- echo '<div class="updated"><p><strong>'.__( 'Options saved.', WP_SOCIAL_BOOKMARKING_LIGHT_DOMAIN ).'</strong></p></div>';
824
- }
825
- else if( isset( $_POST['reset'] ) ){
826
- $options = wp_social_bookmarking_light_default_options();
827
- update_option( 'wp_social_bookmarking_light_options', $options );
828
- echo '<div class="updated"><p><strong>'.__( 'Reset options.', WP_SOCIAL_BOOKMARKING_LIGHT_DOMAIN ).'</strong></p></div>';
829
- }
830
- else{
831
- $options = wp_social_bookmarking_light_options();
832
- }
833
- $class_methods = wp_social_bookmarking_light_get_class_methods();
834
- ?>
835
-
836
- <div class="wrap">
837
- <h2>WP Social Bookmarking Light</h2>
838
-
839
- <form method='POST' action="<?php echo $_SERVER['REQUEST_URI'] ?>">
840
- <div id="tabs">
841
- <ul>
842
- <li><a href="#tabs-1"><span><?php _e("General Settings") ?></span></a></li>
843
- <li id='mixi_settings'><a href="#tabs-2"><span><?php _e("mixi") ?></span></a></li>
844
- <li id='twitter_settings'><a href="#tabs-3"><span><?php _e("twitter") ?></span></a></li>
845
- <li id='hatena_button_settings'><a href="#tabs-4"><span><?php _e("hatena_button") ?></span></a></li>
846
- <li id='facebook_like_settings'><a href="#tabs-5"><span><?php _e("facebook_like") ?></span></a></li>
847
- <li><a href="#tabs-10"><span><?php _e("Donate", WP_SOCIAL_BOOKMARKING_LIGHT_DOMAIN) ?></span></a></li>
848
- </ul>
849
- <div id="tabs-1">
850
- <table class='form-table'>
851
- <tr>
852
- <th scope="row"><?php _e('Position', WP_SOCIAL_BOOKMARKING_LIGHT_DOMAIN) ?>:</th>
853
- <td>
854
- <select name='position'>
855
- <option value='top' <?php if( $options['position'] == 'top' ) echo 'selected'; ?>>Top</option>
856
- <option value='bottom' <?php if( $options['position'] == 'bottom' ) echo 'selected'; ?>>Bottom</option>
857
- <option value='none' <?php if( $options['position'] == 'none' ) echo 'selected'; ?>>None</option>
858
- </select>
859
- </td>
860
- </tr>
861
- <tr>
862
- <th scope="row"><?php _e('Singular', WP_SOCIAL_BOOKMARKING_LIGHT_DOMAIN) ?>:</th>
863
- <td>
864
- <select name='single_page'>
865
- <option value='true' <?php if( $options['single_page'] == true ) echo 'selected'; ?>>Enabled</option>
866
- <option value='false' <?php if( $options['single_page'] == false ) echo 'selected'; ?>>Disabled</option>
867
- </select>
868
- </td>
869
- </tr>
870
- <tr>
871
- <th scope="row"><?php _e('Page', WP_SOCIAL_BOOKMARKING_LIGHT_DOMAIN) ?>:</th>
872
- <td>
873
- <select name='is_page'>
874
- <option value='true' <?php if( $options['is_page'] == true ) echo 'selected'; ?>>Enabled</option>
875
- <option value='false' <?php if( $options['is_page'] == false ) echo 'selected'; ?>>Disabled</option>
876
- </select>
877
- </td>
878
- </tr>
879
- <tr>
880
- <th scope="row"><?php _e('Services', WP_SOCIAL_BOOKMARKING_LIGHT_DOMAIN) ?>: <br/> <span style="font-size:10px">(drag-and-drop)</span></th>
881
- <td>
882
- <input type="text" id='services_id' name='services' value="<?php echo $options['services'] ?>"size=120 style="font-size:12px;" onclick="this.select(0, this.value.length)" readonly/>
883
- <br />
884
- <br />
885
- <ul id="wsbl_sortable">
886
- <?php
887
- foreach( explode(",", $options['services']) as $service ){
888
- $service = trim($service);
889
- if($service != ''){
890
- if(in_array($service, $class_methods)){
891
- echo "<li>"
892
- ."<div class='wsbl_txt_draggable'>$service</div>"
893
- ."<div class='wsbl_img_draggable'><img src=''></div>"
894
- ."<br clear='both'>"
895
- ."</li>\n";
896
- }
897
- }
898
- }
899
- ?>
900
- </ul>
901
- <div class="wsbl_point_left"><img src='<?php echo WP_SOCIAL_BOOKMARKING_LIGHT_IMAGES_URL."/point_left.png"?>'></div>
902
- <ul id="wsbl_draggable">
903
- <?php
904
- foreach($class_methods as $method){
905
- echo "<li>"
906
- ."<div class='wsbl_txt_draggable'>$method</div>"
907
- ."<div class='wsbl_img_draggable'><img src=''></div>"
908
- ."<br clear='both'>"
909
- ."</li>\n";
910
- }
911
- ?>
912
- </ul>
913
- <br clear="both"/>
914
- </td>
915
- </tr>
916
- </table>
917
- </div>
918
-
919
- <div id="tabs-2">
920
- <table class='form-table'>
921
- <tr>
922
- <th scope="row">Check Key:</th>
923
- <td>
924
- <input type="text" name='mixi_check_key' value="<?php echo $options['mixi']["check_key"] ?>" size=50 />
925
- </td>
926
- </tr>
927
- <tr>
928
- <th scope="row">Check Robots:</th>
929
- <td>
930
- <input type="text" name='mixi_check_robots' value="<?php echo $options['mixi']["check_robots"] ?>" size=50 />
931
- </td>
932
- </tr>
933
- <tr>
934
- <th scope="row">Layout:</th>
935
- <td>
936
- <select name='mixi_button'>
937
- <option value='button-1' <?php if( $options['mixi']['button'] == 'button-1' ) echo 'selected'; ?>>button-1</option>
938
- <option value='button-2' <?php if( $options['mixi']['button'] == 'button-2' ) echo 'selected'; ?>>button-2</option>
939
- <option value='button-3' <?php if( $options['mixi']['button'] == 'button-3' ) echo 'selected'; ?>>button-3</option>
940
- <option value='button-4' <?php if( $options['mixi']['button'] == 'button-4' ) echo 'selected'; ?>>button-4</option>
941
- </select>
942
- </td>
943
- </tr>
944
- </table>
945
- </div>
946
-
947
- <div id="tabs-3">
948
- <table class='form-table'>
949
- <tr>
950
- <th scope="row">Via: <br> <span style="font-size:10px">(your twitter account)</span></th>
951
- <td>
952
- <input type="text" name='twitter_via' value="<?php echo $options['twitter']['via'] ?>" size=50 />
953
- </td>
954
- </tr>
955
- <tr>
956
- <th scope="row">Language:</th>
957
- <td>
958
- <select name='twitter_lang'>
959
- <option value='en' <?php if( $options['twitter']['lang'] == 'en' ) echo 'selected'; ?>>English</option>
960
- <option value='fr' <?php if( $options['twitter']['lang'] == 'fr' ) echo 'selected'; ?>>French</option>
961
- <option value='de' <?php if( $options['twitter']['lang'] == 'de' ) echo 'selected'; ?>>German</option>
962
- <option value='es' <?php if( $options['twitter']['lang'] == 'es' ) echo 'selected'; ?>>Spanish</option>
963
- <option value='ja' <?php if( $options['twitter']['lang'] == 'ja' ) echo 'selected'; ?>>Japanese</option>
964
- </select>
965
- </td>
966
- </tr>
967
- <tr>
968
- <th scope="row">Count:</th>
969
- <td>
970
- <select name='twitter_count'>
971
- <option value='none' <?php if( $options['twitter']['count'] == 'none' ) echo 'selected'; ?>>none</option>
972
- <option value='horizontal' <?php if( $options['twitter']['count'] == 'horizontal' ) echo 'selected'; ?>>horizontal</option>
973
- </select>
974
- </td>
975
- </tr>
976
- <tr>
977
- <th scope="row">Width:</th>
978
- <td>
979
- <input type="text" name='twitter_width' value="<?php echo $options['twitter']['width'] ?>" size=20 />
980
- </td>
981
- </tr>
982
- <tr>
983
- <th scope="row">Height:</th>
984
- <td>
985
- <input type="text" name='twitter_height' value="<?php echo $options['twitter']['height'] ?>" size=20 />
986
- </td>
987
- </tr>
988
- </table>
989
- </div>
990
-
991
- <div id="tabs-4">
992
- <table class='form-table'>
993
- <tr>
994
- <th scope="row">Layout:</th>
995
- <td>
996
- <select name='hatena_button_layout'>
997
- <option value='standard' <?php if( $options['hatena_button']['layout'] == 'standard' ) echo 'selected'; ?>>standard</option>
998
- <option value='simple' <?php if( $options['hatena_button']['layout'] == 'simple' ) echo 'selected'; ?>>simple</option>
999
- </select>
1000
- </td>
1001
- </tr>
1002
- </table>
1003
- </div>
1004
-
1005
- <div id="tabs-5">
1006
- <table class='form-table'>
1007
- <tr>
1008
- <th scope="row">Action:</th>
1009
- <td>
1010
- <select name='facebook_like_action'>
1011
- <option value='like' <?php if( $options['facebook_like']['action'] == 'like' ) echo 'selected'; ?>>like</option>
1012
- <option value='recommend' <?php if( $options['facebook_like']['action'] == 'recommend' ) echo 'selected'; ?>>recommend</option>
1013
- </select>
1014
- </td>
1015
- </tr>
1016
- <tr>
1017
- <th scope="row">Color Scheme:</th>
1018
- <td>
1019
- <select name='facebook_like_colorscheme'>
1020
- <option value='light' <?php if( $options['facebook_like']['colorscheme'] == 'light' ) echo 'selected'; ?>>light</option>
1021
- <option value='dark' <?php if( $options['facebook_like']['colorscheme'] == 'dark' ) echo 'selected'; ?>>dark</option>
1022
- </select>
1023
- </td>
1024
- </tr>
1025
- </table>
1026
- </div>
1027
-
1028
- <div id="tabs-10">
1029
- <p>Your donation will help the development of "WP Social Bookmarking Light".</p>
1030
- <p>If you find it useful for you, feel free to lend your support.</p>
1031
- <a href='http://www.pledgie.com/campaigns/14051' target=_blank><img alt='Click here to lend your support to: WP Social Bookmarking Light and make a donation at www.pledgie.com !' src='http://www.pledgie.com/campaigns/14051.png?skin_name=chrome' border='0' /></a>
1032
- </div>
1033
- </div>
1034
- <p class="submit">
1035
- <input class="button-primary" type="submit" name='save' value='<?php _e('Save Changes') ?>' />
1036
- <input type="submit" name='reset' value='<?php _e('Reset') ?>' />
1037
- </p>
1038
- </form>
1039
-
1040
- <table class='wsbl_options'>
1041
- <tr><th><?php _e("Service Code", WP_SOCIAL_BOOKMARKING_LIGHT_DOMAIN) ?></th><th><?php _e("Explain", WP_SOCIAL_BOOKMARKING_LIGHT_DOMAIN) ?></th></tr>
1042
- <tr><td>hatena</td><td>Hatena Bookmark</td></tr>
1043
- <tr><td>hatena_users</td><td>Hatena Bookmark Users</td></tr>
1044
- <tr><td>hatena_button</td><td>Hatena Bookmark Button</td></tr>
1045
- <tr><td>twib</td><td>Twib - Twitter</td></tr>
1046
- <tr><td>twib_users</td><td>Twib Users - Twitter</td></tr>
1047
- <tr><td>tweetmeme</td><td>TweetMeme - Twitter</td></tr>
1048
- <tr><td>twitter</td><td>Tweet Button - Twitter</td></tr>
1049
- <tr><td>livedoor</td><td>Livedoor Clip</td></tr>
1050
- <tr><td>livedoor_users</td><td>Livedoor Clip Users</td></tr>
1051
- <tr><td>yahoo</td><td>Yahoo!JAPAN Bookmark</td></tr>
1052
- <tr><td>yahoo_users</td><td>Yahoo!JAPAN Bookmark Users</td></tr>
1053
- <tr><td>yahoo_buzz</td><td>Yahoo!Buzz</td></tr>
1054
- <tr><td>buzzurl</td><td>BuzzURL</td></tr>
1055
- <tr><td>buzzurl_users</td><td>BuzzURL Users</td></tr>
1056
- <tr><td>nifty</td><td>@nifty Clip</td></tr>
1057
- <tr><td>nifty_users</td><td>@nifty Clip Users</td></tr>
1058
- <tr><td>tumblr</td><td>Tumblr</td></tr>
1059
- <tr><td>fc2</td><td>FC2 Bookmark</td></tr>
1060
- <tr><td>fc2_users</td><td>FC2 Bookmark Users</td></tr>
1061
- <tr><td>newsing</td><td>newsing</td></tr>
1062
- <tr><td>choix</td><td>Choix</td></tr>
1063
- <tr><td>google</td><td>Google Bookmarks</td></tr>
1064
- <tr><td>google_buzz</td><td>Google Buzz</td></tr>
1065
- <tr><td>delicious</td><td>Delicious</td></tr>
1066
- <tr><td>digg</td><td>Digg</td></tr>
1067
- <tr><td>friendfeed</td><td>FriendFeed</td></tr>
1068
- <tr><td>facebook</td><td>Facebook Share</td></tr>
1069
- <tr><td>facebook_like</td><td>Facebook Like Button</td></tr>
1070
- <tr><td>reddit</td><td>reddit</td></tr>
1071
- <tr><td>linkedin</td><td>LinkedIn</td></tr>
1072
- <tr><td>evernote</td><td>Evernote</td></tr>
1073
- <tr><td>instapaper</td><td>Instapaper</td></tr>
1074
- <tr><td>stumbleupon</td><td>StumbleUpon</td></tr>
1075
- <tr><td>mixi</td><td>mixi Check (require <a href="http://developer.mixi.co.jp/connect/mixi_plugin/mixi_check/mixicheck" onclick="window.open('http://developer.mixi.co.jp/connect/mixi_plugin/mixi_check/mixicheck'); return false;" >mixi check key</a>)</td></tr>
1076
- <tr><td>gree</td><td>GREE Social Feedback</td></tr>
1077
- </table>
1078
- </div>
1079
-
1080
- <?php
1081
- }
1082
-
1083
  ?>
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.5
9
  */
10
  /*
11
  Copyright 2010 utahta (email : labs.ninxit@gmail.com)
25
  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
26
  */
27
 
28
+ // settings
29
+ define( "WP_SOCIAL_BOOKMARKING_LIGHT_DIR", WP_PLUGIN_DIR."/wp-social-bookmarking-light" );
30
  define( "WP_SOCIAL_BOOKMARKING_LIGHT_URL", WP_PLUGIN_URL."/wp-social-bookmarking-light" );
31
  define( "WP_SOCIAL_BOOKMARKING_LIGHT_IMAGES_URL", WP_SOCIAL_BOOKMARKING_LIGHT_URL."/images" );
32
  define( "WP_SOCIAL_BOOKMARKING_LIGHT_DOMAIN", "wp-social-bookmarking-light" );
33
 
34
+ // _e() local domain
35
+ function _el($val){
36
+ _e($val, WP_SOCIAL_BOOKMARKING_LIGHT_DOMAIN);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
37
  }
38
 
39
+ // load modules
40
+ require_once WP_SOCIAL_BOOKMARKING_LIGHT_DIR.'/modules/options.php';
41
+ require_once WP_SOCIAL_BOOKMARKING_LIGHT_DIR.'/modules/services.php';
42
+ require_once WP_SOCIAL_BOOKMARKING_LIGHT_DIR.'/modules/admin.php';
43
+ require_once WP_SOCIAL_BOOKMARKING_LIGHT_DIR.'/modules/content.php';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
44
 
45
+ // multilingualization
46
+ load_plugin_textdomain( WP_SOCIAL_BOOKMARKING_LIGHT_DOMAIN, false,
47
+ "wp-social-bookmarking-light/po" );
 
 
 
 
 
 
48
 
49
+ // initialize
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
50
  function wp_social_bookmarking_light_init()
51
  {
52
  add_action( 'wp_head', 'wp_social_bookmarking_light_wp_head' );
55
  }
56
  add_action( 'init', 'wp_social_bookmarking_light_init' );
57
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
58
  ?>