Discuz论坛帖子增加分享到新浪微博的方法
# U/ s) n% _5 V4 K: U+ K
+ M( k$ X- c. L! ~6 t! y, \
* d0 ^, b2 }" i3 j; H1、首先找到如下文件2 k& \7 ~, \% R2 I1 Q
template/default/forum/viewthread_node.htm" ^9 V) V" U2 I3 X
# w9 R# n" n {( U6 U
2、在viewthread_node.htm中找到下面代码:- <div id="p_btn" class="mtw mbm cl">* b" P2 k/ o* [" q) Y
- <!--{if !empty($_G['setting']['pluginhooks']['viewthread_share_method'])}-->( u: c+ X1 j" Y# G2 m2 Y4 _8 S! F
- <div class="tshare cl">5 }# o/ F6 U, G, V# g
- <strong>{lang viewthread_share_to}:</strong>
复制代码 3。在代码下面添加:- <script type="text/javascript" charset="utf-8">% p9 {2 v0 s z5 \3 E
- (function(){
$ m2 U; g4 V: ]' a# h8 l W3 `2 O - var _w = 86 , _h = 16;6 H$ v: r4 l8 H }
- var param = {% A. p7 c4 @' b7 M) Z% W; ?6 G
- url:location.href,+ O& ~6 K) ?6 z5 K. h8 I1 g
- type:'6',9 C' X- d8 g" T# }0 [4 W' r- @
- count:'',2 K6 J5 O L* D- o1 U ~
- appkey:'3720528650',% M- n' @8 e. ~
- title:'',( B( b8 c) A; T/ z8 K/ V& L0 F
- pic:'', /**分享图片的路径(可选)*/6 w) F- ~, \3 j- Q* c4 o( F* U
- ralateUid:'2663493887',2 ]' K) {! A N6 `
- language:'zh_cn',! W6 D4 T1 @# x; a6 W' \
- rnd:new Date().valueOf()
1 |+ X+ N: \* D/ U. H: Q - }4 m! g5 ]6 b8 R
- var temp = [];
( Y& k, _' W& e9 X3 z/ e - for( var p in param ){6 \1 H6 m" Q$ s4 K
- temp.push(p + '=' + encodeURIComponent( param[p] || '' ) )
9 R+ K' W, ?- S" p+ R - }9 h9 \- l+ D: L3 x$ N
- 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 E. h, E7 M5 y# |& W) a! g% l - })()8 U6 r% [3 @( s/ h
- </script>
复制代码 |