返回列表 发新帖

分享一个把文章分享新浪微博的一个代码

[复制链接]
发表于 2011-2-12 19:09:36  | 显示全部楼层 | 阅读模式
wordpress的程序上,点击按钮之后,把文章的摘要内容及文章的链接发到微博上,效果可以看文章下边的新浪分享按钮
  1. <a href="javascript:void((function(s,d,e,r,l,p,t,z,c){var%20f='http://v.t.sina.com.cn/share/share.php?appkey=880398224',u=z||d.location,p=['&url=',e(u),'&title=',e(t||d.title),'&source=',e(r),'&sourceUrl=',e(l),'&content=',c||'gb2312','&pic=',e(p||'')].join('');function%20a(){if(!window.open([f,p].join(''),'mb',['toolbar=0,status=0,resizable=1,width=440,height=430,left=',(s.width-440)/2,',top=',(s.height-430)/2].join('')))u.href=[f,p].join('');};if(/Firefox/.test(navigator.userAgent))setTimeout(a,0);else%20a();})(screen,document,encodeURIComponent,'','','','<?php   echo mb_strimwidth(strip_tags(apply_filters('the_content', $post->post_content)), 0,150,"...",'utf-8'); ?>','你的网址','页面编码gb2312|utf-8默认gb2312'));">&nbsp;&nbsp;<img border="0" title="新浪微博分享" alt="新浪微博分享" src="http://t.sina.com.cn/favicon.ico" />分享</a>
复制代码
注意:1.此代码只能用在wordpress的程序上,若用在其他程序上,请根据情况修改<?php   echo mb_strimwidth(strip_tags(apply_filters('the_content', $post->post_content)), 0,150,"...",'utf-8'); ?>这个段代码
2.想让链接是本篇文章的链接的话,找到u=z||d.location  把他改成u=d.location   
3.在你的网址的地方改成你的网站主页,然后把上边的代码复制到相应的位置就可以了

发表回复

您需要登录后才可以回帖 登录 | 注册

本版积分规则

关于我们
关于我们
友情链接
联系我们
帮助中心
网友中心
购买须知
支付方式
服务支持
资源下载
售后服务
定制流程
关注我们
官方微博
官方空间
官方微信
快速回复 返回顶部 返回列表