页面正在假装异步加载中...
首页 > 分享网事 > 简单的分享与收藏

简单的分享与收藏

大家的博客里,都喜欢加上多个网站的分享按钮,一般都是会去选择 jiathisbShare 等第三方服务。一是因为美观,二是因为很方便,一段js代码就可以搞定,但是我不怎么喜欢这第三方服务。加载外部js速度快还好,速度慢很影响速度,而且还不知道什么时候可能会挂掉,所以这类分享收藏的功能,还是自己用代码弄进去吧。

其实自己弄代码进去很简单的,将下面这段代码加到你想要显示的地方,一般是在日志正文下方显示,所以可以选择加入到 single.php 文件中。

点击隐藏PHP CODE
<div class="share">
  <a class="digu" rel="nofollow" target="_blank" href="http://wetone.org/welink/share/?u=<?php the_permalink(); ?>&t=< ?php the_title(); ?>">嘀咕</a>
  <a class="sina" rel="nofollow" target="_blank" href="http://v.t.sina.com.cn/share/share.php?title=<?php the_title(); ?>&url=< ?php the_permalink(); ?>">新浪</a>
</div>

好了,就这么简单,一个具有两个分享收藏按钮的功能就做好了,如果你还需要更多的分享收藏按钮,可以自己去网上找找,下面我给出几个自己找到的。

嘀咕

点击隐藏PHP CODE
<a class="digu" rel="nofollow" target="_blank" href="http://wetone.org/welink/share/?u=<?php the_permalink(); ?>&t=< ?php the_title(); ?>">嘀咕</a>

新浪微博

点击隐藏PHP CODE
<a class="sina" rel="nofollow" target="_blank" href="http://v.t.sina.com.cn/share/share.php?title=<?php the_title(); ?>&url=< ?php the_permalink(); ?>">新浪</a>

人人网(原校内网)

点击隐藏PHP CODE
<a class="renren" rel="nofollow" target="_blank" href="http://share.renren.com/share/buttonshare.do?link=<?php the_permalink(); ?>&title=< ?php the_title(); ?>">人人</a>

豆瓣

点击隐藏PHP CODE
<a class="douban" rel="nofollow" target="_blank" href="http://www.douban.com/recommend/?url=<?php the_permalink(); ?>&title=< ?php the_title(); ?>">豆瓣</a>

Twitter

点击隐藏PHP CODE
<a class="twitter" rel="nofollow" target="_blank" href="http://twitter.com/home/?status=<?php the_title(); ?>:< ?php the_permalink(); ?>">Twitter</a>

Google Reader

点击隐藏PHP CODE
<a class="googlereader" rel="nofollow" target="_blank" href="http://www.google.com/reader/link?url=<?php the_permalink(); ?>&title=< ?php the_title(); ?>">Google Reader</a>

QQ空间 – 这个有点问题,有时候进入分享页后,需要刷新一下才能够读取到分享的标题

点击隐藏PHP CODE
<a class="qzone" rel="nofollow" target="_blank" href="http://sns.qzone.qq.com/cgi-bin/qzshare/cgi_qzshare_onekey?url=<?php the_permalink(); ?>">QQ空间</a>

QQ书签

点击隐藏PHP CODE
<a class="qzone" rel="nofollow" target="_blank" href="http://shuqian.qq.com/post?from=3&title=<?php the_title(); ?>&uri=< ?php the_permalink() ?>">QQ书签</a>

九点

点击隐藏PHP CODE
<a class="qzone" rel="nofollow" target="_blank" href="http://9.douban.com/recommend/?url=<?php the_permalink() ?>&title=< ?php the_title(); ?>&v=2&n=1">九点</a>

百度搜藏

点击隐藏PHP CODE
<a class="qzone" rel="nofollow" target="_blank" href="http://cang.baidu.com/do/add?it=<?php the_title(); ?>&iu=< ?php the_permalink() ?>">百度搜藏</a>
分类: 分享网事 收藏分享 标签: , , ,
  1. 2010-07-04 16:11 | #1

    越来越多的人喜欢上非插件的方法了,哈哈,不错不错

  2. 2010-07-04 17:44 | #2

    嗯 简单使用纯代码

  3. 2010-07-04 20:40 | #3

    暂时先用了第三方,等哪天手痒再折腾。~

  4. 2010-07-05 00:06 | #4

    还是图片的Button比较显眼。我以为你下边那些文字是Tag呢。。。。

  5. 2010-07-05 00:48 | #5

    @万戈
    是啊,越来越喜欢非插件的修改方法了。

    @丕子
    纯代码方式很好啊,编译速度又快。

    @寨主
    呵呵,速度加入折腾一族吧。

    @forece
    可以给他们加样式嘛,我每个 A 标签都留了 class 属性的,就是为了方便以后加样式进去。

  6. 2010-07-17 08:55 | #6

    我现在坚决不让别人用 RSS/FEED 方式订阅了,我写了文章的,你去看看吧。

  7. hjzgc
    2010-07-20 22:54 | #7

    请问文章结尾 相关日志那一排tab用的什么插件?

  8. 2010-07-20 23:35 | #8

    @hjzgc
    没有用插件,手动修改的。

  1. 本文目前尚无任何 trackbacks 和 pingbacks.
icon_wink.gif icon_neutral.gif icon_mad.gif icon_twisted.gif icon_smile.gif icon_eek.gif icon_sad.gif icon_rolleyes.gif icon_razz.gif icon_redface.gif icon_surprised.gif icon_mrgreen.gif icon_lol.gif icon_idea.gif icon_biggrin.gif icon_evil.gif icon_cry.gif icon_cool.gif icon_arrow.gif icon_confused.gif icon_question.gif icon_exclaim.gif