打開
template/default/forum/viewthread_node.htm,查找:
- <!--{if $post['invisible'] == 0}-->
- <!--{if $post['first'] && $_G[uid] && $_G[uid] == $post[authorid]}-->
- <a
href="misc.php?mod=invite&action=thread&id=$_G[tid]"
onclick="showWindow('invite', this.href, 'get', 0);">{lang
invite}</a> - <!--{/if}-->
在
上面添加:(注意上面有個<p>)
- <img
src="http://v.t.qq.com/share/images/s/weiboicon16.png"
align="absmiddle"/> <a href=""
onclick="postToWb();"
style="height:16px;font-size:12px;line-height:16px;"> 轉播到騰訊微博</a&
gt;<script type="text/javascript"> - function postToWb(){
- var _t = encodeURI(document.title);
- var _url = encodeURIComponent(document.location);
- var _appkey = encodeURI("39d5fc64bfd54c7b9507f846debda0f4");//你從騰訊獲得的 appkey
- var _pic = encodeURI('');//(例如:var _pic='圖片 url1|圖片 url2|圖片 url3....)
- var _site = 'http://www.yudi.tk/';//你的網站地址
- var _u =
'http://v.t.qq.com/share/share.php?title='+_t+'&url='+_url+'&appkey='+_appkey+'&site='+_site+'&pic='+_pic; - window.open( _u,'', 'width=700, height=680,
top=0, left=0, toolbar=no, menubar=no, scrollbars=no, location=yes,
resizable=no, status=no' ); - }
- </script>
申請 AppKey 的辦法:
- 如需在騰訊微博顯示來源,需向騰訊官方申請 AppKey 。請通過郵件形式申請,發送以下信息:
- 1. 網站名稱;
- 2. 應用場景簡述;
- 3. 域名;
- 4. 需要顯示的來源字段。
- 至郵箱 api_weibo@tencent.com,通過審核後我們會郵件回覆 AppKey 。
- 説明:為了保證頁面顯示效果,請提供相對簡潔的來源字段,不超過 8 個漢字。來源字段將在申請成功後 1-2 個工作日內生效。