Version Description
- Added "Is Page" option.
- The name of the option was changed from "Single Page" to "Is Singular".
Download this release
Release Info
Developer | utahvich |
Plugin | WP Social Bookmarking Light |
Version | 1.2.0 |
Comparing to | |
See all releases |
Code changes from version 1.0.1 to 1.2.0
- readme.txt +13 -2
- screenshot-2.png +0 -0
- screenshot-3.png +0 -0
- wp-social-bookmarking-light.php +49 -21
readme.txt
CHANGED
@@ -4,7 +4,7 @@ Donate link: http://www.ninxit.com/blog/
|
|
4 |
Tags: links, social, bookmarks, bookmarking, Hatena, Livedoor Clip, BuzzURL, @nifty clip, Twitter, Tumblr, FC2 Bookmark, newsing, Choix, Yahoo!JAPAN Bookmark, Google Bookmark, Delicious, Digg, FriendFeed, Google Buzz, Facebook
|
5 |
Requires at least: 2.9.0
|
6 |
Tested up to: 2.9.2
|
7 |
-
Stable tag: 1.0
|
8 |
|
9 |
This plugin inserts social share links at the top or bottom of each post.
|
10 |
|
@@ -41,12 +41,23 @@ This is the list of used social sites:
|
|
41 |
|
42 |
1. This is how the plugin looks in your blog.
|
43 |
2. This is how the plugin looks in settings.
|
|
|
44 |
|
45 |
== Changelog ==
|
46 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
47 |
= 1.0.1 =
|
48 |
|
49 |
-
*
|
50 |
|
51 |
= 1.0.0 =
|
52 |
|
4 |
Tags: links, social, bookmarks, bookmarking, Hatena, Livedoor Clip, BuzzURL, @nifty clip, Twitter, Tumblr, FC2 Bookmark, newsing, Choix, Yahoo!JAPAN Bookmark, Google Bookmark, Delicious, Digg, FriendFeed, Google Buzz, Facebook
|
5 |
Requires at least: 2.9.0
|
6 |
Tested up to: 2.9.2
|
7 |
+
Stable tag: 1.2.0
|
8 |
|
9 |
This plugin inserts social share links at the top or bottom of each post.
|
10 |
|
41 |
|
42 |
1. This is how the plugin looks in your blog.
|
43 |
2. This is how the plugin looks in settings.
|
44 |
+
3. This is how the plugin looks in manually inside your template.
|
45 |
|
46 |
== Changelog ==
|
47 |
|
48 |
+
= 1.2.0 =
|
49 |
+
|
50 |
+
* Added "Is Page" option.
|
51 |
+
* The name of the option was changed from "Single Page" to "Is Singular".
|
52 |
+
|
53 |
+
= 1.1.0 =
|
54 |
+
|
55 |
+
* Bug fix: li style.
|
56 |
+
* Added wp_social_bookmarking_light_output_e function. It can position the social-links manually inside your template.
|
57 |
+
|
58 |
= 1.0.1 =
|
59 |
|
60 |
+
* Bug fix: img style.
|
61 |
|
62 |
= 1.0.0 =
|
63 |
|
screenshot-2.png
CHANGED
Binary file
|
screenshot-3.png
ADDED
Binary file
|
wp-social-bookmarking-light.php
CHANGED
@@ -1,11 +1,11 @@
|
|
1 |
<?php
|
2 |
/*
|
3 |
Plugin Name: WP Social Bookmarking Light
|
4 |
-
Plugin URI: http://www.ninxit.com/blog/
|
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.0
|
9 |
*/
|
10 |
/*
|
11 |
Copyright 2010 utahta (email : labs.ninxit@gmail.com)
|
@@ -310,7 +310,8 @@ function wp_social_bookmarking_light_default_options()
|
|
310 |
{
|
311 |
return array( "services" => "hatena, hatena_users, facebook, google_buzz, yahoo, livedoor, friendfeed, tweetmeme",
|
312 |
"position" => "top",
|
313 |
-
"single_page" => true
|
|
|
314 |
}
|
315 |
|
316 |
function wp_social_bookmarking_light_options()
|
@@ -322,10 +323,11 @@ function wp_social_bookmarking_light_wp_head()
|
|
322 |
{
|
323 |
?>
|
324 |
<style>
|
325 |
-
ul.wp_social_bookmarking_light{list-style:none;border:0;padding:0;margin:0;}
|
326 |
-
ul.wp_social_bookmarking_light li{float:left;border:0;padding:0 4px 0 0;margin:0;height:17px;}
|
327 |
-
ul.wp_social_bookmarking_light
|
328 |
-
|
|
|
329 |
</style>
|
330 |
<?php
|
331 |
}
|
@@ -341,6 +343,26 @@ function wp_social_bookmarking_light_admin_menu()
|
|
341 |
}
|
342 |
}
|
343 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
344 |
function wp_social_bookmarking_light_the_content( $content )
|
345 |
{
|
346 |
if( is_feed() || is_404() || is_robots() || is_comments_popup() || (function_exists( 'is_ktai' ) && is_ktai()) ){
|
@@ -351,23 +373,19 @@ function wp_social_bookmarking_light_the_content( $content )
|
|
351 |
if( $options['single_page'] && !is_singular() ){
|
352 |
return $content;
|
353 |
}
|
354 |
-
|
355 |
-
|
356 |
-
|
357 |
-
$out = '';
|
358 |
-
foreach( explode(",", $options['services']) as $service ){
|
359 |
-
$service = trim($service);
|
360 |
-
$out .= call_user_func( array( $wp, $service ) ); // call WpSocialBookmarkingLight method
|
361 |
}
|
362 |
-
|
|
|
363 |
if( $out == '' ){
|
364 |
return $content;
|
365 |
}
|
366 |
if( $options['position'] == 'top' ){
|
367 |
-
return "
|
368 |
}
|
369 |
else if( $options['position'] == 'bottom' ){
|
370 |
-
return "{$content}
|
371 |
}
|
372 |
return $content;
|
373 |
}
|
@@ -386,7 +404,8 @@ function wp_social_bookmarking_light_options_page()
|
|
386 |
if( isset( $_POST['save'] ) ){
|
387 |
$options = array( "services" => $_POST["services"],
|
388 |
"position" => $_POST["position"],
|
389 |
-
"single_page" => $_POST["single_page"] == 'true'
|
|
|
390 |
update_option( 'wp_social_bookmarking_light_options', $options );
|
391 |
echo '<div class="updated"><p><strong>'.__( 'Options saved.', WP_SOCIAL_BOOKMARKING_LIGHT_DOMAIN ).'</strong></p></div>';
|
392 |
}
|
@@ -436,11 +455,20 @@ function wp_social_bookmarking_light_options_page()
|
|
436 |
</td>
|
437 |
</tr>
|
438 |
<tr>
|
439 |
-
<th scope="row">
|
440 |
<td>
|
441 |
<select name='single_page'>
|
442 |
-
<option value='true' <?php if( $options['single_page'] == true ) echo 'selected'; ?>>
|
443 |
-
<option value='false' <?php if( $options['single_page'] == false ) echo 'selected'; ?>>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
444 |
</select>
|
445 |
</td>
|
446 |
</tr>
|
1 |
<?php
|
2 |
/*
|
3 |
Plugin Name: WP Social Bookmarking Light
|
4 |
+
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.2.0
|
9 |
*/
|
10 |
/*
|
11 |
Copyright 2010 utahta (email : labs.ninxit@gmail.com)
|
310 |
{
|
311 |
return array( "services" => "hatena, hatena_users, facebook, google_buzz, yahoo, livedoor, friendfeed, tweetmeme",
|
312 |
"position" => "top",
|
313 |
+
"single_page" => true,
|
314 |
+
"is_page" => true );
|
315 |
}
|
316 |
|
317 |
function wp_social_bookmarking_light_options()
|
323 |
{
|
324 |
?>
|
325 |
<style>
|
326 |
+
ul.wp_social_bookmarking_light{list-style:none !important;border:0 !important;padding:0;margin:0;}
|
327 |
+
ul.wp_social_bookmarking_light li{float:left !important;border:0 !important;padding:0 4px 0 0 !important;margin:0 !important;height:17px !important;text-indent:0 !important;}
|
328 |
+
ul.wp_social_bookmarking_light li:before{content:"" !important;}
|
329 |
+
ul.wp_social_bookmarking_light img{border:0 !important;padding:0;margin:0;}
|
330 |
+
wp_social_bookmarking_light_clear{clear:both !important;}
|
331 |
</style>
|
332 |
<?php
|
333 |
}
|
343 |
}
|
344 |
}
|
345 |
|
346 |
+
function wp_social_bookmarking_light_output( $services )
|
347 |
+
{
|
348 |
+
$wp = new WpSocialBookmarkingLight( get_permalink(), get_the_title(), get_bloginfo('name') );
|
349 |
+
|
350 |
+
$out = '';
|
351 |
+
foreach( explode(",", $services) as $service ){
|
352 |
+
$service = trim($service);
|
353 |
+
$out .= call_user_func( array( $wp, $service ) ); // call WpSocialBookmarkingLight method
|
354 |
+
}
|
355 |
+
if( $out == '' ){
|
356 |
+
return $out;
|
357 |
+
}
|
358 |
+
return "<ul class='wp_social_bookmarking_light'>{$out}</ul><br class='wp_social_bookmarking_light_clear' />";
|
359 |
+
}
|
360 |
+
|
361 |
+
function wp_social_bookmarking_light_output_e( $services )
|
362 |
+
{
|
363 |
+
echo wp_social_bookmarking_light_output( $services );
|
364 |
+
}
|
365 |
+
|
366 |
function wp_social_bookmarking_light_the_content( $content )
|
367 |
{
|
368 |
if( is_feed() || is_404() || is_robots() || is_comments_popup() || (function_exists( 'is_ktai' ) && is_ktai()) ){
|
373 |
if( $options['single_page'] && !is_singular() ){
|
374 |
return $content;
|
375 |
}
|
376 |
+
if( !$options['is_page'] && is_page() ){
|
377 |
+
return $content;
|
|
|
|
|
|
|
|
|
|
|
378 |
}
|
379 |
+
|
380 |
+
$out = wp_social_bookmarking_light_output( $options['services'] );
|
381 |
if( $out == '' ){
|
382 |
return $content;
|
383 |
}
|
384 |
if( $options['position'] == 'top' ){
|
385 |
+
return "{$out}{$content}";
|
386 |
}
|
387 |
else if( $options['position'] == 'bottom' ){
|
388 |
+
return "{$content}{$out}";
|
389 |
}
|
390 |
return $content;
|
391 |
}
|
404 |
if( isset( $_POST['save'] ) ){
|
405 |
$options = array( "services" => $_POST["services"],
|
406 |
"position" => $_POST["position"],
|
407 |
+
"single_page" => $_POST["single_page"] == 'true',
|
408 |
+
"is_page" => $_POST["is_page"] == 'true' );
|
409 |
update_option( 'wp_social_bookmarking_light_options', $options );
|
410 |
echo '<div class="updated"><p><strong>'.__( 'Options saved.', WP_SOCIAL_BOOKMARKING_LIGHT_DOMAIN ).'</strong></p></div>';
|
411 |
}
|
455 |
</td>
|
456 |
</tr>
|
457 |
<tr>
|
458 |
+
<th scope="row">Is Singular:</th>
|
459 |
<td>
|
460 |
<select name='single_page'>
|
461 |
+
<option value='true' <?php if( $options['single_page'] == true ) echo 'selected'; ?>>Enabled</option>
|
462 |
+
<option value='false' <?php if( $options['single_page'] == false ) echo 'selected'; ?>>Disabled</option>
|
463 |
+
</select>
|
464 |
+
</td>
|
465 |
+
</tr>
|
466 |
+
<tr>
|
467 |
+
<th scope="row">Is Page:</th>
|
468 |
+
<td>
|
469 |
+
<select name='is_page'>
|
470 |
+
<option value='true' <?php if( $options['is_page'] == true ) echo 'selected'; ?>>Enabled</option>
|
471 |
+
<option value='false' <?php if( $options['is_page'] == false ) echo 'selected'; ?>>Disabled</option>
|
472 |
</select>
|
473 |
</td>
|
474 |
</tr>
|