本帖最后由 a327173196 于 2011-1-4 22:07 编辑
首先上演示:
文章页:
日志页:
相册页:
不喜可点击右上角X,支持的可以往下看。
功能简述:
①完全绿色,学习后可添加在任何页面
②实现一键转播,增加网站人气来源
③新浪微博支持转播图片,腾讯目前仍然无办法解决转播图片
操作方法:
备份
view.htm
space_blog_view.htm
space_album_pic.htm
一、文章页
找到:
<!--{if $article[from]}--><span class="pipe">|</span>{lang from}: <!--{if $article[fromurl]}--><a href="$article[fromurl]" target="_blank">$article[from]</a><!--{else}-->$article[from]<!--{/if}--><!--{/if}-->
在其下面加入:
<span class="pipe">|</span>
<script type="text/javascript">document.write('<iframe frameborder="0" scrolling="no" src="http://hits.sinajs.cn/A1/weiboshare.html?url=%url%&appkey=1775043196&type=3&ralateUid=1904044821" width="16" height="16"></iframe>'.replace(/%url%/,encodeURIComponent(location.href)));</script>
<span class="pipe">|</span>
<a href="javascript:void(0)" class="tmblog"><img src="http://v.t.qq.com/share/images/s/weiboicon16.png"></a> <script type="text/javascript">
function postToWb(){
var _t = encodeURI(document.title);
var _url = encodeURI(document.location);
var _appkey = encodeURI("014b5ac196244f90a23670d609615605");//你从腾讯获得的appkey
var _pic = encodeURI('');//(列如:var _pic='图片url1|图片url2|图片url3....)
var _site = 'http://www.vwu.cc';//你的网站地址
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>
<span class="pipe">|</span>
<a href="javascript:void(0);" title="分享到QQ空间"><img src="http://qzonestyle.gtimg.cn/ac/qzone_v5/app/app_share/qz_logo.png" alt="分享到QQ空间" /></a><span class="pipe">|</span>
上传文件,完成。
二、日志页
找到:
<!--{/if}-->
<!--{if $_G['uid'] != $blog['uid']}-->
<a href="javascript:;">{lang report}</a>
下方添加:
<span class="pipe">|</span>
<script type="text/javascript">document.write('<iframe frameborder="0" scrolling="no" src="http://hits.sinajs.cn/A1/weiboshare.html?url=%url%&appkey=1775043196&type=3&ralateUid=1904044821" width="16" height="16"></iframe>'.replace(/%url%/,encodeURIComponent(location.href)));</script>
<span class="pipe">|</span>
<a href="javascript:void(0)" class="tmblog"><img src="http://v.t.qq.com/share/images/s/weiboicon16.png"></a> <script type="text/javascript">
function postToWb(){
var _t = encodeURI(document.title);
var _url = encodeURI(document.location);
var _appkey = encodeURI("014b5ac196244f90a23670d609615605");//你从腾讯获得的appkey
var _pic = encodeURI('');//(列如:var _pic='图片url1|图片url2|图片url3....)
var _site = 'http://www.vwu.cc';//你的网站地址
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>
<span class="pipe">|</span>
<a href="javascript:void(0);" title="分享到QQ空间"><img src="http://qzonestyle.gtimg.cn/ac/qzone_v5/app/app_share/qz_logo.png" alt="分享到QQ空间" /></a><span class="pipe">|</span>
上传文件,完成。
三、图片页
找到:
<span class="pipe">|</span><a href="home.php?mod=spacecp&ac=album&picid=$pic[picid]&op=edithot&handlekey=picedithothk_{$pic[picid]}" id="a_hot_$pic[picid]">{lang hot}</a>
<!--{/if}-->
在下面添加:
<span class="pipe">|</span>
<script type="text/javascript">document.write('<iframe frameborder="0" scrolling="no" src="http://hits.sinajs.cn/A1/weiboshare.html?url=%url%&appkey=1775043196&type=3&ralateUid=1904044821" width="16" height="16"></iframe>'.replace(/%url%/,encodeURIComponent(location.href)));</script>
<span class="pipe">|</span>
<a href="javascript:void(0)" class="tmblog"><img src="http://v.t.qq.com/share/images/s/weiboicon16.png"></a> <script type="text/javascript">
function postToWb(){
var _t = encodeURI(document.title);
var _url = encodeURI(document.location);
var _appkey = encodeURI("014b5ac196244f90a23670d609615605");//你从腾讯获得的appkey
var _pic = encodeURI('');//(列如:var _pic='图片url1|图片url2|图片url3....)
var _site = 'http://www.vwu.cc';//你的网站地址
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>
<span class="pipe">|</span>
<a href="javascript:void(0);" title="分享到QQ空间"><img src="http://qzonestyle.gtimg.cn/ac/qzone_v5/app/app_share/qz_logo.png" alt="分享到QQ空间" /></a><span class="pipe">|</span>
上传文件,完成。
四、代码解释
</a><span class="pipe">|</span>
分隔符
http://hits.sinajs.cn/A1/weiboshare.html?url=%url%&appkey=1775043196&type=3&ralateUid=1904044821
新浪转播链接 可以到新浪微博开放平台获取
014b5ac196244f90a23670d609615605
腾讯微博APP 可以到腾讯微博开放平台获取
教程完毕,印记。
另:鄙视代码框,害我内容丢失。
AD:新浪微博、腾讯微博登录框美化https://discuz.dismall.com/thread-2015950-1-1.html
演示:
|