为了方便有需要的朋友收藏小站有用的文章,做了一个收藏到 QQ书签 、 Google书签 、 百度搜藏 、 Yahoo收藏 、 乐收 的链接。其实网上也有很多第三方的js文件可以很方便的做到这一点,只需要加载一个js文件即可。因为DDBug不太喜欢加载第三方的东西,能不加载就不加载,所以本文讨论的是最原始的链接形式的。

下面给出几个常用的在线收藏夹的收藏链接,标题以domety为例,网址以http://domety.com/为例。在具体的使用过程中,只需要把这两个替换掉你自己文章的标题和网址即可。

QQ书签:http://shuqian.qq.com/post?title=domety&uri=http://domety.com/

google书签:http://www.google.com/bookmarks/mark?op=add&hl=zh_cn&title=domety&bkmk=http://domety.com/

百度搜藏:http://cang.baidu.com/do/add?it=domety&iu=http://domety.com/

yahoo收藏:http://myweb.cn.yahoo.com/popadd.html?title=domety&url=http://domety.com/

新浪ViVi:http://vivi.sina.com.cn/collect/icollect.php?title=domety&url=http://domety.com/

乐收:http://leshou.com/post?act=shou&title=domety&url=http://domety.com/

以下是本站的实现代码,以做参考

<?php $title = get_the_title();
$permalink = get_permalink();
$title = urlencode($title);
$permalink = esc_url($permalink);
// QQ书签
$output = '<a href="http://shuqian.qq.com/post?title='.$title.'&uri='.$permalink.'" title="收藏到QQ书签" target="_blank">QQ书签</a>';
// google书签
$output .= ' | <a href="http://www.google.com/bookmarks/mark?op=add&hl=zh_cn&title='.$title.'&bkmk='.$permalink.'" title="收藏到google书签" target="_blank">Google书签</a>';
// 百度搜藏
$output .= ' | <a href="http://cang.baidu.com/do/add?it='.$title.'&iu='.$permalink.'" title="收藏到百度搜藏" target="_blank">百度搜藏</a>';
// yahoo收藏
$output .= ' | <a href="http://myweb.cn.yahoo.com/popadd.html?title='.$title.'&url='.$permalink.'" title="收藏到Yahoo收藏" target="_blank">Yahoo收藏</a>';
// 新浪ViVi
//$output .= ' | <a href="http://vivi.sina.com.cn/collect/icollect.php?title='.$title.'&url='.$permalink.'" title="收藏到新浪ViVi" target="_blank">新浪ViVi</a>';
// 乐收
$output .= ' | <a href="http://leshou.com/post?act=shou&title='.$title.'&url='.$permalink.'" title="收藏到乐收" target="_blank">乐收</a>';
echo $output; ?>