Discuz論壇帖子增加分享到新浪微博的方法
! g) R6 h5 [# p+ Q% j8 m( r7 @4 S( l
' W. I+ a- P1 }* _: K3 w9 h4 D
1、首先找到如下文件4 W" s7 j$ N+ D' f. z8 K' E
template/default/forum/viewthread_node.htm2 g# G. g2 c) N$ o! `
: |2 k$ Z: ]8 G4 k- b; {3 R
2、在viewthread_node.htm中找到下面代碼:- <div id="p_btn" class="mtw mbm cl">
1 b3 l. _* c* }: ]; T - <!--{if !empty($_G['setting']['pluginhooks']['viewthread_share_method'])}-->; p$ x' u4 L8 u1 m/ U
- <div class="tshare cl">
( h5 g8 [; R6 W8 A - <strong>{lang viewthread_share_to}:</strong>
復(fù)制代碼 3。在代碼下面添加:- <script type="text/javascript" charset="utf-8">
3 \0 e1 S4 ? }1 I! t. {! n: u! c - (function(){ H% u7 r/ u6 g
- var _w = 86 , _h = 16;
( y6 U1 e$ m- T3 m - var param = {
7 u5 Z3 ?- Z! B$ P1 ] - url:location.href,* @5 {4 P) c* ?
- type:'6',4 Y6 W+ B9 S% k& a) L
- count:'',
+ f k" o! z$ V8 L" t - appkey:'3720528650',6 ~/ ?8 N" u5 _4 l6 t% P/ m/ v
- title:'',
( ^! i/ p3 c& J; c+ ~ - pic:'', /**分享圖片的路徑(可選)*/: d/ x7 \* b0 [" u5 L& Z
- ralateUid:'2663493887',0 ^4 T0 l! e& c, D
- language:'zh_cn',6 z |# o: W8 {; Z" t- {3 U4 H
- rnd:new Date().valueOf()8 p0 k+ m- l' G, _6 ]( r7 O& \
- }
# W7 t8 I# C' S q5 q p- H: z - var temp = [];
4 P( J3 @$ o# s7 f+ ^1 {7 f" w - for( var p in param ){
1 G: f" h7 _) Z - temp.push(p + '=' + encodeURIComponent( param[p] || '' ) )
1 ~/ @6 v, a3 @ - }' B# F. Q+ O1 Z
- document.write('<iframe allowTransparency="true" frameborder="0" scrolling="no" src="http://hits.sinajs.cn/A1/weiboshare.html?' + temp.join('&') + '" width="'+ _w+'" height="'+_h+'"></iframe>')
0 }* V* {" `- u/ x Y( T/ z - })()
# T% @( Z0 J4 V: R! d% f - </script>
復(fù)制代碼 |