Discuz! 6.1 - 不修改模板在贴子上增加收藏按钮
通过收藏夹网站收藏论坛中自己喜爱的贴子是一个常见的需求,但是需要对模板进行修改,下面给出一个不修改模板在贴子上增加收藏按钮的例子。jQuery(document).ready(function(){
varpoco = '<a href="javascript:d=document;t=d.selection?(d.selection.type!=/'None/'?d.selection.createRange().text:/'/'):(d.getSelection?d.getSelection():/'/');void(vivi=window.open(/'http://my.poco.cn/fav/storeIt.php?t=/'+escape(d.title)+/'&u=/'+escape(d.location.href)+/'&c=/'+escape(t),/'_blank/',/'scrollbars=no,width=475,height=575,left=75,top=20,status=no,resizable=yes/'));" title="收藏到POCO 网摘http://share.poco.cn"><img src=http://share.poco.cn/images/poco_cop.gif border=0></a>';
varvivi = '<a href="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=/'+location.hostname+/'&title=/'+escape(d.title)+/'&url=/'+escape(d.location.href)+/'&desc=/'+escape(t),/'vivi/',/'scrollbars=no,width=480,height=480,left=75,top=20,status=no,resizable=yes/'));vivi.focus();" title="收藏的网页将被永久地保存到爱问ViVi收藏夹http://vivi.sina.com.cn"><img src=http://image2.sina.com.cn/pfp/iweb/vivi_coop.gif border=0></a>';
varyesky = '<a href="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=75,top=20,status=no,resizable=yes/'));yesky.focus();" title="天极网摘:文摘|图摘|闪摘|乐摘 http://hot.yesky.com"><IMGsrc="http://hot.yesky.com/image/souchang1.gif"></a>';
jQuery('.postmessage:first').append('<div>收藏发送本文至:'+ vivi + ' '+ poco + ' '+ yesky + '</div>');
}
);
[Discuz! - 官方网站]
http://www.discuz.net/[Discuz! - 常见问题]
Discuz! 6.1 从GBK编码转为UTF-8编码Discuz! 6.1 多语言翻译工作范围
Discuz! 6.1 兼容问题
Discuz! 6.1 发送HTML格式电子邮件
Discuz! 6.1 安装SupeSite后导致安全漏洞
Discuz! 6.1 不修改模板在贴子上增加收藏按钮
本文介绍如何在Discuz!6.1论坛帖子上不修改模板即可添加收藏按钮的方法,利用jQuery实现向帖子中动态插入指向不同收藏服务的链接。

被折叠的 条评论
为什么被折叠?



