Title: bShare 分享
Author: denishua
Published: <strong>31 มีนาคม 2008</strong>
Last modified: 31 มีนาคม 2011

---

Search plugins

This plugin **hasn’t been tested with the latest 3 major releases of WordPress**.
It may no longer be maintained or supported and may have compatibility issues when
used with more recent versions of WordPress.

![](https://s.w.org/plugins/geopattern-icon/17fav-bookmark-share.svg)

# bShare 分享

 By [denishua](https://profiles.wordpress.org/denishua/)

[Download](https://downloads.wordpress.org/plugin/17fav-bookmark-share.zip)

 * [Details](https://th.wordpress.org/plugins/17fav-bookmark-share/#description)
 * [Reviews](https://th.wordpress.org/plugins/17fav-bookmark-share/#reviews)
 *  [Installation](https://th.wordpress.org/plugins/17fav-bookmark-share/#installation)
 * [Development](https://th.wordpress.org/plugins/17fav-bookmark-share/#developers)

 [Support](https://wordpress.org/support/plugin/17fav-bookmark-share/)

## Description

数以万计的分享，源自一个简单的按钮， [bShare 分享](http://www.bshare.cn/) 是一个
强大的网页分享插件工具，您的读者可以将您网站上精采的内容快速分享、转贴到社群网络
上。

## Installation

 1. 上传bshare文件夹（包括一个.php文件及一个.txt文件）到’/wp-content/plugins/’目录下，
    然后在WordPress后台插件菜单下激活。
 2. 该插件自动在在日志和静态页面正文后添加 bShare 按钮，如果你想在其他页面添加按钮，
    你可以使用Widget来添加。
 3. 如果你想要对bShare按钮和插件进行自定义或者查看数据，请到http://www.bshare.cn/wordpressRegister
    注册并获取你的嵌入JavaScript代码，然后在Wordpress后台的setting->bShare分享中将你的
    代码填入文本框中并提交。

## Reviews

![](https://secure.gravatar.com/avatar/4c658c7b8cf6c3c9a537cb71a28b4a3ae9539933ee2950ca8d187cada2849572?
s=60&d=retro&r=g)

### 󠀁[Fail to save the change of "在Feed中加入bShare" and "在非博客页面加入bSha](https://wordpress.org/support/topic/the-change-to-%e5%9c%a8feed%e4%b8%ad%e5%8a%a0%e5%85%a5bshare-or-%e5%9c%a8%e9%9d%9e%e5%8d%9a%e5%ae%a2%e9%a1%b5%e9%9d%a2%e5%8a%a0%e5%85%a5bshare-option-can-not-be-saved/)󠁿

 [hailong](https://profiles.wordpress.org/hailong/) 3 กันยายน 2016

A bug that the change to “在Feed中加入bShare” or “在非博客页面加入bShare” option
can not be saved. I was directed to this plugin from the bShare website, it works
well on the blog post view page. While I noticed there is bug as described above,
if you are also struggling with this issue, please refer to my fix here: /17fav-
bookmark-share/bookmark-share.php <?php /* Plugin Name: bShare 分享 Plugin URI: 
http://www.bshare.cn/wordpressRegister Description: 数以万计的分享，源自一个简单
的按钮， <a href="http://www.bshare.cn/">bShare 分享</a> 是一个强大的网页分享插件
工具，您的读者可以将您网站上精采的内容快速分享、转贴到社群网络上。<a href="options-
general.php?page=bookmark-share.php">点击这里进行配置</a>。 Version: 4.2.0 Author:
Buzzinate, Denis Author URI: http://www.bshare.cn */ load_plugin_textdomain('bshare');
if (get_option("bshare_code") == "") { update_option("bshare_code", '<a class="bshareDiv"
target="_blank" href="http://www.bshare.cn/share">分享&收藏</a><script language="
javascript" type="text/javascript" src="http://www.bshare.cn/button.js"></script
>'); } if (get_option("bshare_pos") == "") { update_option("bshare_pos", "down");}
add_filter('the_content', 'bshare'); function bshare($content){ if(is_single() |
| (is_page() && get_option("bshare_inPage") != "false")) { if (get_option("bshare_pos")
== "up") { $content = '<div style="margin-bottom:10px">'.htmlspecialchars_decode(
get_option("bshare_code")).'</div>'.$content; } else { $content = $content.'<div
style="margin-bottom:10px">'.htmlspecialchars_decode(get_option("bshare_code")).'
</div>'; } } else if(is_feed() && get_option("bshare_inFeed") != "false") { global
$post; $bshare_feed_code = '<p><a href="http://www.bshare.cn/share?url='.urlencode(
get_permalink($post->ID)).'&title='.urlencode($post->post_title).'" title="用bShare
分享或收藏本文"><img src="http://static.bshare.cn/frame/images/button_custom1-zh.
gif" alt="用bShare分享或收藏本文" /></a></p>'; $content = $content.$bshare_feed_code;}
return $content; } add_action('plugins_loaded', 'widget_sidebar_bshare'); function
widget_sidebar_bshare() { function widget_bshare($args) { if(is_single()||is_page())
return; extract($args); echo $before_widget; echo $before_title . __('bShare分享','
bshare') . $after_title; echo '<div style="margin:10px 0">'; echo htmlspecialchars_decode(
get_option("bshare_code")) . '</div>'; echo $after_widget; } register_sidebar_widget(
__('bShare分享', 'bshare'), 'widget_bshare'); } add_action('admin_menu', 'bshare_menu');
function bshare_menu() { add_options_page(__('bShare选项', 'bshare'), __('bShare
分享', 'bshare'), 8, basename(__FILE__), 'bshare_options'); } function bshare_options(){
if (getIsPostRequest()) { if (isset($_POST['bshare_code'])) { $code = stripslashes_deep(
$_POST['bshare_code']); update_option("bshare_code", htmlspecialchars($code)); }
if ($_POST['bshare_infeed'] != "true") { update_option("bshare_infeed", "false");}
else { update_option("bshare_infeed", "true"); } if ($_POST['bshare_inpage'] != "
true") { update_option("bshare_inpage", "false"); } else { update_option("bshare_inpage","
true"); } if (isset($_POST['bshare_pos'])) { update_option("bshare_pos", $_POST['
bshare_pos']); } } echo '<div class="wrap">'; echo '<form name="bshare_form" method
="post" action="">'; echo '<p>请将您在bshare.cn获取的嵌入代码复制至此处：</p>'; 
echo '<p><textarea style="height:100px;width:600px" name="bshare_code">'.get_option("
bshare_code").'</textarea></p>'; echo '<p><input type="checkbox" name="bshare_infeed"
value="true" ' . getChecked(get_option("bshare_infeed")) . '></input>&nbsp在Feed
中加入bShare</p>'; echo '<p><input type="checkbox" name="bshare_inpage" value="true"'.
getChecked(get_option("bshare_inpage")) . '></input>&nbsp在非博客页面加入bShare</
p>'; echo '<p>bShare按钮显示位置（对非浮动式按钮有效）：<br/><input type="radio"
name="bshare_pos" value="up" ' . getRadioChecked(get_option("bshare_pos"), 'up').'
>&nbsp文章上方<br/><input type="radio" name="bshare_pos" value="down" ' . getRadioChecked(
get_option("bshare_pos"), 'down') . '>&nbsp文章下方</p>'; echo '<p class="submit"
><input type="submit" value="submit"/></p>'; echo '</form>'; echo '</div>'; } function
getChecked($val) { if ($val == "false") { return ''; } else { return 'checked="checked"';}}
function getRadioChecked($val, $cur) { if ($val == $cur) { return 'checked="checked"';}
else { return ''; } } /** * Returns whether this is a POST request. * @return boolean
whether this is a POST request. */ function getIsPostRequest() { return isset($_SERVER['
REQUEST_METHOD']) && !strcasecmp($_SERVER['REQUEST_METHOD'],'POST'); } ?>

 [ Read all 1 review ](https://wordpress.org/support/plugin/17fav-bookmark-share/reviews/)

## Contributors & Developers

“bShare 分享” is open source software. The following people have contributed to 
this plugin.

Contributors

 *   [ denishua ](https://profiles.wordpress.org/denishua/)
 *   [ buzzinate ](https://profiles.wordpress.org/buzzinate/)

[Translate “bShare 分享” into your language.](https://translate.wordpress.org/projects/wp-plugins/17fav-bookmark-share)

### Interested in development?

[Browse the code](https://plugins.trac.wordpress.org/browser/17fav-bookmark-share/),
check out the [SVN repository](https://plugins.svn.wordpress.org/17fav-bookmark-share/),
or subscribe to the [development log](https://plugins.trac.wordpress.org/log/17fav-bookmark-share/)
by [RSS](https://plugins.trac.wordpress.org/log/17fav-bookmark-share/?limit=100&mode=stop_on_copy&format=rss).

## Meta

 *  Version **4.2.0**
 *  Last updated **15 ปี ago**
 *  Active installations **10+**
 *  WordPress version ** 2.5 or higher **
 *  Tested up to **3.1.0**
 *  Language
 * [English (US)](https://wordpress.org/plugins/17fav-bookmark-share/)
 * Tags
 * [Bookmark](https://th.wordpress.org/plugins/tags/bookmark/)[share](https://th.wordpress.org/plugins/tags/share/)
   [分享](https://th.wordpress.org/plugins/tags/%e5%88%86%e4%ba%ab/)[收藏](https://th.wordpress.org/plugins/tags/%e6%94%b6%e8%97%8f/)
   [书签](https://th.wordpress.org/plugins/tags/%e4%b9%a6%e7%ad%be/)
 *  [Advanced View](https://th.wordpress.org/plugins/17fav-bookmark-share/advanced/)

## Ratings

 4 out of 5 stars.

 *  [  0 5-star reviews     ](https://wordpress.org/support/plugin/17fav-bookmark-share/reviews/?filter=5)
 *  [  1 4-star review     ](https://wordpress.org/support/plugin/17fav-bookmark-share/reviews/?filter=4)
 *  [  0 3-star reviews     ](https://wordpress.org/support/plugin/17fav-bookmark-share/reviews/?filter=3)
 *  [  0 2-star reviews     ](https://wordpress.org/support/plugin/17fav-bookmark-share/reviews/?filter=2)
 *  [  0 1-star reviews     ](https://wordpress.org/support/plugin/17fav-bookmark-share/reviews/?filter=1)

[Your review](https://wordpress.org/support/plugin/17fav-bookmark-share/reviews/#new-post)

[See all reviews](https://wordpress.org/support/plugin/17fav-bookmark-share/reviews/)

## Contributors

 *   [ denishua ](https://profiles.wordpress.org/denishua/)
 *   [ buzzinate ](https://profiles.wordpress.org/buzzinate/)

## Support

Got something to say? Need help?

 [View support forum](https://wordpress.org/support/plugin/17fav-bookmark-share/)