Discuz論壇帖子增加分享到新浪微博的方法 " z$ K9 Q3 L, s2 t; v. O
! q7 }: V2 L+ x+ }% n
: e: F; T! Y# L9 F4 p' K1、首先找到如下文件
* N" n. d. `3 b& g2 p h0 qtemplate/default/forum/viewthread_node.htm
4 M: u( m- V% }, H) g1 A/ C$ O1 y9 a. x/ G" A/ r
2、在viewthread_node.htm中找到下面代碼:- <div id="p_btn" class="mtw mbm cl"> ?# l. t$ `9 {' V# ^, A
- <!--{if !empty($_G['setting']['pluginhooks']['viewthread_share_method'])}-->
4 a+ r+ i8 Y% X! { - <div class="tshare cl">6 Z3 K+ L$ T* T9 v# e1 J: c3 l
- <strong>{lang viewthread_share_to}:</strong>
復(fù)制代碼 3。在代碼下面添加:- <script type="text/javascript" charset="utf-8">' l. I( M& m( [ Y: K
- (function(){
( V9 }* T* u4 h - var _w = 86 , _h = 16;
" y% F( i/ X' M6 Z% {! j - var param = {* ]1 S: `, k/ W6 B
- url:location.href,
& j0 c( D* c( t - type:'6',& Q/ K; l+ z* t% X3 t B2 z
- count:'',$ k% C( |+ q& M" D7 e1 f3 j& b
- appkey:'3720528650',
* F8 z8 O: y; J& G, y# [; l7 N - title:'',. t l. X/ M3 j+ z8 s5 R- e
- pic:'', /**分享圖片的路徑(可選)*/. R8 c1 y9 i6 `) j" \
- ralateUid:'2663493887',
) F9 @. W0 s! b - language:'zh_cn',+ Z- C- X; L9 A% d. [7 N
- rnd:new Date().valueOf()
% e5 d. G2 W' l6 H2 q+ E' e - }0 @. b$ A1 L1 e* T% w6 d
- var temp = [];) d4 b# G- U! {: w5 d2 k
- for( var p in param ){
$ d8 y" G- u7 P2 h) p% Q( L - temp.push(p + '=' + encodeURIComponent( param[p] || '' ) ): a( U- U6 J1 L Z. b; o
- }
: m$ C$ `" s0 e2 `5 W - document.write('<iframe allowTransparency="true" frameborder="0" scrolling="no" src="http://hits.sinajs.cn/A1/weiboshare.html?' + temp.join('&') + '" width="'+ _w+'" height="'+_h+'"></iframe>')8 V2 K: `$ ^0 V" G; p7 t6 E
- })()
5 S ^4 U" v9 s6 Z - </script>
復(fù)制代碼 |