返回列表 回复 发帖

[插件发布] 为PJBlog增加网摘收藏图标

适合动态模式 半静态没试过 静态不适用

给博客增加网摘(社会书签,Social Bookmark)图标,让用户在发现好文时能够即时点击收藏推荐,能改善用户体验,为博客带来一定的流量,同时也能反映哪些文章对访问者有价值。很多优秀的博客都很注重网摘的作用。今天我也给我的PJBlog3增加了网摘按钮,就在首页摘录和内页每一篇日志下方。(效果如图)


  给PJBlog增加网摘的方法很简单。
  
  首先感谢ZFreet。我直接使用了其博客提供的Bo-Blog网摘插件的图标和现成代码。请大家先去http://www.zfreet.com/blog/post/Bo-Blog_Plugin_Add_to_BookMarks_v2.0.php下载这个ZFreet提供的网摘插件。解压。并将解压出来的 addtobookmarks/ 文件夹整个传到PJBlog目录的 Plugins/ 目录下。(由于我们只要用这里面的网摘图标,所以那两个PHP文件传不传无所谓。您完全可以无视之。)

  然后找到PJBlog目录的 class/ 目录。

  要为首页摘要下方增加网摘按钮,请修改 class/cls_default.asp。

  找到如下代码:

分类:<a href="default.asp?cateID=<%=webLogArr(1,PageCount)%>"title="<%=getCate.cate_Intro%>"><%=getCate.cate_Name%></a>| <a href="?id=<%=webLogArr(0,PageCount)%>">固定链接</a> |

  在前面增加如下代码:

