Discuz論壇帖子增加分享到新浪微博的方法
+ M, q4 G/ {( b7 ]" V; Y5 Z8 c0 ]7 n, R+ Y: @
! d# s5 q! b/ @& Q
1、首先找到如下文件+ l) S# y0 l0 p7 c9 }
template/default/forum/viewthread_node.htm- o& \( s8 B0 P: A. A2 J4 s9 _
4 m7 X& v2 Q# r) ]! g2、在viewthread_node.htm中找到下面代碼:- <div id="p_btn" class="mtw mbm cl">
- }- h! h$ a3 a* h - <!--{if !empty($_G['setting']['pluginhooks']['viewthread_share_method'])}-->
$ ~+ a& t+ G- {6 x% z8 i - <div class="tshare cl">
- d" z. F* ^$ a - <strong>{lang viewthread_share_to}:</strong>
復(fù)制代碼 3。在代碼下面添加:- <script type="text/javascript" charset="utf-8">" j6 K/ U& x" ?3 K1 u/ Z
- (function(){
* g+ Y1 r e; I% u - var _w = 86 , _h = 16;
5 r# Y- e: c7 T+ O" i6 k" G - var param = {
8 d, h1 S8 I2 ~7 R' j - url:location.href,
+ N, {7 u+ ?8 U1 T( B3 j - type:'6',9 h! _- X1 c* H8 d% G* a' K8 X# D
- count:'',( V2 h0 {- p7 }1 F
- appkey:'3720528650',: Y. U8 L) ~7 s2 T
- title:'',& F( L1 ^- c+ u! O7 A2 j# i
- pic:'', /**分享圖片的路徑(可選)*/
& n3 ^& M$ m! F& ?! v - ralateUid:'2663493887',
- @' e0 q! b1 f( a8 B1 n0 _ - language:'zh_cn',4 z1 q1 a0 g4 _1 _; L0 N% L7 J+ G) q# I
- rnd:new Date().valueOf() g1 x. d3 D, R
- }
- |2 O% c% ?: G: v: N - var temp = [];- P/ a, i* g) {. H
- for( var p in param ){1 w. J/ M; l1 @0 g& B; }
- temp.push(p + '=' + encodeURIComponent( param[p] || '' ) )
( {% n4 i, ` o1 | - } `' X2 ]" _; t1 L3 |
- document.write('<iframe allowTransparency="true" frameborder="0" scrolling="no" src="http://hits.sinajs.cn/A1/weiboshare.html?' + temp.join('&') + '" width="'+ _w+'" height="'+_h+'"></iframe>')
4 |$ X }; n+ M o& a& o3 u - })()+ e$ s4 A' m1 d/ m8 _
- </script>
復(fù)制代碼 |