手机站
网通分站
电信主站
密 码:
用户名:
当前位置 : 主页>网站运营>建站经验>列表

在zblog中添加流行网摘的js代码

来源:互联网 作者:west263.com 时间:2008-02-21
西部数码-全国虚拟主机10强!40余项虚拟主机管理功能,全国领先!双线多线虚拟主机南北访问畅通无阻!免费赠送企业邮局,.CN域名,自助建站480元起,免费试用7天,满意再付款! P4主机租用799元/月.月付免压金!
想要在自己blog的文章页面加几个[加入网摘]的代码,
本来在zblog官方BBS上是有的,可惜代码无法下载了(URL见此:http://bbs.rainbowsoft.org/viewthread.php?tid=1140&extra=page=1,那个几乎收录了国内的所有网摘),只能自己重新找。找了好久,没有找到合适的,自己需要的(365key,delicious,google,百度搜藏),没有办法,把找到的内容加工了下,结合成下面这段:

1.将下面这段代码保存为wangzhai.js,上传到blog根目录下。

document.write(" [ <a href='javascript:StorePage();'><font color=#fc0000>365Key</font></a> ]");
document.write(" [ <a href='javascript:StorePage2();'><font color=#fc0000>del.icio.us</font></a> ]");
document.write(" [ <a href='javascript:StorePage3();'><font color=#fc0000>Google</font></a> ]");
function StorePage(){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=575,left=75,top=20,status=no,resizable=yes'));keyit.focus();}
function StorePage2(){window.open('http://del.icio.us/post?v=4&noui&jump=close&url=' encodeURIComponent(location.href) '&title=' encodeURIComponent(document.title), 'delicious','toolbar=no,width=700,height=400');}
function StorePage3(){window.open('http://www.google.com/bookmarks/mark?op=add&bkmk=' encodeURIComponent(location.href) '&title=' encodeURIComponent(document.title), 'google','toolbar=yes,width=800,height=600');}
//以上是365,delicious,google的,以下是百度搜藏的。
document.write(' [ <a href="javascript:u=location.href;t=document.title;c="" (window.getSelection?window.getSelection():document.getSelection?document.getSelection():document.selection.createRange().text);c=c.substr(0,480);var url="http://cang.baidu.com/do/add?it=" encodeURIComponent(t) "&iu=" encodeURIComponent(u) "&dc=" encodeURIComponent(c) "&fr=js#nw=1";window.open(url,\'_blank\',\'scrollbars=no,width=600,height=450,left=75,top=20,status=no,resizable=yes\');void 0"><font color=#fc0000>Baidu</a></font> ]');


2.修改template/b_article-single.html

<h6 class="post-footer">
<#ZC_MSG011#>:<#article/author/name#> | <#ZC_MSG012#>:<#article/category/name#> | <#ZC_MSG013#>:<#article/commnums#> | <#ZC_MSG014#>:<#article/trackbacknums#> | <#ZC_MSG130#>:<span id="spn<#article/id#>"></span>
<script language="JavaScript" type="text/javascript">strBatchCount ="spn<#article/id#>=<#article/id#>,"</script>
</h6>

下添加:

<div style="padding-left:15px; padding-top:5px;">收藏此页到:<script type="text/javascript" language="javascript" src="<#ZC_BLOG_HOST#>wangzhai.js"></script></div>


3.进后台-"文件重建"。OK,效果请看下面。
责任编辑:图王 QQ:470666

文章整理:西部数码--专业提供域名注册虚拟主机服务
http://www.west263.com
以上信息与文章正文是不可分割的一部分,如果您要转载本文章,请保留以上信息,谢谢!