本文使用「署名 4.0 国际 (CC BY 4.0)」许可协议,欢迎转载、或重新修改使用,但需要注明来源。 [署名 4.0 国际 (CC BY 4.0)](https://creativecommons.org/licenses/by/4.0/deed.zh) 本文作者: 苏洋 创建时间: 2009年05月26日 统计字数: 786字 阅读时间: 2分钟阅读 本文链接: https://soulteary.com/2009/05/26/wordpress-my-share-ex.html ----- # [Php]博客收藏以及转帖地址显示插件(5.27更新) **本文于5月27日更新** 感谢bolo wulinfo 的提醒,如果还有bug欢迎反馈。 最近太忙了,实在是不好意思,晚些时间我会一一回访每位来客的,感谢支持与理解。记得有朋友和我要文章底下的搜藏和地址显示插件。现在我把插件直接贴出来,大家将就的用吧~图片基本是我P过的,如果觉得不符合您的美学请自行替换。 还是之前的原则,授人鱼不如授人以渔。我先贴出如何修改,如果有人有疑问的话,我会贴出附件。:) 首先建立一个文本文件,然后把这个文件里加入以下代码。最后把我的css文件以及图片按钮保存起来就可以使用了。 欢迎反馈改进的建议以及意见。 ```php 本文地址[转载请说明,谢谢合作。]

'; //获取文章地址并转换为类似JS转码过的地址 $url = urlencode(get_permalink()); //进行书签处理"=?UTF-8 b?".base64_encode('邮件标题')."?="; $theHTMLCode.= __('
觉得本文不错?那么用下面的方式分享本文吧[推荐/书签]

'); if($mustEcho) { echo ($theHTMLCode); } else { return $theHTMLCode; } } } function theshareContentFilter($content = '') { if (!is_feed() && is_single()) { return $content . firendlessShareBox(false); } else { return $content; } } ?> ``` 接下来打开你所使用的主题的style.css添加以下内容 ```css /* 分享按钮 */ #ShareButton ul { background:#eee; border:1px solid #B7B7B7; width:580px; padding:1px; } #ShareButton li { background:transparent; list-style:none; float:left; margin:0; padding:0; display:block; } #ShareButton li a span { background:url(img/sharebutton.png) no-repeat; height:28px; width:24px; display:block; text-indent:-999em; /* padding-top:10px; */ } #ShareButton li#shareMail a span { background-position:-48px 0; } #ShareButton li#sharefacebook a span { background-position:-24px 0; } #ShareButton li#sharetwitter a span { background-position:-96px 0; } #ShareButton li#sharedigg a span { background-position:-72px 0; } #ShareButton li#sharedelicious a span { background-position:0 0; } #ShareButton li#sharebaidu a span { background-position:-144px 0; } #ShareButton li#shareGoogle a span { background-position:-168px 0; } #ShareButton li#sharefanfou a span { background-position:-120px 0; } #ShareButton li#shareQQ a span { background-position: -216px 0; } #ShareButton li#shareyahoo a span { background-position: -192px 0; } #ShareButton li#shareLive a span { background-position: -240px 0; } #ShareButton li#sharexianguo a span { background-position: -264px 0; } #ShareButton li#sharedouban a span { background-position: -336px 0; } #ShareButton li#sharemyspace a span { background-position: -312px 0; } #ShareButton li#sharereddit a span { background-position: -288px 0; } #ShareButton li a { display:block; padding:5px; text-decoration:none; width:24px; font-size:12px; background:#eee; } #ShareButton li a:hover { background:#fff; } p.postmet a {font-size:12px;font-family:verdana;margin:5px 0} #firlink a {border:none; color:#000;} #firlink a:hover {color:#000} textarea#firlink {width:430px;height:20px;padding:2px 0 0 2px; margin:5px} ``` 接下来把图片放到你主题下的img/sharebutton.png 就大功告成了。