<!-- 添加网摘开始 -->
<br/>
<strong>收藏本文到网摘:</strong>
<a href="javascript:u=location.href;t=document.title;void(open('http://www.google.com/bookmarks/mark?op=add&bkmk='+encodeURIComponent(location.href)+'&title='+encodeURIComponent(document.title),'','toolbar=no,width=900,height=500,left=50,top=50,status=no,resizable=yes'));"><imgsrc="plugins/addtobookmarks/images/google.gif" alt="添加到“Google书签”"border="0"></a>
<ahref="javascript:mywebyx=document;mywebya=encodeURIComponent(mywebyx.location.href);mywebyt=encodeURIComponent(mywebyx.title);mywebyd=encodeURIComponent(document.selection.createRange().text);open('http://myweb.cn.yahoo.com/popadd.html?src=iebookmark&url='+mywebya+'&title='+mywebyt+'&summary='+mywebyd,'Yahoo','width=780,height=455,left=50,top=50,toolbar=no,menubar=no,location=no,scrollbars=yes,status=yes,resizable=yes');void(0);"><imgsrc="plugins/addtobookmarks/images/yahoo.gif" alt="添加到“Yahoo收藏”"border="0"></a>
<a href="javascript:window.open('http://shuqian.qq.com/post?from=3&title='+encodeURIComponent(document.title)+'&uri='+encodeURIComponent(document.location.href)+'&jumpback=2&noui=1','favit','width=930,height=470,left=50,top=50,toolbar=no,menubar=no,location=no,scrollbars=yes,status=yes,resizable=yes');void(0)"><img src="plugins/addtobookmarks/images/qq.gif" alt="添加到“QQ书签”"border="0"></a>
<ahref="javascript:u=location.href;t=document.title;c=%22%22+(window.getSelection?window.getSelection():document.getSelection?document.getSelection():document.selection.createRange().text);c=c.substr(0,480);varurl=%22http://cang.baidu.com/do/add?it=%22+encodeURIComponent(t)+%22&iu=%22+encodeURIComponent(u)+%22&dc=%22+encodeURIComponent(c)+%22&fr=js#nw=1%22;window.open(url,'_blank','scrollbars=no,width=600,height=450,left=50,top=50,status=no,resizable=yes');void0"><img src="plugins/addtobookmarks/images/baidu.gif"alt="添加到“百度搜藏”" border="0"></a>
<ahref="javascript:d=document;t=d.selection?(d.selection.type!='None'?d.selection.createRange().text:'')d.getSelection?d.getSelection():'');void(vivi=window.open('http://vivi.sina.com.cn/collect/icollect.php?pid=28&title='+escape(d.title)+'&url='+escape(d.location.href)+'&desc='+escape(t),'vivi','scrollbars=no,width=480,height=480,left=50,top=50,status=no,resizable=yes'));vivi.focus();"><imgsrc="plugins/addtobookmarks/images/vivi.gif" alt="添加到“新浪ViVi收藏夹”"border="0"></a>
<a href="javascript:u=location.href;t=document.title;void(open('http://del.icio.us/post?&url='+encodeURIComponent(location.href)+'&title='+encodeURIComponent(document.title),'','toolbar=no,width=900,height=500,left=50,top=50,status=no,resizable=yes'));"><imgsrc="plugins/addtobookmarks/images/delicious.gif"alt="添加到“Del.icio.us”" border="0"></a>
<ahref="javascript:d=document;t=d.selection?(d.selection.type!='None'?d.selection.createRange().text:'')d.getSelection?d.getSelection():'');void(keyit=window.open('http://www.365key.com/storeit.aspx?t='+escape(d.title)+'&u='+escape(d.location.href)+'&c='+escape(t),'keyit','scrollbars=no,width=475,height=600,left=50,top=50,status=no,resizable=yes'));keyit.focus();"><imgsrc="plugins/addtobookmarks/images/365key.gif" alt="添加到“365天天网摘”"border="0"></a>
<ahref="javascript:d=document;t=d.selection?(d.selection.type!='None'?d.selection.createRange().text:'')d.getSelection?d.getSelection():'');void(yesky=window.open('http://hot.yesky.com/dp.aspx?t='+escape(d.title)+'&u='+escape(d.location.href)+'&c='+escape(t)+'&st=2','yesky','scrollbars=no,width=400,height=480,left=50,top=20,status=no,resizable=yes'));yesky.focus();"><imgsrc="plugins/addtobookmarks/images/yesky.gif" alt="添加到“天极网摘”"border="0"></a>
<ahref="javascript:d=document;t=d.selection?(d.selection.type!='None'?d.selection.createRange().text:''):(d.getSelection?d.getSelection():'');void(keyit=window.open('http://my.poco.cn/fav/storeIt.php?t='+escape(d.title)+'&u='+escape(d.location.href)+'&c='+escape(t)+'&img=http://www.h-strong.com/blog/logo.gif','keyit','scrollbars=no,width=475,height=575,left=50,top=50status=no,resizable=yes'));keyit.focus();"><imgsrc="plugins/addtobookmarks/images/poco.gif" alt="添加到“POCO网摘”"border="0"></a>
<ahref="javascript:t=document.title;u=location.href;e=document.selection?(document.selection.type!='None'?document.selection.createRange().text:''):(document.getSelection?document.getSelection():'');void(open('http://bookmark.hexun.com/post.aspx?title='+escape(t)+'&url='+escape(u)+'&excerpt='+escape(e),'HexunBookmark','scrollbars=no,width=600,height=450,left=50,top=50,status=no,resizable=yes'));"><imgsrc="plugins/addtobookmarks/images/hexun.gif" alt="添加到“和讯网摘”"border="0"></a>
<ahref="javascript:d=document;t=d.selection?(d.selection.type!='None'?d.selection.createRange().text:''):(d.getSelection?d.getSelection():'');void(blog=window.open('http://www.bolaa.com/CommendBlog/SmallLogin.aspx?title='+escape(d.title)+'&newspath='+escape(d.location.href)+'&subtitle='+escape(t),'bolaa','width=400px,height=400px'));blog.focus();"><imgsrc="plugins/addtobookmarks/images/bolaa.gif" alt="添加到“Bolaa博客收录中心”"border="0"></a>
<a href="javascript:u=location.href;t=document.title;void(open('http://www.igooi.com/addnewitem.aspx?noui=yes&jump=close&url='+escape(u)+'&title='+escape(t)+'&sel='+escape(document.selection.createRange().text),'igooi','toolbar=no,width=400,height=480'));"><imgsrc="plugins/addtobookmarks/images/igooi.gif" alt="添加到“igooi网摘”"border="0"></a>
<ahref="javascript:d=document;t=d.selection?(d.selection.type!='None'?d.selection.createRange().text:''):(d.getSelection?d.getSelection():'');void(keyit=window.open('http://www.cn3.cn/user/addurl.asp?t='+escape(d.title)+'&u='+escape(d.location.href)+'&c='+escape(t),'keyit','scrollbars=no,width=490,height=450,left=50,top=50,status=no,resizable=yes'));keyit.focus();"><imgsrc="plugins/addtobookmarks/images/cn3.gif" alt="添加到“天下图摘”"border="0"></a>
<br><br><br>
<!-- 添加网摘结束 -->


  要为内页日志下方增加网摘图标,找到 class/cls_article.asp。

  找到如下代码:

<imgsrc="images/From.gif" style="margin:4px 2px -4px 0px"alt=""/><strong>文章来自:</strong> <ahref="<%=log_ViewArr(17,0)%>"target="_blank"><%=log_ViewArr(18,0)%></a><br/>

  将上述蓝色代码添加到前面即可。

  这样你的PJBlog就可以实现网摘分项功能了。最后如果您觉得这篇文章对您有帮助,欢迎在下面digg本文一下哈~

[ 本帖最后由 fbzerg 于 2009-1-4 15:11 编辑 ]
XDash's blog  首页链接已基本满。目前只收高质量地鸟,八好意思。其他朋友欢迎交换内页链接。
来自我的博客。呵呵。欢迎大家光临。
XDash's blog  首页链接已基本满。目前只收高质量地鸟,八好意思。其他朋友欢迎交换内页链接。
支持了~~上次去了你的BLOG..准备弄..后来忘记了~~
不错啊,试试看
不错,收藏
殇.jitler
我不支持的言论,但我坚决捍卫你发言的权利!
夜行者俱乐部

可以把那些网摘保存成js,然后再调用,非常有利于修改
欢迎交换链接!
不错啊,试试看
楼主注意区分一下,是动态的、静态的还是半动态模式。
欢迎与我链接!
不错,学习,已用上了
真诚交流,欢迎访问我的博客Sindi'Blog: http://www.labol.com.cn/blog


为什么完全按照你的操作不行呀 怎么弄都不显示
返回列表