<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>PODIDEA</title>
	<atom:link href="http://www.podidea.com/feed" rel="self" type="application/rss+xml" />
	<link>http://www.podidea.com</link>
	<description>Hi ~ Just AnoTheR WoRdpReSs Blog</description>
	<lastBuildDate>Thu, 27 Oct 2011 14:18:46 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>WeFiler邀请码五枚</title>
		<link>http://www.podidea.com/2011/10/27/221547/584.html</link>
		<comments>http://www.podidea.com/2011/10/27/221547/584.html#comments</comments>
		<pubDate>Thu, 27 Oct 2011 14:15:47 +0000</pubDate>
		<dc:creator>Eric</dc:creator>
				<category><![CDATA[Internet]]></category>
		<category><![CDATA[2.0]]></category>
		<category><![CDATA[Apple]]></category>
		<category><![CDATA[Download]]></category>
		<category><![CDATA[Mac]]></category>
		<category><![CDATA[WeFiler]]></category>
		<category><![CDATA[Weiphone]]></category>

		<guid isPermaLink="false">http://www.podidea.com/?p=584</guid>
		<description><![CDATA[分享WeFiler邀请码五枚 http://www.wefiler.com/invite=DNBETHMDB8 http://www.wefiler.com/invite=E9Q7VNMY6N http://www.wefiler.com/invite=SX6GABHRWC http://www.wefiler.com/invite=GPCQUVT58D http://www.wefiler.com/invite=5PRCD49L6K 个人有个人的喜好，大家自己去评测吧！ WeFiler邀请码五枚 is a post from: Eric&#039;s Blog<p><a href="http://www.podidea.com/2011/10/27/221547/584.html">WeFiler邀请码五枚</a> is a post from: <a href="http://www.1991s.com">Eric&#039;s Blog</a></p>
]]></description>
			<content:encoded><![CDATA[<p>分享WeFiler邀请码五枚<br />
<a href="http://www.wefiler.com/invite=DNBETHMDB8" target="_blank">http://www.wefiler.com/invite=DNBETHMDB8</a><br />
<a href="http://www.wefiler.com/invite=E9Q7VNMY6N" target="_blank">http://www.wefiler.com/invite=E9Q7VNMY6N</a><br />
<a href="http://www.wefiler.com/invite=SX6GABHRWC" target="_blank">http://www.wefiler.com/invite=SX6GABHRWC</a><br />
<a href="http://www.wefiler.com/invite=GPCQUVT58D" target="_blank">http://www.wefiler.com/invite=GPCQUVT58D</a><br />
<a href="http://www.wefiler.com/invite=5PRCD49L6K" target="_blank">http://www.wefiler.com/invite=5PRCD49L6K</a></p>
<p>个人有个人的喜好，大家自己去评测吧！</p>
<p><a href="http://www.podidea.com/2011/10/27/221547/584.html">WeFiler邀请码五枚</a> is a post from: <a href="http://www.1991s.com">Eric&#039;s Blog</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.podidea.com/2011/10/27/221547/584.html/feed</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>疯狂的删除</title>
		<link>http://www.podidea.com/2011/10/23/020701/582.html</link>
		<comments>http://www.podidea.com/2011/10/23/020701/582.html#comments</comments>
		<pubDate>Sat, 22 Oct 2011 18:07:01 +0000</pubDate>
		<dc:creator>Eric</dc:creator>
				<category><![CDATA[Journal]]></category>
		<category><![CDATA[Blog]]></category>
		<category><![CDATA[Delete]]></category>

		<guid isPermaLink="false">http://www.podidea.com/?p=582</guid>
		<description><![CDATA[本来博客文章就少的可怜了，今天疯狂删除了很多，因为自己发现看了觉得有点反胃，有时候想写博客但是打几个字又停下了，写出一个好的博文是个伤脑筋的事情，我不是文艺青年，也写不出抒情的文章~~ 疯狂的删除 is a post from: Eric&#039;s Blog<p><a href="http://www.podidea.com/2011/10/23/020701/582.html">疯狂的删除</a> is a post from: <a href="http://www.1991s.com">Eric&#039;s Blog</a></p>
]]></description>
			<content:encoded><![CDATA[<p>本来博客文章就少的可怜了，今天疯狂删除了很多，因为自己发现看了觉得有点反胃，有时候想写博客但是打几个字又停下了，写出一个好的博文是个伤脑筋的事情，我不是文艺青年，也写不出抒情的文章~~</p>
<p><a href="http://www.podidea.com/2011/10/23/020701/582.html">疯狂的删除</a> is a post from: <a href="http://www.1991s.com">Eric&#039;s Blog</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.podidea.com/2011/10/23/020701/582.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>微博替代了博客</title>
		<link>http://www.podidea.com/2011/10/23/020324/578.html</link>
		<comments>http://www.podidea.com/2011/10/23/020324/578.html#comments</comments>
		<pubDate>Sat, 22 Oct 2011 18:03:24 +0000</pubDate>
		<dc:creator>Eric</dc:creator>
				<category><![CDATA[Journal]]></category>
		<category><![CDATA[Blog]]></category>
		<category><![CDATA[Sina]]></category>
		<category><![CDATA[Twitter]]></category>

		<guid isPermaLink="false">http://www.podidea.com/?p=578</guid>
		<description><![CDATA[长时间的不写博客，整个博客处于废除状态，自从有了微博以后发现很多老鸟也懒得写博客了，博客需要写很多字，微博寥寥几个字就可以了，决定把自己的博客搞成“轻博客”得了，想写心情写心情，想发图片发图片~ 微博替代了博客 is a post from: Eric&#039;s Blog<p><a href="http://www.podidea.com/2011/10/23/020324/578.html">微博替代了博客</a> is a post from: <a href="http://www.1991s.com">Eric&#039;s Blog</a></p>
]]></description>
			<content:encoded><![CDATA[<p>长时间的不写博客，整个博客处于废除状态，自从有了微博以后发现很多老鸟也懒得写博客了，博客需要写很多字，微博寥寥几个字就可以了，决定把自己的博客搞成“轻博客”得了，想写心情写心情，想发图片发图片~</p>
<p><a href="http://www.podidea.com/2011/10/23/020324/578.html">微博替代了博客</a> is a post from: <a href="http://www.1991s.com">Eric&#039;s Blog</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.podidea.com/2011/10/23/020324/578.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>强烈谴责黑网站的人</title>
		<link>http://www.podidea.com/2011/06/24/043811/530.html</link>
		<comments>http://www.podidea.com/2011/06/24/043811/530.html#comments</comments>
		<pubDate>Thu, 23 Jun 2011 20:38:11 +0000</pubDate>
		<dc:creator>Eric</dc:creator>
				<category><![CDATA[Internet]]></category>
		<category><![CDATA[CentOS]]></category>
		<category><![CDATA[Hack]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://www.podidea.com/?p=530</guid>
		<description><![CDATA[（1）、朋友网站被黑。 （2）、另一个朋友网站被黑。 （3）、一个企业网站被黑。 （4）、关停服务器。 1、序幕。 上面的四步就是我这周的总结了，从周一到周四连续的出现服务器里面网站被黑，到现在不得不采取的措施就是先把服务器关了，强烈谴责那些没有真本事，只知道采用卑鄙手段的黑客。 2、缘由。 第一天朋友的论坛（由discuz x搭建）被黑我就不怀疑，因为当朋友告诉我的时候我就知道了是他和其他人的“恩怨”问题，但是也值得反思的就是当天我去论坛后台查看过有一个严重问题的更新补丁，可惜的是我没有做更新。 第二天另外一个朋友的博客被黑（wordpress搭建），这个网站我还不能确认是不是真的被黑，但是当他告诉我不能访问的时候我去看是所有的网站文件被删除后于当天又重新上传了一半内容，因为周日可能是修改了配置文件后忘记重启nginx，所以网站目录不匹配，网站不能正常访问，他以为网站出问题所以自己删除了再重新上传，但是当我今天发现第三个网站被黑的时候就不排除可能是由于wordpress版本过低造成。 今天一个客户的企业站被黑（wordpress搭建），初步估计是由于版本过低，我用的版本是3.1，网上搜索下貌似又漏洞 ，但是现在还存在着顾虑，总觉得会不会是自己的服务器出现漏洞。我的环境是：centos+nginx+php+mysql，采用最新的nginx 1.0.4必然也不存在0day漏洞，还处于纳闷中？ 3、反思。 1、需要即时更新程序的安全补丁。 2、需要多多关注程序安全漏洞的信息。 3、需要经常自我完善程序的安全问题。 4、多多做实验。 4、求助 现在尚未搞清楚到底是自己服务器环境中存在漏洞还是程序存在漏洞，需要大家的帮助，目前自己正在完善和检测自己的环境和程序时候存在可以入侵的漏洞。 强烈谴责黑网站的人 is a post from: Eric&#039;s Blog<p><a href="http://www.podidea.com/2011/06/24/043811/530.html">强烈谴责黑网站的人</a> is a post from: <a href="http://www.1991s.com">Eric&#039;s Blog</a></p>
]]></description>
			<content:encoded><![CDATA[<p>
（1）、朋友网站被黑。<br />
（2）、另一个朋友网站被黑。<br />
（3）、一个企业网站被黑。<br />
（4）、关停服务器。
</p>
<h4>1、序幕。</h4>
<p>
上面的四步就是我这周的总结了，从周一到周四连续的出现服务器里面网站被黑，到现在不得不采取的措施就是先把服务器关了，强烈谴责那些没有真本事，只知道采用卑鄙手段的黑客。
</p>
<p><span id="more-530"></span></p>
<h4>2、缘由。</h4>
<p>
       第一天朋友的论坛（由discuz x搭建）被黑我就不怀疑，因为当朋友告诉我的时候我就知道了是他和其他人的“恩怨”问题，但是也值得反思的就是当天我去论坛后台查看过有一个严重问题的更新补丁，可惜的是我没有做更新。
</p>
<p>
       第二天另外一个朋友的博客被黑（wordpress搭建），这个网站我还不能确认是不是真的被黑，但是当他告诉我不能访问的时候我去看是所有的网站文件被删除后于当天又重新上传了一半内容，因为周日可能是修改了配置文件后忘记重启nginx，所以网站目录不匹配，网站不能正常访问，他以为网站出问题所以自己删除了再重新上传，但是当我今天发现第三个网站被黑的时候就不排除可能是由于wordpress版本过低造成。
</p>
<p>
       今天一个客户的企业站被黑（wordpress搭建），初步估计是由于版本过低，我用的版本是3.1，网上搜索下貌似又漏洞<br />
，但是现在还存在着顾虑，总觉得会不会是自己的服务器出现漏洞。我的环境是：centos+nginx+php+mysql，采用最新的nginx 1.0.4必然也不存在0day漏洞，还处于纳闷中？
</p>
<h4>3、反思。</h4>
<p>1、需要即时更新程序的安全补丁。<br />
2、需要多多关注程序安全漏洞的信息。<br />
3、需要经常自我完善程序的安全问题。<br />
4、多多做实验。</p>
<h4>4、求助</h4>
<p>现在尚未搞清楚到底是自己服务器环境中存在漏洞还是程序存在漏洞，需要大家的帮助，目前自己正在完善和检测自己的环境和程序时候存在可以入侵的漏洞。</p>
<p><a href="http://www.podidea.com/2011/06/24/043811/530.html">强烈谴责黑网站的人</a> is a post from: <a href="http://www.1991s.com">Eric&#039;s Blog</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.podidea.com/2011/06/24/043811/530.html/feed</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>空闲之余的“杰作”</title>
		<link>http://www.podidea.com/2011/04/23/015813/508.html</link>
		<comments>http://www.podidea.com/2011/04/23/015813/508.html#comments</comments>
		<pubDate>Fri, 22 Apr 2011 17:58:13 +0000</pubDate>
		<dc:creator>Eric</dc:creator>
				<category><![CDATA[Design]]></category>
		<category><![CDATA[Graphic Design]]></category>
		<category><![CDATA[Ai]]></category>
		<category><![CDATA[illustrator]]></category>
		<category><![CDATA[Painting]]></category>

		<guid isPermaLink="false">http://www.1991s.com/?p=508</guid>
		<description><![CDATA[空闲之余拿illustrator做的，这可以算个处女作，从来不拿illustrator做过类似图片，大多数时间都是做logo和一些素材为主，勉强可以看看。 空闲之余的“杰作” is a post from: Eric&#039;s Blog<p><a href="http://www.podidea.com/2011/04/23/015813/508.html">空闲之余的“杰作”</a> is a post from: <a href="http://www.1991s.com">Eric&#039;s Blog</a></p>
]]></description>
			<content:encoded><![CDATA[<p>空闲之余拿illustrator做的，这可以算个处女作，从来不拿illustrator做过类似图片，大多数时间都是做logo和一些素材为主，勉强可以看看。</p>
<p><img class="sided" title="earth-day" src="http://img.podidea.com/img/archives/2011/04/earth-day.jpg" alt="" width="596" height="695" /></p>
<p><a href="http://www.podidea.com/2011/04/23/015813/508.html">空闲之余的“杰作”</a> is a post from: <a href="http://www.1991s.com">Eric&#039;s Blog</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.podidea.com/2011/04/23/015813/508.html/feed</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>NGINX日志切割</title>
		<link>http://www.podidea.com/2011/03/28/121655/497.html</link>
		<comments>http://www.podidea.com/2011/03/28/121655/497.html#comments</comments>
		<pubDate>Mon, 28 Mar 2011 04:16:55 +0000</pubDate>
		<dc:creator>Eric</dc:creator>
				<category><![CDATA[Nginx]]></category>
		<category><![CDATA[CentOS]]></category>
		<category><![CDATA[Server]]></category>

		<guid isPermaLink="false">http://www.1991s.com/?p=497</guid>
		<description><![CDATA[Nginx (&#8220;engine x&#8221;) 是一个高性能的 HTTP 和反向代理服务器，也是一个 IMAP/POP3/SMTP 代理服务器。 Nginx 是由 Igor Sysoev 为俄罗斯访问量第二的 Rambler.ru 站点开发的，它已经在该站点运行超过两年半了。Igor 将源代码以类BSD许可证的形式发布。 Nginx 超越 Apache 的高性能和稳定性，使得国内使用 Nginx 作为 Web 服务器的网站也越来越多。 上周对Centos中跑的Nginx做了优化，重新设置了图片、JS、CSS的缓存时间，关闭了一些不需要的日志记录等，我侧重讲日志的处理，因为我觉得这个是相当有必要的。刚开始一直认为日志没有必要处理，也就那么几M的东西，当我查看日志大小的时候我瞠目了，我的日志居然有几百M的级别了，当下就决定对日志进行每天必要的处理操作。 为什么要切割日志？一般Nginx安装好后有些人会打开日志记录有些人会关闭日志记录，打开日志记录的人一般都会把架设在Nginx上的所有网站日志都存在同一个文件里（比如我存在access.log日志文件里），这样日积月累所有网站的访问记录就会把日志文件越积越大，当需要查看日志文件的时候一看就是一大串，不方便查找。现在，如果我把每天的日志文件分割开来用相应的日期标识出来这样就大大方便查找了。（我是建议打开日志记录，日志记录里面存放着很多有用的东西。比如：浏览器名称，可以方便你对网站的排版做出调整；IP地址，如果网站收到攻击，你就可以查到那个IP地址。） 下面开始详细步骤： 编写shell程序 某种情况下会设置多个子域名，因此会产生多个日志文件，像我这类喜欢整齐的人会设置多个日志文件，把每个域名的日志都分开放。下面这个shell程序是多域名处理。 下面是示例，对以下三个网站的日志切割（日志文件名自己命名）： http://www.1991s.com 对应日志 blog.log http://demo.1991s.com 对应日志 demo.log http://happy.1991s.com 对应日志 happy.log 1 2 3 4 5 6 7 8 9 10 11 12 13 14 # !/bin/bash [...]<p><a href="http://www.podidea.com/2011/03/28/121655/497.html">NGINX日志切割</a> is a post from: <a href="http://www.1991s.com">Eric&#039;s Blog</a></p>
]]></description>
			<content:encoded><![CDATA[<p>
      Nginx (&#8220;engine x&#8221;) 是一个高性能的 HTTP 和反向代理服务器，也是一个 IMAP/POP3/SMTP 代理服务器。 Nginx 是由 Igor Sysoev 为俄罗斯访问量第二的 Rambler.ru 站点开发的，它已经在该站点运行超过两年半了。Igor 将源代码以类BSD许可证的形式发布。
</p>
<p>
Nginx 超越 Apache 的高性能和稳定性，使得国内使用 Nginx 作为 Web 服务器的网站也越来越多。
</p>
<p>
上周对Centos中跑的Nginx做了优化，重新设置了图片、JS、CSS的缓存时间，关闭了一些不需要的日志记录等，我侧重讲日志的处理，因为我觉得这个是相当有必要的。刚开始一直认为日志没有必要处理，也就那么几M的东西，当我查看日志大小的时候我瞠目了，我的日志居然有几百M的级别了，当下就决定对日志进行每天必要的处理操作。
</p>
<p><span id="more-497"></span></p>
<p>
为什么要切割日志？一般Nginx安装好后有些人会打开日志记录有些人会关闭日志记录，打开日志记录的人一般都会把架设在Nginx上的所有网站日志都存在同一个文件里（比如我存在access.log日志文件里），这样日积月累所有网站的访问记录就会把日志文件越积越大，当需要查看日志文件的时候一看就是一大串，不方便查找。现在，如果我把每天的日志文件分割开来用相应的日期标识出来这样就大大方便查找了。（我是建议打开日志记录，日志记录里面存放着很多有用的东西。比如：浏览器名称，可以方便你对网站的排版做出调整；IP地址，如果网站收到攻击，你就可以查到那个IP地址。）
</p>
<p>
下面开始详细步骤：
</p>
<h4>编写shell程序</h4>
<p>某种情况下会设置多个子域名，因此会产生多个日志文件，像我这类喜欢整齐的人会设置多个日志文件，把每个域名的日志都分开放。下面这个shell程序是多域名处理。</p>
<p>
下面是示例，对以下三个网站的日志切割（日志文件名自己命名）：
</p>
<p>
http://www.1991s.com   对应日志  blog.log<br />
http://demo.1991s.com  对应日志  demo.log<br />
http://happy.1991s.com  对应日志  happy.log
</p>
<p>
<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
</pre></td><td class="code"><pre class="shell" style="font-family:monospace;"># !/bin/bash
# 你的日志文件存放目录
logs_path=&quot;/home/logs/&quot;
# 日志文件的名字，多个需要空格隔开
logs_names=(blog demo happy)
&nbsp;
mkdir -p ${logs_path}$(date -d &quot;yesterday&quot; +&quot;%Y&quot;)/$(date -d &quot;yesterday&quot; +&quot;%m&quot;)/
num=${#logs_names[@]}
for((i=0;i&lt;num;i++));do
mv ${logs_path}${logs_names[i]}.log ${logs_path}$(date -d &quot;yesterday&quot; +&quot;%Y&quot;)/$(date -d &quot;yesterday&quot; +&quot;%m&quot;)/${logs_names[i]}_$(date -d &quot;yesterday&quot; +&quot;%Y%m%d&quot;).log
done
&nbsp;
＃pid的位置,自己查找
kill -USR1 `cat /usr/local/nginx/nginx.pid`</pre></td></tr></table></div>

</p>
<h4>设置crontab，每天定时切割</h4>
<p>
首先需要确定你的服务器有没有安装crontab的服务，输入crontab -e命令，有反应就安装了。<br />
如果没有安装，运行yum install vixie-cron 一键安装。
</p>
<p>
输入crontab -e命令，输入下面的内容:<br />
1、00 00意思为00分00点，也就是凌晨0点，后面“ * * * ”为“ 日 月 年 ”无需定义<br />
2、&#8221; /home/logs/cut_nginx_log.sh &#8220;为你的shell的路径。
</p>
<p>
<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="shell" style="font-family:monospace;">00 00 * * * /bin/bash  /home/logs/cut_nginx_log.sh</pre></td></tr></table></div>

</p>
<p>
OK ! 大功告成，每天的0时就会自动完成日志的切割并存在相应的以日期命名的目录中。
</p>
<div class="annotations">
<h5>注解</h5>
<ol>
<li>只在Centos下测试，其他linux环境设置略有不同 .</li>
<li>开启shell程序的775权限，否则可能导致不能运行 .</li>
</ol>
</div>
<p><a href="http://www.podidea.com/2011/03/28/121655/497.html">NGINX日志切割</a> is a post from: <a href="http://www.1991s.com">Eric&#039;s Blog</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.podidea.com/2011/03/28/121655/497.html/feed</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>WordPress fetch_feed 获取 Twitter</title>
		<link>http://www.podidea.com/2011/03/20/233353/453.html</link>
		<comments>http://www.podidea.com/2011/03/20/233353/453.html#comments</comments>
		<pubDate>Sun, 20 Mar 2011 15:33:53 +0000</pubDate>
		<dc:creator>Eric</dc:creator>
				<category><![CDATA[WP Trick]]></category>
		<category><![CDATA[Feed]]></category>
		<category><![CDATA[Fetch]]></category>
		<category><![CDATA[Rss]]></category>
		<category><![CDATA[Twitter]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://www.1991s.com/?p=453</guid>
		<description><![CDATA[前些日子在博客中新增了 Twitter 消息的获取，当我更新、转发Twitter消息时都会随时更新到我的博客。 什么是fetch_feed函数 ？fetch_feed是Wordpress中的一个获取Feed/Rss消息函数，可以获取指定Feed/Rss文件中信息。 可以用在什么地方 ？获取只要有有提供Feed/Rss输出的网站的信息。 有个不好的地方就是需要定时缓存。 参考官方文档：fetch_feed 用法 1 &#60;?php $feed = fetch_feed&#40; $uri &#41;; ?&#62; $uri:想要获取内容的RSS的URI。函数将返回一个标准的SimplePie对象。 示例：获取Twitter消息 1 2 3 4 5 6 &#60;?php $feed = fetch_feed&#40;'http://twitter.com/statuses/user_timeline/username.rss'&#41;;//username是对应你的twitter用户名 $items = $feed-&#62;get_items&#40;0,1&#41;; foreach&#40;$items as $item&#41; &#123; echo $item-&#62;get_description&#40;&#41;;&#125; ?&#62; 以上的步骤只是简单的获取了Twitter消息，当你使用时你会发现这个并不是实时更新，说不定就要等好久才能更新。这时你需要修改WordPress的fetch_feed函数的缓存时间来定时缓存更新Twitter最新内容。 wordpress 的 fetch_feed() 函数，在文件wp-includesclass-feed.php的WP_Feed_Cache_Transient 类中有定义。默认是12小时，如果是这个速度更新，那真是等到黄花菜凉了。 1 2 3 4 class WP_Feed_Cache_Transient &#123; var $name; [...]<p><a href="http://www.podidea.com/2011/03/20/233353/453.html">WordPress fetch_feed 获取 Twitter</a> is a post from: <a href="http://www.1991s.com">Eric&#039;s Blog</a></p>
]]></description>
			<content:encoded><![CDATA[<p>前些日子在博客中新增了 Twitter 消息的获取，当我更新、转发Twitter消息时都会随时更新到我的博客。</p>
<p>
什么是fetch_feed函数 ？fetch_feed是Wordpress中的一个获取Feed/Rss消息函数，可以获取指定Feed/Rss文件中信息。
</p>
<p>可以用在什么地方 ？获取只要有有提供Feed/Rss输出的网站的信息。</p>
<p>有个不好的地方就是需要定时缓存。</p>
<p>参考官方文档：<a rel="external" href="http://codex.wordpress.org/Function_Reference/fetch_feed"><strong>fetch_feed</strong></a></p>
<p><span id="more-453"></span></p>
<h4>用法</h4>
<p>
<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #000088;">$feed</span> <span style="color: #339933;">=</span> fetch_feed<span style="color: #009900;">&#40;</span> <span style="color: #000088;">$uri</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

</p>
<p>$uri:想要获取内容的RSS的URI。函数将返回一个标准的SimplePie对象。</p>
<h4>示例：获取Twitter消息</h4>
<p>
<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #000088;">$feed</span> <span style="color: #339933;">=</span> fetch_feed<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'http://twitter.com/statuses/user_timeline/username.rss'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><span style="color: #666666; font-style: italic;">//username是对应你的twitter用户名</span>
<span style="color: #000088;">$items</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$feed</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">get_items</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">foreach</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$items</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$item</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
<span style="color: #b1b100;">echo</span> <span style="color: #000088;">$item</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">get_description</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><span style="color: #009900;">&#125;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

</p>
<p>以上的步骤只是简单的获取了Twitter消息，当你使用时你会发现这个并不是实时更新，说不定就要等好久才能更新。这时你需要修改WordPress的fetch_feed函数的缓存时间来定时缓存更新Twitter最新内容。</p>
<p>
wordpress 的 fetch_feed() 函数，在文件wp-includesclass-feed.php的WP_Feed_Cache_Transient 类中有定义。默认是12小时，如果是这个速度更新，那真是等到黄花菜凉了。
</p>
<p>
<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">    <span style="color: #000000; font-weight: bold;">class</span> WP_Feed_Cache_Transient <span style="color: #009900;">&#123;</span>
    <span style="color: #000000; font-weight: bold;">var</span> <span style="color: #000088;">$name</span><span style="color: #339933;">;</span>
    <span style="color: #000000; font-weight: bold;">var</span> <span style="color: #000088;">$mod_name</span><span style="color: #339933;">;</span>
    <span style="color: #000000; font-weight: bold;">var</span> <span style="color: #000088;">$lifetime</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">43200</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//Default lifetime in cache of 12 hours</span></pre></td></tr></table></div>

</p>
<p>因此需要修改缓存的时间，笨的办法是直接把lifetime的值修改成你需要的，但是这样一来下次更新Wordpress版本的话又需要修改这个值，当前我们只想在获取Twitter消息的时候达到快速缓存的目的。于是重新定义fetch_feed() 函数的更新频率在特殊使用的时候，这样即可自定义更新频率，想要实时更新就实时更新。</p>
<h4>优化后：获取Twitter消息</h4>
<p>
<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #b1b100;">require_once</span> <span style="color: #009900;">&#40;</span>ABSPATH <span style="color: #339933;">.</span> WPINC <span style="color: #339933;">.</span> <span style="color: #0000ff;">'/class-feed.php'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$feed</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> SimplePie<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$feed</span> <span style="color: #339933;">=</span> fetch_feed<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'http://twitter.com/statuses/user_timeline/username.rss'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><span style="color: #666666; font-style: italic;">//username是对应你的twitter用户名</span>
<span style="color: #000088;">$feed</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">set_file_class</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'WP_SimplePie_File'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$feed</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">set_cache_duration</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">10</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//设置缓存时间(10秒),这个各有所好</span>
<span style="color: #000088;">$feed</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">set_cache_location</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_SERVER</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'DOCUMENT_ROOT'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'/cache/'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//缓存的目录</span>
<span style="color: #000088;">$feed</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">init</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$feed</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">handle_content_type</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$items</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$feed</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">get_items</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//定义显示几条</span>
<span style="color: #b1b100;">foreach</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$items</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$item</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
<span style="color: #b1b100;">echo</span> <span style="color: #000088;">$item</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">get_description</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

</p>
<h4>缓存机制：</h4>
<p>
SimplePie检查该feed是否已经缓存：<br />
1、如果该feed已经缓存，并且没有过期的话，就使用缓存的feed<br />
2、如果该feed没有缓存，SimplePie就抓取该feed并缓存下来<br />
3、如果该feed已经缓存，但是已经过期（比如上例中已经超过设置的20分钟），SimplePie就使用HTTPCG技术向feed源发送请求，询问是否有更新：如果有更新，就使用新内容并重新缓存；如果没有更新就使用缓存的内容并重新设置缓存过期时间。
</p>
<div class="annotations">
<h5>注解</h5>
<ol>
<li>缓存目录开启777权限，不然会出现错误提示 .</li>
<li>只适用于国外的主机获取，国内主机可以使用这个地址:http://zvproxy.appspot.com/twitter.com/statuses/user_timeline/username.rss .</li>
</ol>
</div>
<p><a href="http://www.podidea.com/2011/03/20/233353/453.html">WordPress fetch_feed 获取 Twitter</a> is a post from: <a href="http://www.1991s.com">Eric&#039;s Blog</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.podidea.com/2011/03/20/233353/453.html/feed</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>插件 WP-RelativeDate</title>
		<link>http://www.podidea.com/2011/03/07/183809/416.html</link>
		<comments>http://www.podidea.com/2011/03/07/183809/416.html#comments</comments>
		<pubDate>Mon, 07 Mar 2011 10:38:09 +0000</pubDate>
		<dc:creator>Eric</dc:creator>
				<category><![CDATA[WP Plugin]]></category>
		<category><![CDATA[Plugin]]></category>
		<category><![CDATA[RelativeDate]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://www.1991s.com/?p=416</guid>
		<description><![CDATA[WP-RelativeDate是Lester Chan在WP-PostViews、WP-PostRatings、WP-PageNavi等插件后的又一个杰作，这个插件主要是对评论时间显示上做了处理，当你刚发表评论或者文章后不是像以前一样单调的显示 February 28th, 2011 at 17:56 这样的时间，当你装完这个插件后，对代码进行相应的处理就会在评论时间和后台评论管理中显示类似这样的效果：( 1 seconds ago)、( 1 weeks ago )、Today at 18:00 ( 2 seconds ago )。 安装 你可以进入Lester Chan网站的Plugin页面下载，或者进入Wordpress的插件网站下载，也可以在Wordpress后台搜索wp-relativedate进行安装。 安装完成后不需要任何设置，时间就会自动显示在评论里面。 可能会遇到的问题 1、为什么会显示两个时间 ：“2011/03/05 (2 days ago) at 21:36 (2 days ago) ” 和 &#8221; Today at Today &#8220; 这个问题可能是你显示时间的代码没有处理好，可以试着把Wordpress默认主题中的时间显示代码拷贝过来，或者可以使用Lester Chan 在插件论坛给出的代码。 1 &#60;?php comment_date&#40;'jS F Y'&#41; ?&#62; at &#60;?php [...]<p><a href="http://www.podidea.com/2011/03/07/183809/416.html">插件 WP-RelativeDate</a> is a post from: <a href="http://www.1991s.com">Eric&#039;s Blog</a></p>
]]></description>
			<content:encoded><![CDATA[<p><img class="sided" src="http://img.podidea.com/img/archives/2011/03/WP-RelativeDate.jpg" alt="WP-RelativeDate" title="WP-RelativeDate"  /></p>
<p>
<a rel="external" href="http://lesterchan.net/portfolio/programming/php/#wp-relativedate" ><strong>WP-RelativeDate</strong></a>是Lester Chan在<a rel="external" href="http://lesterchan.net/portfolio/programming/php/#wp-postviews" >WP-PostViews</a>、<a rel="external" href="http://lesterchan.net/portfolio/programming/php/#wp-postratings" >WP-PostRatings</a>、<a rel="external" href="http://lesterchan.net/portfolio/programming/php/#wp-pagenavi" >WP-PageNavi</a>等插件后的又一个杰作，这个插件主要是对评论时间显示上做了处理，当你刚发表评论或者文章后不是像以前一样单调的显示 February 28th, 2011 at 17:56 这样的时间，当你装完这个插件后，对代码进行相应的处理就会在评论时间和后台评论管理中显示类似这样的效果：( 1 seconds ago)、( 1 weeks ago )、Today at 18:00 ( 2 seconds ago )。
</p>
<p><span id="more-416"></span></p>
<p>
<h4>安装</h4>
</p>
<p>你可以进入Lester Chan网站的Plugin页面下载，或者进入Wordpress的插件网站下载，也可以在Wordpress后台搜索wp-relativedate进行安装。</p>
<p>安装完成后不需要任何设置，时间就会自动显示在评论里面。</p>
<p>
<h4>可能会遇到的问题</h4>
</p>
<p><strong>1、</strong>为什么会显示两个时间 ：“2011/03/05 (2 days ago) at 21:36 (2 days ago) ” 和 &#8221; Today at Today &#8220;</p>
<p>这个问题可能是你显示时间的代码没有处理好，可以试着把Wordpress默认主题中的时间显示代码拷贝过来，或者可以使用Lester Chan 在插件论坛给出的代码。</p>
<p>
<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span> comment_date<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'jS F Y'</span><span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span> at <span style="color: #000000; font-weight: bold;">&lt;?php</span> comment_time<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

</p>
<p>或者你可以试试以下这个代码，这个代码是我主题的代码，我在Lester Chan插件论坛也看到有人通过这个代码解决问题，使用这个代码以后时间显示的效果就和我的博客的效果一样了。</p>
<p>
<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #990000;">printf</span><span style="color: #009900;">&#40;</span>__<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'%1$s at %2$s'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> get_comment_date<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'jS F Y'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>  get_comment_time<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

</p>
<p><strong>2、</strong>关于控制板中评论管理显示时间的问题，Lester Chan也没有很好的办法，它在回答一个使用者提问是建议把后台评论中显示错误给隐藏掉，你可以使用以下操作。</p>
<p>打开插件目录编辑wp-relativedate.php文件，找到以下代码：</p>
<p>
<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">function</span> relative_comment_date<span style="color: #009900;">&#40;</span><span style="color: #000088;">$current_dateformat</span><span style="color: #339933;">,</span> <span style="color: #000088;">$display_ago_only</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span></pre></td></tr></table></div>

</p>
<p>在这个代码下面加入一个if语句</p>
<p>
<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span>is_admin<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #b1b100;">return</span><span style="color: #339933;">;</span> <span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

</p>
<p>我没有测试过这个代码可不可以使用，大家可以试试，至今没发现Lester Chan给出插件升级，所有我觉得这个可行。</p>
<p><strong>3、</strong>我只想在评论中显示，不想在文章和页面中显示。</p>
<p>打开插件目录编辑wp-relativedate.php文件，找到以下代码：</p>
<p>
<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">### Function: Display Post Relative Time (Seconds Ago/Minutes Ago/Hours Ago)</span></pre></td></tr></table></div>

</p>
<p>把这段代码咔嚓掉或者注释掉。</p>
<p>
<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">### Function: Display Post Relative Time (Seconds Ago/Minutes Ago/Hours Ago)
</span><span style="color: #666666; font-style: italic;">/*
add_filter('the_time', 'relative_post_time', 999);
function relative_post_time($current_timeformat, $display_ago_only = 0) {
  global $post;
	$current_time = current_time('timestamp');
	$date_today_time = gmdate('j-n-Y H:i:s', $current_time);
	$post_date_time = mysql2date('j-n-Y H:i:s', $post-&gt;post_date, false);
	$date_today = gmdate('j-n-Y', $current_time);
	$post_date = mysql2date('j-n-Y', $post-&gt;post_date, false);
	$time_diff = (strtotime($date_today_time) - strtotime($post_date_time));
	$format_ago = '';
	if($post_date == $date_today) {
		if($time_diff &lt; 60) {
			$format_ago = sprintf(_n('%s second ago', '%s seconds ago', $time_diff, 'wp-relativedate'), number_format_i18n($time_diff));
		} elseif ($time_diff &lt; 3600) {
			$format_ago = sprintf(_n('%s minute ago', '%s minutes ago', intval($time_diff/60), 'wp-relativedate'), number_format_i18n(intval($time_diff/60)));
		} elseif ($time_diff &lt; 86400) {
			$format_ago = sprintf(_n('%s hour ago', '%s hours ago', intval($time_diff/3600), 'wp-relativedate'), number_format_i18n(intval($time_diff/3600)));
		}
		if($display_ago_only) {
			return $format_ago;
		} else {
			return $current_timeformat.' ('.$format_ago.')';
		}
	} else {
		return $current_timeformat;
	}
}
*/</span></pre></td></tr></table></div>

</p>
<div class="annotations">
<h5>注解</h5>
<ol>
<li>这个插件最多只能显示一个月的时间 .</li>
<li>可能会于某些插件冲突导致不能激活 .</li>
<li>可能有些老版本Wordpress中会有问题 .</li>
<li>一些主题主题中不能显示，你可以读下插件中的readme.html .</li>
<li>更多问题可以到他关于这个插件的论坛提出 .</li>
<li>此插件论坛地址：<a rel="external" href="http://forums.lesterchan.net/index.php/board,19.0.html" >http://forums.lesterchan.net/index.php/board,19.0.html</a> .</li>
</ol>
</div>
<p><a href="http://www.podidea.com/2011/03/07/183809/416.html">插件 WP-RelativeDate</a> is a post from: <a href="http://www.1991s.com">Eric&#039;s Blog</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.podidea.com/2011/03/07/183809/416.html/feed</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>翻墙发推特</title>
		<link>http://www.podidea.com/2011/03/06/222124/396.html</link>
		<comments>http://www.podidea.com/2011/03/06/222124/396.html#comments</comments>
		<pubDate>Sun, 06 Mar 2011 14:21:24 +0000</pubDate>
		<dc:creator>Eric</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[PPTPD]]></category>
		<category><![CDATA[Tool]]></category>
		<category><![CDATA[Vpn]]></category>
		<category><![CDATA[VPS]]></category>

		<guid isPermaLink="false">http://www.1991s.com/?p=396</guid>
		<description><![CDATA[刚在自己的一台Centos系统的VPS上装了PPTPD VPN，我买的VPS速度还可以，使用PPTPD代理开网站速度可以说是秒开，没以前花钱买的VPN那么卡，可能人品好了。 用这个一键安装命令，等待数分钟后就可以安装完成。注意：安装完后会给出两个帐号和密码，不要可以翻墙了太高兴了没把帐号密码记下来。 我测试的环境为Centos 32bit的，其他环境没测试过，大家自己试试看。 1 wget http://www.CTOHome.com/linux-vps-pack/vpn-pptpd.sh;sh ./vpn-pptpd.sh; 开始使用 每个系统的使用方式都是不同的，你用win系统的可以看看这个设置方式： http://www.ctohome.com/FuWuQi/92/273.html 如果你是使用Mac系统的你就请教我吧！上图太麻烦了，还要处理下图片，所以Mac下不会用的留言。 全部设置完成连接，接下来的时间你就可以随心所欲的发推，进Youtube看视频，进Facebook于好友互动～have fun . 注解 如果你的VPS架设有网站，可能会影响到速度（用的人多的情况下）. 新增更多VPN用户：Linux运行 vi /etc/ppp/chap-secrets . 删除PPTPD VPN ：yum remove pptpd . 翻墙发推特 is a post from: Eric&#039;s Blog<p><a href="http://www.podidea.com/2011/03/06/222124/396.html">翻墙发推特</a> is a post from: <a href="http://www.1991s.com">Eric&#039;s Blog</a></p>
]]></description>
			<content:encoded><![CDATA[<p>刚在自己的一台Centos系统的VPS上装了<strong>PPTPD VPN</strong>，我买的VPS速度还可以，使用PPTPD代理开网站速度可以说是秒开，没以前花钱买的VPN那么卡，可能人品好了。</p>
<p>用这个一键安装命令，等待数分钟后就可以安装完成。注意：安装完后会给出两个帐号和密码，不要可以翻墙了太高兴了没把帐号密码记下来。</p>
<p>我测试的环境为Centos 32bit的，其他环境没测试过，大家自己试试看。</p>
<p><span id="more-396"></span></p>
<p>
<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">wget http<span style="color: #339933;">:</span><span style="color: #666666; font-style: italic;">//www.CTOHome.com/linux-vps-pack/vpn-pptpd.sh;sh ./vpn-pptpd.sh;</span></pre></td></tr></table></div>

</p>
<p>
<h4>开始使用</h4>
</p>
<p>每个系统的使用方式都是不同的，你用win系统的可以看看这个设置方式：</p>
<p><a rel="external"  href="http://www.ctohome.com/FuWuQi/92/273.html" >http://www.ctohome.com/FuWuQi/92/273.html</a>
</p>
<p>如果你是使用Mac系统的你就请教我吧！上图太麻烦了，还要处理下图片，所以Mac下不会用的留言。</p>
<p>全部设置完成连接，接下来的时间你就可以随心所欲的发推，进Youtube看视频，进Facebook于好友互动～have fun .</p>
<div class="annotations">
<h5>注解</h5>
<ol>
<li>如果你的VPS架设有网站，可能会影响到速度（用的人多的情况下）.</li>
<li>新增更多VPN用户：Linux运行 vi  /etc/ppp/chap-secrets .</li>
<li>删除PPTPD VPN ：yum remove pptpd .</li>
</ol>
</div>
<p><a href="http://www.podidea.com/2011/03/06/222124/396.html">翻墙发推特</a> is a post from: <a href="http://www.1991s.com">Eric&#039;s Blog</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.podidea.com/2011/03/06/222124/396.html/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>添加分享按钮</title>
		<link>http://www.podidea.com/2011/02/28/144029/337.html</link>
		<comments>http://www.podidea.com/2011/02/28/144029/337.html#comments</comments>
		<pubDate>Mon, 28 Feb 2011 06:40:29 +0000</pubDate>
		<dc:creator>Eric</dc:creator>
				<category><![CDATA[WP Trick]]></category>
		<category><![CDATA[Blog]]></category>
		<category><![CDATA[Share]]></category>
		<category><![CDATA[SNS]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://www.1991s.com/?p=337</guid>
		<description><![CDATA[为你的网站添加一个share按钮，为你的博客引入更多的流量，像addthis这种提供分享服务网站很多，但是太杂了，我的是基于mg12的升级版本。加入了腾讯校友和空间，因为我发现使用腾讯产品的人确实很多，不想失去白白的这么多流量。 HTML 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 &#60;!--顶部--&#62; &#60;div id=&#34;share-top&#34; class=&#34;share&#34;&#62; &#60;strong&#62;Share on:&#60;/strong&#62; &#60;a rel=&#34;nofollow&#34; class=&#34;facebook-share&#34; title=&#34;Facebook&#34;&#62;Facebook&#60;/a&#62; &#60;a rel=&#34;nofollow&#34; class=&#34;twitter-share&#34; title=&#34;Twitter&#34;&#62;Twitter&#60;/a&#62; &#60;a rel=&#34;nofollow&#34; class=&#34;delicious-share&#34; title=&#34;Delicious&#34;&#62;Delicious&#60;/a&#62; &#60;a rel=&#34;nofollow&#34; class=&#34;kaixin001-share&#34; title=&#34;开心网&#34;&#62;开心网&#60;/a&#62; &#60;a rel=&#34;nofollow&#34; class=&#34;renren-share&#34; title=&#34;人人网&#34;&#62;人人网&#60;/a&#62; &#60;a rel=&#34;nofollow&#34; class=&#34;douban-share&#34; title=&#34;豆瓣&#34;&#62;豆瓣&#60;/a&#62; &#60;a rel=&#34;nofollow&#34; class=&#34;fanfou-share&#34; title=&#34;饭否&#34;&#62;饭否&#60;/a&#62; &#60;a rel=&#34;nofollow&#34; [...]<p><a href="http://www.podidea.com/2011/02/28/144029/337.html">添加分享按钮</a> is a post from: <a href="http://www.1991s.com">Eric&#039;s Blog</a></p>
]]></description>
			<content:encoded><![CDATA[<p>为你的网站添加一个share按钮，为你的博客引入更多的流量，像addthis这种提供分享服务网站很多，但是太杂了，我的是基于<a rel="external"  href="http://www.neoease.com/add-share-buttons/" >mg12</a>的升级版本。加入了腾讯校友和空间，因为我发现使用腾讯产品的人确实很多，不想失去白白的这么多流量。</p>
<p><img class="sided" title="share button" src="http://img.podidea.com/img/archives/2011/02/share.jpg" alt="share button" width="430" height="53" /></p>
<p><span id="more-337"></span></p>
<p>
<h4>HTML</h4>
</p>
<p>
<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #339933;">&lt;!--</span>顶部<span style="color: #339933;">--&gt;</span>
<span style="color: #339933;">&lt;</span>div id<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;share-top&quot;</span> <span style="color: #000000; font-weight: bold;">class</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;share&quot;</span><span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>strong<span style="color: #339933;">&gt;</span>Share on<span style="color: #339933;">:&lt;/</span>strong<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>a rel<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;nofollow&quot;</span> <span style="color: #000000; font-weight: bold;">class</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;facebook-share&quot;</span> title<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;Facebook&quot;</span><span style="color: #339933;">&gt;</span>Facebook<span style="color: #339933;">&lt;/</span>a<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>a rel<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;nofollow&quot;</span> <span style="color: #000000; font-weight: bold;">class</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;twitter-share&quot;</span> title<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;Twitter&quot;</span><span style="color: #339933;">&gt;</span>Twitter<span style="color: #339933;">&lt;/</span>a<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>a rel<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;nofollow&quot;</span> <span style="color: #000000; font-weight: bold;">class</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;delicious-share&quot;</span> title<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;Delicious&quot;</span><span style="color: #339933;">&gt;</span>Delicious<span style="color: #339933;">&lt;/</span>a<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>a rel<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;nofollow&quot;</span> <span style="color: #000000; font-weight: bold;">class</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;kaixin001-share&quot;</span> title<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;开心网&quot;</span><span style="color: #339933;">&gt;</span>开心网<span style="color: #339933;">&lt;/</span>a<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>a rel<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;nofollow&quot;</span> <span style="color: #000000; font-weight: bold;">class</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;renren-share&quot;</span> title<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;人人网&quot;</span><span style="color: #339933;">&gt;</span>人人网<span style="color: #339933;">&lt;/</span>a<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>a rel<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;nofollow&quot;</span> <span style="color: #000000; font-weight: bold;">class</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;douban-share&quot;</span> title<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;豆瓣&quot;</span><span style="color: #339933;">&gt;</span>豆瓣<span style="color: #339933;">&lt;/</span>a<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>a rel<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;nofollow&quot;</span> <span style="color: #000000; font-weight: bold;">class</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;fanfou-share&quot;</span> title<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;饭否&quot;</span><span style="color: #339933;">&gt;</span>饭否<span style="color: #339933;">&lt;/</span>a<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>a rel<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;nofollow&quot;</span> <span style="color: #000000; font-weight: bold;">class</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;sina-share&quot;</span> title<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;新浪微博&quot;</span><span style="color: #339933;">&gt;</span>新浪微博<span style="color: #339933;">&lt;/</span>a<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>a rel<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;nofollow&quot;</span> <span style="color: #000000; font-weight: bold;">class</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;netease-share&quot;</span> title<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;网易微博&quot;</span><span style="color: #339933;">&gt;</span>网易微博<span style="color: #339933;">&lt;/</span>a<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>a rel<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;nofollow&quot;</span> <span style="color: #000000; font-weight: bold;">class</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;tencent-share&quot;</span> title<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;腾讯微博&quot;</span><span style="color: #339933;">&gt;</span>腾讯微博<span style="color: #339933;">&lt;/</span>a<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>a rel<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;nofollow&quot;</span> <span style="color: #000000; font-weight: bold;">class</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;sohu-share&quot;</span> title<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;搜狐微博&quot;</span><span style="color: #339933;">&gt;</span>搜狐微博<span style="color: #339933;">&lt;/</span>a<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>a rel<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;nofollow&quot;</span> <span style="color: #000000; font-weight: bold;">class</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;qzone-share&quot;</span> title<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;QQ空间&quot;</span><span style="color: #339933;">&gt;</span>QQ空间<span style="color: #339933;">&lt;/</span>a<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>a rel<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;nofollow&quot;</span> <span style="color: #000000; font-weight: bold;">class</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;pengyou-share&quot;</span> title<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;腾讯朋友&quot;</span><span style="color: #339933;">&gt;</span>腾讯朋友<span style="color: #339933;">&lt;/</span>a<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;/</span>div<span style="color: #339933;">&gt;</span></pre></td></tr></table></div>

</p>
<p>
<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #339933;">&lt;!--</span>底部<span style="color: #339933;">--&gt;</span>
<span style="color: #339933;">&lt;</span>div id<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;share-bottom&quot;</span> <span style="color: #000000; font-weight: bold;">class</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;share&quot;</span><span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>strong<span style="color: #339933;">&gt;</span>Share on<span style="color: #339933;">:&lt;/</span>strong<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>a rel<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;nofollow&quot;</span> <span style="color: #000000; font-weight: bold;">class</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;facebook-share&quot;</span> title<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;Facebook&quot;</span><span style="color: #339933;">&gt;</span>Facebook<span style="color: #339933;">&lt;/</span>a<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>a rel<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;nofollow&quot;</span> <span style="color: #000000; font-weight: bold;">class</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;twitter-share&quot;</span> title<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;Twitter&quot;</span><span style="color: #339933;">&gt;</span>Twitter<span style="color: #339933;">&lt;/</span>a<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>a rel<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;nofollow&quot;</span> <span style="color: #000000; font-weight: bold;">class</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;delicious-share&quot;</span> title<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;Delicious&quot;</span><span style="color: #339933;">&gt;</span>Delicious<span style="color: #339933;">&lt;/</span>a<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>a rel<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;nofollow&quot;</span> <span style="color: #000000; font-weight: bold;">class</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;kaixin001-share&quot;</span> title<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;开心网&quot;</span><span style="color: #339933;">&gt;</span>开心网<span style="color: #339933;">&lt;/</span>a<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>a rel<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;nofollow&quot;</span> <span style="color: #000000; font-weight: bold;">class</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;renren-share&quot;</span> title<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;人人网&quot;</span><span style="color: #339933;">&gt;</span>人人网<span style="color: #339933;">&lt;/</span>a<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>a rel<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;nofollow&quot;</span> <span style="color: #000000; font-weight: bold;">class</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;douban-share&quot;</span> title<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;豆瓣&quot;</span><span style="color: #339933;">&gt;</span>豆瓣<span style="color: #339933;">&lt;/</span>a<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>a rel<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;nofollow&quot;</span> <span style="color: #000000; font-weight: bold;">class</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;fanfou-share&quot;</span> title<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;饭否&quot;</span><span style="color: #339933;">&gt;</span>饭否<span style="color: #339933;">&lt;/</span>a<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>a rel<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;nofollow&quot;</span> <span style="color: #000000; font-weight: bold;">class</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;sina-share&quot;</span> title<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;新浪微博&quot;</span><span style="color: #339933;">&gt;</span>新浪微博<span style="color: #339933;">&lt;/</span>a<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>a rel<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;nofollow&quot;</span> <span style="color: #000000; font-weight: bold;">class</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;netease-share&quot;</span> title<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;网易微博&quot;</span><span style="color: #339933;">&gt;</span>网易微博<span style="color: #339933;">&lt;/</span>a<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>a rel<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;nofollow&quot;</span> <span style="color: #000000; font-weight: bold;">class</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;tencent-share&quot;</span> title<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;腾讯微博&quot;</span><span style="color: #339933;">&gt;</span>腾讯微博<span style="color: #339933;">&lt;/</span>a<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>a rel<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;nofollow&quot;</span> <span style="color: #000000; font-weight: bold;">class</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;sohu-share&quot;</span> title<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;搜狐微博&quot;</span><span style="color: #339933;">&gt;</span>搜狐微博<span style="color: #339933;">&lt;/</span>a<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>a rel<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;nofollow&quot;</span> <span style="color: #000000; font-weight: bold;">class</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;qzone-share&quot;</span> title<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;QQ空间&quot;</span><span style="color: #339933;">&gt;</span>QQ空间<span style="color: #339933;">&lt;/</span>a<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>a rel<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;nofollow&quot;</span> <span style="color: #000000; font-weight: bold;">class</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;pengyou-share&quot;</span> title<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;腾讯朋友&quot;</span><span style="color: #339933;">&gt;</span>腾讯朋友<span style="color: #339933;">&lt;/</span>a<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;/</span>div<span style="color: #339933;">&gt;</span></pre></td></tr></table></div>

</p>
<p>
<h4>CSS</h4>
</p>
<p>
<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
</pre></td><td class="code"><pre class="css" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">/* Share icon START*/</span>
<span style="color: #6666ff;">.share</span><span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span><span style="color: #933;">16px</span><span style="color: #00AA00;">;</span>font-<span style="color: #000000; font-weight: bold;">size</span><span style="color: #00AA00;">:</span><span style="color: #933;">90%</span><span style="color: #00AA00;">;</span>padding<span style="color: #00AA00;">:</span><span style="color: #933;">8px</span> <span style="color: #933;">10px</span><span style="color: #00AA00;">;</span>background<span style="color: #00AA00;">:</span><span style="color: #cc00cc;">#F5F5F5</span><span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.share</span><span style="color: #00AA00;">,</span><span style="color: #6666ff;">.share</span> a<span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">line-height</span><span style="color: #00AA00;">:</span><span style="color: #933;">16px</span><span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.share</span> a<span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">display</span><span style="color: #00AA00;">:</span>inline-<span style="color: #993333;">block</span><span style="color: #00AA00;">;</span>width<span style="color: #00AA00;">:</span><span style="color: #933;">16px</span><span style="color: #00AA00;">;</span>height<span style="color: #00AA00;">:</span><span style="color: #933;">16px</span><span style="color: #00AA00;">;</span>text-indent<span style="color: #00AA00;">:</span><span style="color: #933;">-999em</span><span style="color: #00AA00;">;</span>cursor<span style="color: #00AA00;">:</span><span style="color: #993333;">pointer</span><span style="color: #00AA00;">;</span>margin-<span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">:</span><span style="color: #933;">8px</span><span style="color: #00AA00;">;</span>background<span style="color: #00AA00;">:</span><span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000; font-style: italic;">img/shares.png</span><span style="color: #00AA00;">&#41;</span> <span style="color: #993333;">no-repeat</span><span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.share</span> a<span style="color: #6666ff;">.facebook-share</span><span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">background-position</span><span style="color: #00AA00;">:</span><span style="color: #cc66cc;">0</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.share</span> a<span style="color: #6666ff;">.twitter-share</span><span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">background-position</span><span style="color: #00AA00;">:</span><span style="color: #cc66cc;">0</span> <span style="color: #933;">-16px</span><span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.share</span> a<span style="color: #6666ff;">.delicious-share</span><span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">background-position</span><span style="color: #00AA00;">:</span><span style="color: #cc66cc;">0</span> <span style="color: #933;">-32px</span><span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.share</span> a<span style="color: #6666ff;">.kaixin001-share</span><span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">background-position</span><span style="color: #00AA00;">:</span><span style="color: #cc66cc;">0</span> <span style="color: #933;">-48px</span><span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.share</span> a<span style="color: #6666ff;">.renren-share</span><span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">background-position</span><span style="color: #00AA00;">:</span><span style="color: #cc66cc;">0</span> <span style="color: #933;">-64px</span><span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.share</span> a<span style="color: #6666ff;">.douban-share</span><span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">background-position</span><span style="color: #00AA00;">:</span><span style="color: #cc66cc;">0</span> <span style="color: #933;">-80px</span><span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.share</span> a<span style="color: #6666ff;">.fanfou-share</span><span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">background-position</span><span style="color: #00AA00;">:</span><span style="color: #cc66cc;">0</span> <span style="color: #933;">-96px</span><span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.share</span> a<span style="color: #6666ff;">.sina-share</span><span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">background-position</span><span style="color: #00AA00;">:</span><span style="color: #cc66cc;">0</span> <span style="color: #933;">-112px</span><span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.share</span> a<span style="color: #6666ff;">.netease-share</span><span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">background-position</span><span style="color: #00AA00;">:</span><span style="color: #cc66cc;">0</span> <span style="color: #933;">-128px</span><span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.share</span> a<span style="color: #6666ff;">.tencent-share</span><span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">background-position</span><span style="color: #00AA00;">:</span><span style="color: #cc66cc;">0</span> <span style="color: #933;">-144px</span><span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.share</span> a<span style="color: #6666ff;">.sohu-share</span><span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">background-position</span><span style="color: #00AA00;">:</span><span style="color: #cc66cc;">0</span> <span style="color: #933;">-160px</span><span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.share</span> a<span style="color: #6666ff;">.qzone-share</span><span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">background-position</span><span style="color: #00AA00;">:</span><span style="color: #cc66cc;">0</span> <span style="color: #933;">-176px</span><span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.share</span> a<span style="color: #6666ff;">.pengyou-share</span><span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">background-position</span><span style="color: #00AA00;">:</span><span style="color: #cc66cc;">0</span> <span style="color: #933;">-192px</span><span style="color: #00AA00;">&#125;</span>
<span style="color: #cc00cc;">#share-</span><span style="color: #000000; font-weight: bold;">top</span><span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">margin-top</span><span style="color: #00AA00;">:</span><span style="color: #933;">10px</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span>
<span style="color: #cc00cc;">#share-</span><span style="color: #000000; font-weight: bold;">bottom</span><span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">margin</span><span style="color: #00AA00;">:</span><span style="color: #933;">20px</span> <span style="color: #cc66cc;">0</span> <span style="color: #933;">10px</span><span style="color: #00AA00;">&#125;</span>
<span style="color: #808080; font-style: italic;">/* Share icon END*/</span></pre></td></tr></table></div>

</p>
<p>
<h4>jQuery</h4>
</p>
<p>喜欢javascript的可以去mg12网站看他给出的代码自己修改下。</p>
<p>
<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
</pre></td><td class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">function</span> getParamsOfShareWindow<span style="color: #009900;">&#40;</span>width<span style="color: #339933;">,</span> height<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #000066; font-weight: bold;">return</span> <span style="color: #009900;">&#91;</span><span style="color: #3366CC;">'toolbar=0,status=0,resizable=1,width='</span> <span style="color: #339933;">+</span> width <span style="color: #339933;">+</span> <span style="color: #3366CC;">',height='</span> <span style="color: #339933;">+</span> height <span style="color: #339933;">+</span> <span style="color: #3366CC;">',left='</span><span style="color: #339933;">,</span><span style="color: #009900;">&#40;</span>screen.<span style="color: #660066;">width</span><span style="color: #339933;">-</span>width<span style="color: #009900;">&#41;</span><span style="color: #339933;">/</span><span style="color: #CC0000;">2</span><span style="color: #339933;">,</span><span style="color: #3366CC;">',top='</span><span style="color: #339933;">,</span><span style="color: #009900;">&#40;</span>screen.<span style="color: #660066;">height</span><span style="color: #339933;">-</span>height<span style="color: #009900;">&#41;</span><span style="color: #339933;">/</span><span style="color: #CC0000;">2</span><span style="color: #009900;">&#93;</span>.<span style="color: #660066;">join</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">''</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #003366; font-weight: bold;">function</span> bindShareList<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #003366; font-weight: bold;">var</span> link <span style="color: #339933;">=</span> encodeURIComponent<span style="color: #009900;">&#40;</span>document.<span style="color: #660066;">location</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #006600; font-style: italic;">// 文章链接</span>
	<span style="color: #003366; font-weight: bold;">var</span> title <span style="color: #339933;">=</span> encodeURIComponent<span style="color: #009900;">&#40;</span>document.<span style="color: #660066;">title</span>.<span style="color: #660066;">substring</span><span style="color: #009900;">&#40;</span><span style="color: #CC0000;">0</span><span style="color: #339933;">,</span><span style="color: #CC0000;">76</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #006600; font-style: italic;">// 文章标题</span>
	<span style="color: #003366; font-weight: bold;">var</span> source <span style="color: #339933;">=</span> encodeURIComponent<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'网站名称'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #006600; font-style: italic;">// 网站名称</span>
	<span style="color: #003366; font-weight: bold;">var</span> windowName <span style="color: #339933;">=</span> <span style="color: #3366CC;">'share'</span><span style="color: #339933;">;</span> <span style="color: #006600; font-style: italic;">// 子窗口别称</span>
	<span style="color: #003366; font-weight: bold;">var</span> site <span style="color: #339933;">=</span> <span style="color: #3366CC;">'http://www.youweburl.com/'</span><span style="color: #339933;">;</span> <span style="color: #006600; font-style: italic;">// 网站链接</span>
&nbsp;
	jQuery<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'.facebook-share'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">click</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #003366; font-weight: bold;">var</span> url <span style="color: #339933;">=</span> <span style="color: #3366CC;">'http://facebook.com/share.php?u='</span> <span style="color: #339933;">+</span> link <span style="color: #339933;">+</span> <span style="color: #3366CC;">'&amp;t='</span> <span style="color: #339933;">+</span> title<span style="color: #339933;">;</span>
		<span style="color: #003366; font-weight: bold;">var</span> params <span style="color: #339933;">=</span> getParamsOfShareWindow<span style="color: #009900;">&#40;</span><span style="color: #CC0000;">626</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">436</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		window.<span style="color: #000066;">open</span><span style="color: #009900;">&#40;</span>url<span style="color: #339933;">,</span> windowName<span style="color: #339933;">,</span> params<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	jQuery<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'.twitter-share'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">click</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #003366; font-weight: bold;">var</span> url <span style="color: #339933;">=</span> <span style="color: #3366CC;">'http://twitter.com/share?url='</span> <span style="color: #339933;">+</span> link <span style="color: #339933;">+</span> <span style="color: #3366CC;">'&amp;text='</span> <span style="color: #339933;">+</span> title<span style="color: #339933;">;</span>
		<span style="color: #003366; font-weight: bold;">var</span> params <span style="color: #339933;">=</span> getParamsOfShareWindow<span style="color: #009900;">&#40;</span><span style="color: #CC0000;">500</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">375</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		window.<span style="color: #000066;">open</span><span style="color: #009900;">&#40;</span>url<span style="color: #339933;">,</span> windowName<span style="color: #339933;">,</span> params<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	jQuery<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'.delicious-share'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">click</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #003366; font-weight: bold;">var</span> url <span style="color: #339933;">=</span> <span style="color: #3366CC;">'http://delicious.com/post?url='</span> <span style="color: #339933;">+</span> link <span style="color: #339933;">+</span> <span style="color: #3366CC;">'&amp;title='</span> <span style="color: #339933;">+</span> title<span style="color: #339933;">;</span>
		<span style="color: #003366; font-weight: bold;">var</span> params <span style="color: #339933;">=</span> getParamsOfShareWindow<span style="color: #009900;">&#40;</span><span style="color: #CC0000;">550</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">550</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		window.<span style="color: #000066;">open</span><span style="color: #009900;">&#40;</span>url<span style="color: #339933;">,</span> windowName<span style="color: #339933;">,</span> params<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	jQuery<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'.kaixin001-share'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">click</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #003366; font-weight: bold;">var</span> url <span style="color: #339933;">=</span> <span style="color: #3366CC;">'http://www.kaixin001.com/repaste/share.php?rurl='</span> <span style="color: #339933;">+</span> link <span style="color: #339933;">+</span> <span style="color: #3366CC;">'&amp;rcontent='</span> <span style="color: #339933;">+</span> link <span style="color: #339933;">+</span> <span style="color: #3366CC;">'&amp;rtitle='</span> <span style="color: #339933;">+</span> title<span style="color: #339933;">;</span>
		<span style="color: #003366; font-weight: bold;">var</span> params <span style="color: #339933;">=</span> getParamsOfShareWindow<span style="color: #009900;">&#40;</span><span style="color: #CC0000;">540</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">342</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		window.<span style="color: #000066;">open</span><span style="color: #009900;">&#40;</span>url<span style="color: #339933;">,</span> windowName<span style="color: #339933;">,</span> params<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	jQuery<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'.renren-share'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">click</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #003366; font-weight: bold;">var</span> url <span style="color: #339933;">=</span> <span style="color: #3366CC;">'http://share.renren.com/share/buttonshare?link='</span> <span style="color: #339933;">+</span> link <span style="color: #339933;">+</span> <span style="color: #3366CC;">'&amp;title='</span> <span style="color: #339933;">+</span> title<span style="color: #339933;">;</span>
		<span style="color: #003366; font-weight: bold;">var</span> params <span style="color: #339933;">=</span> getParamsOfShareWindow<span style="color: #009900;">&#40;</span><span style="color: #CC0000;">626</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">436</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		window.<span style="color: #000066;">open</span><span style="color: #009900;">&#40;</span>url<span style="color: #339933;">,</span> windowName<span style="color: #339933;">,</span> params<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	jQuery<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'.douban-share'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">click</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #003366; font-weight: bold;">var</span> url <span style="color: #339933;">=</span> <span style="color: #3366CC;">'http://www.douban.com/recommend/?url='</span> <span style="color: #339933;">+</span> link <span style="color: #339933;">+</span> <span style="color: #3366CC;">'&amp;title='</span> <span style="color: #339933;">+</span> title<span style="color: #339933;">;</span>
		<span style="color: #003366; font-weight: bold;">var</span> params <span style="color: #339933;">=</span> getParamsOfShareWindow<span style="color: #009900;">&#40;</span><span style="color: #CC0000;">450</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">350</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		window.<span style="color: #000066;">open</span><span style="color: #009900;">&#40;</span>url<span style="color: #339933;">,</span> windowName<span style="color: #339933;">,</span> params<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	jQuery<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'.fanfou-share'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">click</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #003366; font-weight: bold;">var</span> url <span style="color: #339933;">=</span> <span style="color: #3366CC;">'http://fanfou.com/sharer'</span><span style="color: #339933;">+</span> <span style="color: #3366CC;">'?u='</span> <span style="color: #339933;">+</span> link <span style="color: #339933;">+</span> <span style="color: #3366CC;">'&amp;t='</span> <span style="color: #339933;">+</span> title<span style="color: #339933;">;</span>
		<span style="color: #003366; font-weight: bold;">var</span> params <span style="color: #339933;">=</span> getParamsOfShareWindow<span style="color: #009900;">&#40;</span><span style="color: #CC0000;">600</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">426</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		window.<span style="color: #000066;">open</span><span style="color: #009900;">&#40;</span>url<span style="color: #339933;">,</span> windowName<span style="color: #339933;">,</span> params<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	jQuery<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'.sina-share'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">click</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #003366; font-weight: bold;">var</span> url <span style="color: #339933;">=</span> <span style="color: #3366CC;">'http://v.t.sina.com.cn/share/share.php?url='</span> <span style="color: #339933;">+</span> link <span style="color: #339933;">+</span> <span style="color: #3366CC;">'&amp;title='</span> <span style="color: #339933;">+</span> title<span style="color: #339933;">;</span>
		<span style="color: #003366; font-weight: bold;">var</span> params <span style="color: #339933;">=</span> getParamsOfShareWindow<span style="color: #009900;">&#40;</span><span style="color: #CC0000;">607</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">523</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		window.<span style="color: #000066;">open</span><span style="color: #009900;">&#40;</span>url<span style="color: #339933;">,</span> windowName<span style="color: #339933;">,</span> params<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	jQuery<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'.netease-share'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">click</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #003366; font-weight: bold;">var</span> url <span style="color: #339933;">=</span> <span style="color: #3366CC;">'http://t.163.com/article/user/checkLogin.do?link='</span> <span style="color: #339933;">+</span> link <span style="color: #339933;">+</span> <span style="color: #3366CC;">'source='</span> <span style="color: #339933;">+</span> source <span style="color: #339933;">+</span> <span style="color: #3366CC;">'&amp;info='</span><span style="color: #339933;">+</span> title <span style="color: #339933;">+</span> <span style="color: #3366CC;">' '</span> <span style="color: #339933;">+</span> link<span style="color: #339933;">;</span>
		<span style="color: #003366; font-weight: bold;">var</span> params <span style="color: #339933;">=</span> getParamsOfShareWindow<span style="color: #009900;">&#40;</span><span style="color: #CC0000;">642</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">468</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		window.<span style="color: #000066;">open</span><span style="color: #009900;">&#40;</span>url<span style="color: #339933;">,</span> windowName<span style="color: #339933;">,</span> params<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	jQuery<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'.tencent-share'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">click</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #003366; font-weight: bold;">var</span> url <span style="color: #339933;">=</span> <span style="color: #3366CC;">'http://v.t.qq.com/share/share.php?title='</span> <span style="color: #339933;">+</span> title <span style="color: #339933;">+</span> <span style="color: #3366CC;">'&amp;url='</span> <span style="color: #339933;">+</span> link <span style="color: #339933;">+</span> <span style="color: #3366CC;">'&amp;site='</span> <span style="color: #339933;">+</span> site<span style="color: #339933;">;</span>
		<span style="color: #003366; font-weight: bold;">var</span> params <span style="color: #339933;">=</span> getParamsOfShareWindow<span style="color: #009900;">&#40;</span><span style="color: #CC0000;">634</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">668</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		window.<span style="color: #000066;">open</span><span style="color: #009900;">&#40;</span>url<span style="color: #339933;">,</span> windowName<span style="color: #339933;">,</span> params<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	jQuery<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'.sohu-share'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">click</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #003366; font-weight: bold;">var</span> url <span style="color: #339933;">=</span> <span style="color: #3366CC;">'http://t.sohu.com/third/post.jsp?&amp;url='</span> <span style="color: #339933;">+</span> link <span style="color: #339933;">+</span> <span style="color: #3366CC;">'&amp;title='</span> <span style="color: #339933;">+</span> title <span style="color: #339933;">+</span> <span style="color: #3366CC;">'&amp;content=utf8'</span><span style="color: #339933;">;</span>
		<span style="color: #003366; font-weight: bold;">var</span> params <span style="color: #339933;">=</span> getParamsOfShareWindow<span style="color: #009900;">&#40;</span><span style="color: #CC0000;">500</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">668</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		window.<span style="color: #000066;">open</span><span style="color: #009900;">&#40;</span>url<span style="color: #339933;">,</span> windowName<span style="color: #339933;">,</span> params<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	jQuery<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'.qzone-share'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">click</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #003366; font-weight: bold;">var</span> url <span style="color: #339933;">=</span> <span style="color: #3366CC;">'http://sns.qzone.qq.com/cgi-bin/qzshare/cgi_qzshare_onekey?url='</span> <span style="color: #339933;">+</span> link<span style="color: #339933;">;</span>
		<span style="color: #003366; font-weight: bold;">var</span> params <span style="color: #339933;">=</span> getParamsOfShareWindow<span style="color: #009900;">&#40;</span><span style="color: #CC0000;">900</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">600</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		window.<span style="color: #000066;">open</span><span style="color: #009900;">&#40;</span>url<span style="color: #339933;">,</span> windowName<span style="color: #339933;">,</span> params<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	jQuery<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'.pengyou-share'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">click</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #003366; font-weight: bold;">var</span> url <span style="color: #339933;">=</span> <span style="color: #3366CC;">'http://sns.qzone.qq.com/cgi-bin/qzshare/cgi_qzshare_onekey?to=pengyou&amp;url='</span> <span style="color: #339933;">+</span> link<span style="color: #339933;">;</span>
		<span style="color: #003366; font-weight: bold;">var</span> params <span style="color: #339933;">=</span> getParamsOfShareWindow<span style="color: #009900;">&#40;</span><span style="color: #CC0000;">930</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">600</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		window.<span style="color: #000066;">open</span><span style="color: #009900;">&#40;</span>url<span style="color: #339933;">,</span> windowName<span style="color: #339933;">,</span> params<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
&nbsp;
<span style="color: #009900;">&#125;</span>
&nbsp;
bindShareList<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

</p>
<p>更多扩展和使用大家自己研究。</p>
<p><a href="http://www.podidea.com/2011/02/28/144029/337.html">添加分享按钮</a> is a post from: <a href="http://www.1991s.com">Eric&#039;s Blog</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.podidea.com/2011/02/28/144029/337.html/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

