Discuz论坛帖子增加分享到新浪微博的方法 6 O0 V4 Y1 b. t& ?! {& d0 K
6 R5 i% j0 s9 f, S2 |) S- E
/ t2 T( [! H8 M! U( ]0 f
1、首先找到如下文件
7 G& O/ l1 ?% d) U" q8 t+ Qtemplate/default/forum/viewthread_node.htm& p# {7 n$ X3 A" U2 S* D
" s; l3 P' a/ J$ h
2、在viewthread_node.htm中找到下面代码:- <div id="p_btn" class="mtw mbm cl">
' u! Z( h9 j/ @6 J - <!--{if !empty($_G['setting']['pluginhooks']['viewthread_share_method'])}-->. Q! P% D& P" `) @9 g3 L
- <div class="tshare cl">
$ X; C( [5 a" ~ - <strong>{lang viewthread_share_to}:</strong>
复制代码 3。在代码下面添加:- <script type="text/javascript" charset="utf-8">
) w/ h6 H( c v - (function(){) |2 @7 S" B4 B- H% f" n( l
- var _w = 86 , _h = 16;: G6 C1 L% r0 Z' T/ k. i# B
- var param = {/ K- Y: A* K* I$ R% |
- url:location.href,* X/ P9 }8 k) ^
- type:'6',
/ ~, }5 e& a6 _/ ? - count:'',
' }9 f' N# Q" P) m: K - appkey:'3720528650',- S( Z7 \; x' F; m ]
- title:'',
' B/ [: Y& l1 l8 M5 R - pic:'', /**分享图片的路径(可选)*/& j. t. v0 y4 s0 d
- ralateUid:'2663493887',6 |3 W* w$ I% j) s
- language:'zh_cn',
' Z6 ~# U# ^+ m' S9 c$ j - rnd:new Date().valueOf()
1 B! }/ [; d. Y, X( l8 a3 | - }
5 U! a8 [3 w; d. H! }3 d$ E8 e - var temp = [];& \; _; d& s# `6 Y* s. F8 P9 g
- for( var p in param ){
( ?2 V0 _) f2 t9 A8 I- d - temp.push(p + '=' + encodeURIComponent( param[p] || '' ) )" \! j7 V% a* e4 p
- }# O& B, L# p- l s
- document.write('<iframe allowTransparency="true" frameborder="0" scrolling="no" src="http://hits.sinajs.cn/A1/weiboshare.html?' + temp.join('&') + '" width="'+ _w+'" height="'+_h+'"></iframe>')
- ^! e5 u* ~; e; C! V: C - })()
$ D2 r/ }) `+ q+ J+ B - </script>
复制代码 |