Discuz論壇帖子增加分享到新浪微博的方法 $ q) q m% X, p! f! K0 t
8 f+ ]; p& c& g( f8 v0 q- a
' p6 C$ D6 b* M- Y! r: u1、首先找到如下文件0 H4 }& i' U7 R* @8 s4 }
template/default/forum/viewthread_node.htm
' |2 b: [# \/ g! K4 H0 v6 O& u. z* E$ e5 S; a' \# R G6 T
2、在viewthread_node.htm中找到下面代碼:- <div id="p_btn" class="mtw mbm cl">$ E4 R: ~, {% r n/ ?" G' z
- <!--{if !empty($_G['setting']['pluginhooks']['viewthread_share_method'])}-->
9 b, y9 U4 ~3 g% b) T' @ - <div class="tshare cl">; V- @. a. p8 Q
- <strong>{lang viewthread_share_to}:</strong>
復(fù)制代碼 3。在代碼下面添加:- <script type="text/javascript" charset="utf-8">( d3 ^7 q$ T9 R
- (function(){
, a5 [8 o. y- L - var _w = 86 , _h = 16;2 ~7 M3 j# H0 F6 O3 p# U) s, A
- var param = {. W8 \. E! l; _. D6 g0 x0 H
- url:location.href,+ Y' `8 F6 S m
- type:'6',) |% U* s9 B9 @; L3 g
- count:'',
+ j2 C4 _1 R7 }- N- [ - appkey:'3720528650',& K" x; S4 S; c4 B; t" T7 L s1 `
- title:'',
8 ^9 {! D4 P9 l5 p9 | - pic:'', /**分享圖片的路徑(可選)*/
8 x! o, [4 D9 M - ralateUid:'2663493887',
; R4 l1 M: I" z' t0 l( E0 [5 G+ E' A( F - language:'zh_cn',& G R S1 g. c( }0 Y& y. b0 K
- rnd:new Date().valueOf()
, p* |) ~. g, t1 |# F0 W1 K: p - }% z7 G4 z2 C5 w4 D
- var temp = [];) j; c# p4 k. Y0 E
- for( var p in param ){: h: W5 d1 z* a# P5 [9 I, v
- temp.push(p + '=' + encodeURIComponent( param[p] || '' ) )7 g. n9 A' Z v& N. [6 d
- }8 x6 O% H) y% s& B2 h' t. \
- document.write('<iframe allowTransparency="true" frameborder="0" scrolling="no" src="http://hits.sinajs.cn/A1/weiboshare.html?' + temp.join('&') + '" width="'+ _w+'" height="'+_h+'"></iframe>')6 C" u3 p$ g) q. V5 e
- })()
- _+ S& L' _, V1 n" s( {) [. i m - </script>
復(fù)制代碼 |