欢迎访问鸿雪径,这里介绍软件相关技术、动态以及鸿雪径杂谈,如有技术合作请与站长联系!邮费网 易食烤吧 特产大全网
首页 > 互联网 > discuzX3.2帖子页面增加分享到微博

discuzX3.2帖子页面增加分享到微博

发布时间:2015-03-26 作者: 点击:333

   Discuz X3.2官方安装包里的论坛帖子分享功能里只集成了qq好友和群、QQ空间、腾讯微博以及微信的功能,没有分享到新浪微博的功能,而现在用新浪微博的人不在少数,因此,我们通过修改Discuz X3.2代码,增加论坛帖子分享到新浪微博的功能:

   首先找到templatedefaultforumviewthread_node.htm  文件

   打开后查找viewthread_share_method

   找到如下内容:

<!--{if !empty($_G['setting']['pluginhooks']['viewthread_share_method'])}-->
<div class="tshare cl">
<b>{lang viewthread_share_to}:&nbsp;</b>
<!--{hook/viewthread_share_method}-->
                          
</div>
<!--{/if}-->


   在

<!--{hook/viewthread_share_method}-->

后添加如下内容:

 <!--discuzX3.2分享到新浪微博代码开始-->

<a style="cursor:pointer;" href="javascript:void((function(s,d,e){try{}catch(e){}var 

f='http://v.t.sina.com.cn/share/share.php?',u=d.location.href,p=['url=',e(u),'&title=',e

(d.title),'&appkey=29605942'].join('');function a(){if(!window.open([f,p].join(''),'mb',

['toolbar=0,status=0,resizable=1,width=620,height=450,left=',(s.width-620)/2,',top=',(s.height-450)/2].join('')))

u.href=[f,p].join('');};if(/Firefox/.test(navigator.userAgent)){setTimeout(a,0)}else{a()}})

(screen,document,encodeURIComponent));"> <img src="http://addon.discuz.com/resource/plugin/ljxlwb.png" width="16" alt="新浪微博">新浪微博</a>

<!--discuzX3.2分享到新浪微博代码结束-->


注意里边的appkey内容要替换成自己的,上传测试即可!

增加后的效果如下:

更多关于 微博,discuz 的信息
本站部分文章转载于网上,版权归原作者所有。如果侵犯您的权益,请Email和本站联系!
鸿雪径 www.HongXueJing.com  冀ICP备07017673号-4