新聞中心
Discuz帖子中增加分享到新浪微博、搜狐微博、網(wǎng)易微博、人人網(wǎng)內(nèi)容代碼及源文件下載
一篇技術精湛、語言精美的帖子,除了讓大家學習與分享之外,是不是需要更好的途徑分享給你身邊的同事朋友呢?像現(xiàn)在最熱門的交際平臺——微博。新浪微博、搜狐微博、網(wǎng)易微博、騰訊微博等知名微博平臺,還有人氣火爆的QQ空間和人人網(wǎng)上都可以留下你的腳印,讓更多的人分享你的精美帖子,以下附上實現(xiàn)之后的效果圖:
下面需要講解一下操作步驟:
首先要登陸FTP工具,找到并下載到本地../template/default/forum/viewthread_node.htm 文件,將以下代碼添加進去。Discuz 2.0及以下版本添加在第254行、2.5版在338行<strong>{lang viewthread_share_to}:</strong>的下面;3.0及以上版本添加在319行 <b>{lang viewthread_share_to}: </b> 的下面,修改保存好后用,用FTP工具把該文件上傳到空間../template/default/forum/目錄下,原文件重命名成viewthread_node.htm_bak。
下面給大家提供一下輸入代碼:
<!--新浪微博代碼開始-->
<a style="cursor:pointer;" href="javascript:void((function(s,d,e){try{}catch(e){}var f='http://service.weibo.com/share/share.php?',u=d.location.href,p=['url=',e(u),'&title=',e(d.title),'&appkey=3456769525'].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));" title="分享到新浪微博"><img src="http://www.jiu9.org/static/image/common/sina.png" alt="新浪微博">新浪微博</a>
<!--新浪微博代碼結束-->
<!--搜狐微博代碼開始-->
<a href="javascript:var u=location.href;var t=document.title;t=t.substr(0,80); var c=''+(window.getSelection?window.getSelection():document.getSelection?document.getSelection():document.selection.createRange().text);c=c.substr(0,280);var e=encodeURIComponent;var url='http://t.sohu.com/third/post.jsp?&url='+e(u)+'&title='+e(t)+'&content=utf-8&pic='+'&appkey=NmvwbQj92TnbRcxym4jD';window.open(url,'','toolbar=0,resizable=1,scrollbars=yes,status=1,width=600,height=450');void(0)" title="分享到搜狐微博"><img src="http://www.jiu9.org/static/image/common/sohu.png" alt="搜狐微博">搜狐微博</a>
<!--搜狐微博代碼結束-->
<!--網(wǎng)易微博代碼開始-->
<a target="_self" onclick="(function(){var url = '&source=254PELAUCxw51IlO' + '&info='+ encodeURIComponent(document.title) + ' ' + encodeURIComponent(document.location.href);window.open('http://t.163.com/article/user/checkLogin.do?'+url+'&'+new Date().getTime(),'newwindow','height=330,width=550,top='+(screen.height-280)/2+',left='+(screen.width-550)/2+', toolbar=no, menubar=no, scrollbars=no,resizable=yes,location=no, status=no');})()" href="javascript:void(0);" title="分享到網(wǎng)易微博"><img src="http://www.jiu9.org/static/image/common/163.png" alt="網(wǎng)易微博">網(wǎng)易微博</a>
<!--網(wǎng)易微博代碼結束-->
<!--騰訊微博代碼開始-->
<a href="javascript:void(0)" onclick="postToWb();" class="tmblog" title="分享到騰訊微博"><img src="http://www.jiu9.org/static/image/common/qwb.png">騰訊微博</a>
<script type="text/javascript">
function postToWb(){
var _t = encodeURI(document.title);
var _url = encodeURI(document.location);
var _appkey = encodeURI("801416073");
var _pic = encodeURI('');
var _site = '';
var _u = 'http://v.t.qq.com/share/share.php?title='+_t+'&url='+_url+'&appkey='+_appkey+'&site='+_site+'&pic='+_pic;
window.open( _u,'轉播到騰訊微博', 'width=700, height=680, top=0, left=0, toolbar=no, menubar=no, scrollbars=no, location=yes, resizable=no, status=no' );
}
</script>
<!--騰訊微博代碼結束-->
<!--QQ空間代碼開始-->
<a href="javascript:void(0);" onclick="window.open('http://sns.qzone.qq.com/cgi-bin/qzshare/cgi_qzshare_onekey?url='+encodeURIComponent(document.location.href));return false;" title="分享到QQ空間"><img src="http://www.jiu9.org/static/image/common/qz.png" alt="分享到QQ空間">QQ空間</a>
<!--QQ空間代碼結束-->
<!--人人網(wǎng)代碼開始-->
<a href="javascript:void((function(s,d,e){if(/renren\.com/.test(d.location))return;var f='http://share.renren.com/share/buttonshare?link=',u=d.location,l=d.title,p=[e(u),'&title=',e(l)].join('');function%20a(){if(!window.open([f,p].join(''),'xnshare',['toolbar=0,status=0,resizable=1,width=626,height=436,left=',(s.width-626)/2,',top=',(s.height-436)/2].join('')))u.href=[f,p].join('');};if(/Firefox/.test(navigator.userAgent))setTimeout(a,0);else%20a();})(screen,document,encodeURIComponent));" title="分享到人人網(wǎng)"><img src="http://www.jiu9.org/static/image/common/ren.png" alt="人人網(wǎng)">人人網(wǎng)</a>
<!--人人網(wǎng)代碼結束-->
如果你覺得上面這種手動添加代碼的方式太麻煩:
2.0及以下簡體中文GBK8版請下載:
http://zhubinggui.51phpc.com/Discuz/Discuz2.0GBK.zip
2.0及以下簡體中文UTF8版請下載:
http://zhubinggui.51phpc.com/Discuz/Discuz2.0UTF8.zip
2.5簡體中文GBK版請下載:
http://zhubinggui.51phpc.com/Discuz/Discuz2.5GBK.zip
2.5簡體中文UTF8版請下載:
http://zhubinggui.51phpc.com/Discuz/Discuz2.5UTF8.zip
3.0及以上簡體中文GBK版請下載:
http://zhubinggui.51phpc.com/Discuz/Discuz3.0GBK.zip
3.0及以上簡體中文UTF8版請下載:
http://zhubinggui.51phpc.com/Discuz/Discuz3.0UTF8.zip
希望能幫助大家,無憂小編在這里祝賀大家國慶快樂!?。?
注:任意打開一個帖子后如果沒有出現(xiàn)該功能,請去DZ后臺更新緩存。
本文地址:http://m.gle-technology.com/discuz/12469.html
![1](/wp-content/themes/starow_z/img/o-1.png)
![1](/wp-content/themes/starow_z/img/o-2.png)
![1](/wp-content/themes/starow_z/img/o-3.png)
![1](/wp-content/themes/starow_z/img/o-4.png)
![1](/wp-content/themes/starow_z/img/o-5.png)
![1](/wp-content/themes/starow_z/img/o-6.png)
![1](/wp-content/themes/starow_z/img/o-7.png)