<?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>紫禁城 &#187; Web</title>
	<atom:link href="http://zi-jin.com/archives/category/web/feed" rel="self" type="application/rss+xml" />
	<link>http://zi-jin.com</link>
	<description>至尊明帅的博客</description>
	<lastBuildDate>Thu, 19 Apr 2012 05:47:29 +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>WP-Download_Monitor &#8211; 如何新窗口打开下载链接</title>
		<link>http://zi-jin.com/archives/461</link>
		<comments>http://zi-jin.com/archives/461#comments</comments>
		<pubDate>Sat, 20 Aug 2011 16:40:25 +0000</pubDate>
		<dc:creator>至尊明帅</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Web]]></category>

		<guid isPermaLink="false">http://zi-jin.com/?p=461</guid>
		<description><![CDATA[打开 hostname/wp-content/plugins/download-monitor/shortcodes.php 文件，找到 78 79 80 81 if &#40;empty&#40;$format&#41; &#124;&#124; $format=='0'&#41; &#123; $format = '&#60;a class=&#34;downloadlink&#34; href=&#34;{url}&#34; title=&#34;{version,&#34;'.__&#40;&#34;Version&#34;,&#34;wp-download_monitor&#34;&#41;.'&#34;, &#34;&#34;} '.__&#40;&#34;downloaded&#34;,&#34;wp-download_monitor&#34;&#41;.' {hits} '.__&#40;&#34;times&#34;,&#34;wp-download_monitor&#34;&#41;.'&#34; &#62;{title} ({hits})&#60;/a&#62;'; &#160; &#125; 将其修改成： 78 79 80 81 if &#40;empty&#40;$format&#41; &#124;&#124; $format=='0'&#41; &#123; $format = '&#60;a class=&#34;downloadlink&#34; &#8230; <a href="http://zi-jin.com/archives/461">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>打开 hostname/wp-content/plugins/download-monitor/shortcodes.php 文件，找到</p>

<div class="wp_codebox"><table><tr id="p4615"><td class="line_numbers"><pre>78
79
80
81
</pre></td><td class="code" id="p461code5"><pre class="php" style="font-family:monospace;">			<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><a href="http://www.php.net/empty"><span style="color: #990000;">empty</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$format</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">||</span> <span style="color: #000088;">$format</span><span style="color: #339933;">==</span><span style="color: #0000ff;">'0'</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
				<span style="color: #000088;">$format</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'&lt;a class=&quot;downloadlink&quot; href=&quot;{url}&quot; title=&quot;{version,&quot;'</span><span style="color: #339933;">.</span>__<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Version&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;wp-download_monitor&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&quot;, &quot;&quot;} '</span><span style="color: #339933;">.</span>__<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;downloaded&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;wp-download_monitor&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">' {hits} '</span><span style="color: #339933;">.</span>__<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;times&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;wp-download_monitor&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&quot; &gt;{title} ({hits})&lt;/a&gt;'</span><span style="color: #339933;">;</span>	
&nbsp;
			<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>将其修改成：</p>

<div class="wp_codebox"><table><tr id="p4616"><td class="line_numbers"><pre>78
79
80
81
</pre></td><td class="code" id="p461code6"><pre class="php" style="font-family:monospace;">			<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><a href="http://www.php.net/empty"><span style="color: #990000;">empty</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$format</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">||</span> <span style="color: #000088;">$format</span><span style="color: #339933;">==</span><span style="color: #0000ff;">'0'</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
				<span style="color: #000088;">$format</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'&lt;a class=&quot;downloadlink&quot; href=&quot;{url}&quot; target=&quot;_blank&quot; title=&quot;{version,&quot;'</span><span style="color: #339933;">.</span>__<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Version&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;wp-download_monitor&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&quot;, &quot;&quot;} '</span><span style="color: #339933;">.</span>__<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;downloaded&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;wp-download_monitor&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">' {hits} '</span><span style="color: #339933;">.</span>__<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;times&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;wp-download_monitor&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&quot; &gt;{title} ({hits})&lt;/a&gt;'</span><span style="color: #339933;">;</span>	
&nbsp;
			<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>同理，找到：</p>

<div class="wp_codebox"><table><tr id="p4617"><td class="line_numbers"><pre>207
208
209
210
</pre></td><td class="code" id="p461code7"><pre class="php" style="font-family:monospace;">		<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><a href="http://www.php.net/empty"><span style="color: #990000;">empty</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$format</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">||</span> <span style="color: #000088;">$format</span><span style="color: #339933;">==</span><span style="color: #0000ff;">'0'</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			<span style="color: #000088;">$format</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'&lt;a class=&quot;downloadlink&quot; href=&quot;{url}&quot; title=&quot;{version,&quot;'</span><span style="color: #339933;">.</span>__<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Version&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;wp-download_monitor&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&quot;, &quot;&quot;} '</span><span style="color: #339933;">.</span>__<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;downloaded&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;wp-download_monitor&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">' {hits} '</span><span style="color: #339933;">.</span>__<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;times&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;wp-download_monitor&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&quot; &gt;{title} ({hits})&lt;/a&gt;'</span><span style="color: #339933;">;</span>		
&nbsp;
		<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>改成：</p>

<div class="wp_codebox"><table><tr id="p4618"><td class="line_numbers"><pre>207
208
209
210
</pre></td><td class="code" id="p461code8"><pre class="php" style="font-family:monospace;">		<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><a href="http://www.php.net/empty"><span style="color: #990000;">empty</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$format</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">||</span> <span style="color: #000088;">$format</span><span style="color: #339933;">==</span><span style="color: #0000ff;">'0'</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			<span style="color: #000088;">$format</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'&lt;a class=&quot;downloadlink&quot; href=&quot;{url}&quot; target=&quot;_blank&quot; title=&quot;{version,&quot;'</span><span style="color: #339933;">.</span>__<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Version&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;wp-download_monitor&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&quot;, &quot;&quot;} '</span><span style="color: #339933;">.</span>__<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;downloaded&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;wp-download_monitor&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">' {hits} '</span><span style="color: #339933;">.</span>__<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;times&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;wp-download_monitor&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&quot; &gt;{title} ({hits})&lt;/a&gt;'</span><span style="color: #339933;">;</span>		
&nbsp;
		<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://zi-jin.com/archives/461/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>愚人节特献 &#8211; 弹窗老把戏</title>
		<link>http://zi-jin.com/archives/442</link>
		<comments>http://zi-jin.com/archives/442#comments</comments>
		<pubDate>Fri, 01 Apr 2011 10:19:51 +0000</pubDate>
		<dc:creator>至尊明帅</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Web]]></category>

		<guid isPermaLink="false">http://zi-jin.com/?p=442</guid>
		<description><![CDATA[本来以为这种玩意儿已经过时了&#8230; 但&#8230; 废话不多说，马上定制你的个性整人网页吧！ 网页地址：http://zi-jin.com/howfun/ .html 背景图片url: 背景音乐url: 此处输入弹出内容，每行将弹出一个窗口 附老把戏的内容作为参考：(可以直接复制到上面文本框） 终于有人上当的了！ 今日愚人节呀，您不知吗？ 为什么，都不小心哦 没法啦！你都上了，只有陪我了 哈哈！呵呵！嘻嘻！ 我都不想的，都是想开心下 别难过了~~~ 就和我玩玩啦！ 但是玩笑可能开过头了 竟然要您来陪我 哎，真是的！ 不过，不要嬲我的 可是你怎么能回去呢？ 我也没办法 要不。。。 把机子关了吧！ 什么？你不愿意关？ 那怎么办呢？ 让我再想想 对不起，实在没有办法了！ 都是我不好，让你受那么大委屈！ 但是现在你该怎么办呢？ 哎呀！求你了！！别哭好不好？！ 都是我的错，行了吗？ 什么？不行？孬人，快放了我 别这样嘛！ 我给你讲个故事行吗？ 从前有个山 山上有个庙 庙里有个老和尚有个小和尚 老和尚正在给小和尚讲故事 &#8230; <a href="http://zi-jin.com/archives/442">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>本来以为这种玩意儿已经过时了&#8230;</p>
<p>但&#8230;</p>
<p>废话不多说，马上定制你的个性整人网页吧！</p>
<p><span id="more-442"></span></p>
<form method="post">
<p>网页地址：http://zi-jin.com/howfun/</p>
<input name="filename" type="text" />.html</p>
<p>背景图片url:</p>
<input name="pic" type="text" value=http:// />
<p>背景音乐url:</p>
<input name="music" type="text" value=http:// />
<p><textarea cols="70" rows="30" name="maintext">此处输入弹出内容，每行将弹出一个窗口</textarea></p>
<input type="submit" value="生成网页" />
</form>
<p>附老把戏的内容作为参考：(可以直接复制到上面文本框）</p>
<p>终于有人上当的了！<br />
今日愚人节呀，您不知吗？<br />
为什么，都不小心哦<br />
没法啦！你都上了，只有陪我了<br />
哈哈！呵呵！嘻嘻！<br />
我都不想的，都是想开心下<br />
别难过了~~~<br />
就和我玩玩啦！<br />
但是玩笑可能开过头了<br />
竟然要您来陪我<br />
哎，真是的！<br />
不过，不要嬲我的<br />
可是你怎么能回去呢？<br />
我也没办法<br />
要不。。。<br />
把机子关了吧！<br />
什么？你不愿意关？<br />
那怎么办呢？<br />
让我再想想<br />
对不起，实在没有办法了！<br />
都是我不好，让你受那么大委屈！<br />
但是现在你该怎么办呢？<br />
哎呀！求你了！！别哭好不好？！<br />
都是我的错，行了吗？<br />
什么？不行？孬人，快放了我<br />
别这样嘛！<br />
我给你讲个故事行吗？<br />
从前有个山<br />
山上有个庙<br />
庙里有个老和尚有个小和尚<br />
老和尚正在给小和尚讲故事<br />
从前有个山<br />
山上有个庙。。。。<br />
别骂我呀？<br />
你不愿听这个我给你换一个<br />
从前有个山<br />
山上有个庵<br />
庵里有个老尼姑有个小尼姑<br />
老尼姑。。。哎呦别打了，我换一个！<br />
讲个好听的<br />
仔细听啊<br />
从前有个山<br />
呵呵，先别打，和那个不一样！<br />
山上有个庙<br />
哎呦，听我讲完！<br />
庙里有个缸<br />
不一样了吧<br />
缸里有个瓢<br />
瓢里有个碗<br />
碗里有个勺<br />
勺里有块肉<br />
我吃了你馋了<br />
我的故事讲完了！<br />
好不好？<br />
什么？还想听？你正孬人！<br />
那好，我再来一个！<br />
从前<br />
有一个小孩牵个羊<br />
我的故事就这么长<br />
你不愿意听是吗？<br />
那怎么办？<br />
你已经出不去了<br />
还是关掉电脑来的干脆<br />
试试吧<br />
还是不愿关？<br />
那我再给你讲故事！<br />
哎哎，别哭嘛！<br />
哭的我挺伤心的<br />
你真的出不去了<br />
你还不泄气？<br />
我佩服你这种精神！<br />
你坚持这么久一定很急了<br />
你还真能坚持！<br />
你一定知道“坚持就是胜利”<br />
对不对？<br />
如果你有这种精神的话&#8212;<br />
你一定会成功的！<br />
相信我<br />
你快看到希望了<br />
我不骗你<br />
真的！<br />
你马上就会找到出口的<br />
多亏你坚持了下来<br />
要不，关了机子多不好！<br />
是不是？<br />
对不对？<br />
喂！给你说点正事！<br />
一个人受骗是不是很难受？<br />
想不想让别人替你分担一下？<br />
我的意思是&#8212;-<br />
把你的朋友叫过来！<br />
让他也受骗<br />
你就在一旁哈哈大笑~~~<br />
好不好？<br />
什么？出卖朋友的事你不干？<br />
你真是好人！<br />
我太感动了！<br />
呜呜~~~~~~<br />
也好，我从不难为好人！<br />
我决定&#8212;-<br />
让好人多在我身边一会！<br />
你愿不愿意？<br />
怎么还不愿意？<br />
那好，我马上让你出去！<br />
别着急！<br />
你只需再点100000下就可以了！<br />
开个玩笑<br />
不要生气<br />
人生就像一场戏<br />
因为有缘才相聚<br />
相扶到老不容易<br />
是否更该去珍惜<br />
他人生气我不气<br />
气出病来无人替<br />
我说的对不对？<br />
好了<br />
玩笑也开过了<br />
该说的也说了<br />
该放你出去了！<br />
高兴了吧<br />
还有，您可以介绍个MM给我吗<br />
什么，还要我介绍一个给你这个孬人<br />
呵呵，不用嬲啦！<br />
不嬲就假了，我想现在就撕开你两边添啦！<br />
哦，你撕开我两边，那你怎样出呢<br />
你不是真的关机是吗<br />
如果是的，我都没办法了，你关啦<br />
陪多我几小时先啦！<br />
我都没有人陪我<br />
或者你介绍一个MM给我，就不用你陪啦！好吗<br />
好，好难啦！<br />
哦，那你就一直陪我啦！<br />
不要，不要，不要，我返出！<br />
哭~~~~~~~~~哭~~~~~~哭~~~~<br />
呵呵，我怕了您 ，你不要哭了，我放你了！<br />
叮咚！开门啦！<br />
祝贺你！你终于出来了！恭喜恭喜！<br />
看到这句话高兴了吧？<br />
做任何事可不要高兴太早呀！知道了吗？<br />
听说过乐极生悲吗？<br />
算了，算了，还是放你出来吧，做个深呼吸吧，放松一下！<br />
这次不用担心了，放你出来了，通过这个事，应该明白一个道理呀！<br />
那就是：坚持就是胜利，勤奋就有机遇！</p>
]]></content:encoded>
			<wfw:commentRss>http://zi-jin.com/archives/442/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>百度搜索 您要找的是不是？</title>
		<link>http://zi-jin.com/archives/439</link>
		<comments>http://zi-jin.com/archives/439#comments</comments>
		<pubDate>Sat, 26 Mar 2011 07:17:28 +0000</pubDate>
		<dc:creator>至尊明帅</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Web]]></category>

		<guid isPermaLink="false">http://zi-jin.com/?p=439</guid>
		<description><![CDATA[经常看到有人发类似的图片，于是制作了个小工具，自动生成提供截图的网页，只需要输入搜索文字和提示文字即可，大家试试吧： 搜索文字： 提示文字：]]></description>
			<content:encoded><![CDATA[<p><a href="http://files.zi-jin.com/uploads/2011/03/Baidu.jpg" rel="lightbox[439]"><img class="aligncenter size-full wp-image-440" title="Baidu" alt="" src="http://files.zi-jin.com/uploads/2011/03/Baidu.jpg" width="671" height="142" /></a></p>
<p>经常看到有人发类似的图片，于是制作了个小工具，自动生成提供截图的网页，只需要输入搜索文字和提示文字即可，大家试试吧：</p>
<form method="post" action="http://my.zi-jin.com/baidu">
<p>搜索文字：<br />
<input name="text1" /></p>
<p>提示文字：<br />
<input name="text2" /></p>
<input type="submit" /> </form>
]]></content:encoded>
			<wfw:commentRss>http://zi-jin.com/archives/439/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>如何把FaceBook和Twitter显示给中国大陆用户</title>
		<link>http://zi-jin.com/archives/397</link>
		<comments>http://zi-jin.com/archives/397#comments</comments>
		<pubDate>Tue, 21 Sep 2010 08:15:05 +0000</pubDate>
		<dc:creator>至尊明帅</dc:creator>
				<category><![CDATA[Web]]></category>
		<category><![CDATA[FaceBook]]></category>
		<category><![CDATA[ip段]]></category>
		<category><![CDATA[twitter]]></category>
		<category><![CDATA[翻墙]]></category>

		<guid isPermaLink="false">http://zi-jin.com/?p=397</guid>
		<description><![CDATA[本文以WordPress环境为例 首先，请参照全部中国大陆IP段获取中国大陆IP信息 然后，安装好Exec-PHP插件 查看你的FaceBook代码，以我的为例： 1 &#60;!-- Facebook Badge START --&#62;&#60;a href=&#34;http://zh-tw.facebook.com/ksj32750&#34; target=&#34;_TOP&#34; style=&#34;font-family: &#38;quot;lucida grande&#38;quot;,tahoma,verdana,arial,sans-serif; font-size: 11px; font-variant: normal; font-style: normal; font-weight: normal; color: #3B5998; text-decoration: none;&#34; title=&#34;Peter Chang&#34;&#62;Peter Chang&#60;/a&#62;&#60;br/&#62;&#60;a href=&#34;http://zh-tw.facebook.com/ksj32750&#34; target=&#34;_TOP&#34; title=&#34;Peter Chang&#34;&#62;&#60;img src=&#34;http://badge.facebook.com/badge/100001562501152.221.1559676673.png&#34; width=&#34;120&#34; height=&#34;252&#34; style=&#34;border: 0px;&#34; /&#62;&#60;/a&#62;&#60;br/&#62;&#60;a &#8230; <a href="http://zi-jin.com/archives/397">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>本文以WordPress环境为例<br />
首先，请参照<a href="http://zi-jin.com/archives/393">全部中国大陆IP段</a>获取中国大陆IP信息<br />
然后，安装好Exec-PHP插件<br />
查看你的FaceBook代码，以我的为例：</p>

<div class="wp_codebox"><table><tr id="p39712"><td class="line_numbers"><pre>1
</pre></td><td class="code" id="p397code12"><pre class="xml" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">&lt;!-- Facebook Badge START --&gt;</span><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;a</span> <span style="color: #000066;">href</span>=<span style="color: #ff0000;">&quot;http://zh-tw.facebook.com/ksj32750&quot;</span> <span style="color: #000066;">target</span>=<span style="color: #ff0000;">&quot;_TOP&quot;</span> <span style="color: #000066;">style</span>=<span style="color: #ff0000;">&quot;font-family: &amp;quot;lucida grande&amp;quot;,tahoma,verdana,arial,sans-serif; font-size: 11px; font-variant: normal; font-style: normal; font-weight: normal; color: #3B5998; text-decoration: none;&quot;</span> <span style="color: #000066;">title</span>=<span style="color: #ff0000;">&quot;Peter Chang&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>Peter Chang<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/a<span style="color: #000000; font-weight: bold;">&gt;</span></span><span style="color: #000000; font-weight: bold;">&lt;br</span><span style="color: #000000; font-weight: bold;">/&gt;</span><span style="color: #000000; font-weight: bold;">&lt;a</span> <span style="color: #000066;">href</span>=<span style="color: #ff0000;">&quot;http://zh-tw.facebook.com/ksj32750&quot;</span> <span style="color: #000066;">target</span>=<span style="color: #ff0000;">&quot;_TOP&quot;</span> <span style="color: #000066;">title</span>=<span style="color: #ff0000;">&quot;Peter Chang&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span><span style="color: #000000; font-weight: bold;">&lt;img</span> <span style="color: #000066;">src</span>=<span style="color: #ff0000;">&quot;http://badge.facebook.com/badge/100001562501152.221.1559676673.png&quot;</span> <span style="color: #000066;">width</span>=<span style="color: #ff0000;">&quot;120&quot;</span> <span style="color: #000066;">height</span>=<span style="color: #ff0000;">&quot;252&quot;</span> <span style="color: #000066;">style</span>=<span style="color: #ff0000;">&quot;border: 0px;&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span><span style="color: #000000; font-weight: bold;">&lt;/a<span style="color: #000000; font-weight: bold;">&gt;</span></span><span style="color: #000000; font-weight: bold;">&lt;br</span><span style="color: #000000; font-weight: bold;">/&gt;</span><span style="color: #000000; font-weight: bold;">&lt;a</span> <span style="color: #000066;">href</span>=<span style="color: #ff0000;">&quot;http://zh-tw.facebook.com/badges/&quot;</span> <span style="color: #000066;">target</span>=<span style="color: #ff0000;">&quot;_TOP&quot;</span> <span style="color: #000066;">style</span>=<span style="color: #ff0000;">&quot;font-family: &amp;quot;lucida grande&amp;quot;,tahoma,verdana,arial,sans-serif; font-size: 11px; font-variant: normal; font-style: normal; font-weight: normal; color: #3B5998; text-decoration: none;&quot;</span> <span style="color: #000066;">title</span>=<span style="color: #ff0000;">&quot;建立你的名片貼！&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>建立你的名片貼<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/a<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><span style="color: #808080; font-style: italic;">&lt;!-- Facebook Badge END --&gt;</span></pre></td></tr></table></div>

<p>我把它砍得只剩下：</p>

<div class="wp_codebox"><table><tr id="p39713"><td class="line_numbers"><pre>1
</pre></td><td class="code" id="p397code13"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;a</span> <span style="color: #000066;">href</span>=<span style="color: #ff0000;">&quot;http://zh-tw.facebook.com/ksj32750&quot;</span> <span style="color: #000066;">target</span>=<span style="color: #ff0000;">&quot;_TOP&quot;</span> <span style="color: #000066;">title</span>=<span style="color: #ff0000;">&quot;Peter Chang&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span><span style="color: #000000; font-weight: bold;">&lt;img</span> <span style="color: #000066;">src</span>=<span style="color: #ff0000;">&quot;http://badge.facebook.com/badge/100001562501152.221.1559676673.png&quot;</span> <span style="color: #000066;">width</span>=<span style="color: #ff0000;">&quot;120&quot;</span> <span style="color: #000066;">height</span>=<span style="color: #ff0000;">&quot;252&quot;</span> <span style="color: #000066;">style</span>=<span style="color: #ff0000;">&quot;border: 0px;&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span><span style="color: #000000; font-weight: bold;">&lt;/a<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></td></tr></table></div>

<p>也就是去掉了上面的名字和下面的无用链接。</p>
<p>然后在img标签的src后面添加php代码，结果如下：</p>

<div class="wp_codebox"><table><tr id="p39714"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
</pre></td><td class="code" id="p397code14"><pre class="php" style="font-family:monospace;"><span style="color: #339933;">&lt;!--</span> Facebook Badge START <span style="color: #339933;">--&gt;&lt;</span>a href<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;http://zh-cn.facebook.com/ksj32750&quot;</span> target<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;_TOP&quot;</span> title<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;Peter Chang&quot;</span><span style="color: #339933;">&gt;&lt;</span>img src<span style="color: #339933;">=</span><span style="color: #000000; font-weight: bold;">&lt;?php</span>
    <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$cn</span><span style="color: #009900;">&#41;</span>
    <span style="color: #009900;">&#123;</span>
        <a href="http://www.php.net/clearstatcache"><span style="color: #990000;">clearstatcache</span></a><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><a href="http://www.php.net/file_exists"><span style="color: #990000;">file_exists</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;<span style="color: #006699; font-weight: bold;">$RootDir</span>/wp-includes/images/cache/facebook.1559676673.png&quot;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">||</span> <a href="http://www.php.net/time"><span style="color: #990000;">time</span></a><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">-</span> <a href="http://www.php.net/filemtime"><span style="color: #990000;">filemtime</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;<span style="color: #006699; font-weight: bold;">$RootDir</span>/wp-includes/images/cache/facebook.1559676673.png&quot;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&gt;</span> <span style="color: #cc66cc;">86400</span><span style="color: #009900;">&#41;</span>
            <a href="http://www.php.net/copy"><span style="color: #990000;">copy</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;http://badge.facebook.com/badge/100001562501152.221.1559676673.png&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;<span style="color: #006699; font-weight: bold;">$RootDir</span>/wp-includes/images/cache/facebook.1559676673.png&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;http://zi-jin.com/wp-includes/images/cache/facebook.1559676673.png&quot;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
    <span style="color: #b1b100;">else</span>
        <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;http://badge.facebook.com/badge/100001562501152.221.1559676673.png&quot;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span> width<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;120&quot;</span> height<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;252&quot;</span> style<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;border: 0px;&quot;</span> <span style="color: #339933;">/&gt;&lt;/</span>a<span style="color: #339933;">&gt;&lt;!--</span> Facebook Badge <a href="http://www.php.net/end"><span style="color: #990000;">END</span></a> <span style="color: #339933;">--&gt;</span></pre></td></tr></table></div>

<p>直接复制是无用的，那会显示我的出来…… <img src='http://zi-jin.com/wp-includes/images/smilies/face (29).gif' alt='[#38]' class='wp-smiley' /><br />
请参照以上稍作修改即可。<br />
如果不会判断用户的ip段，请参考<a href="http://zi-jin.com/archives/398">PHP判断IP段-以大陆ip段为例</a></p>
]]></content:encoded>
			<wfw:commentRss>http://zi-jin.com/archives/397/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP判断IP段-以大陆ip段为例</title>
		<link>http://zi-jin.com/archives/398</link>
		<comments>http://zi-jin.com/archives/398#comments</comments>
		<pubDate>Tue, 21 Sep 2010 07:54:33 +0000</pubDate>
		<dc:creator>至尊明帅</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[ip段]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://zi-jin.com/?p=398</guid>
		<description><![CDATA[大陆IP段全部中国大陆IP段 代码如下： 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 &#8230; <a href="http://zi-jin.com/archives/398">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>大陆IP段<a href="http://zi-jin.com/archives/393">全部中国大陆IP段</a></p>
<p>代码如下：</p>

<div class="wp_codebox"><table><tr id="p39817"><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
</pre></td><td class="code" id="p398code17"><pre class="php" style="font-family:monospace;">    <span style="color: #000088;">$RootDir</span> <span style="color: #339933;">=</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: #000088;">$ip</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$_SERVER</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">&quot;REMOTE_ADDR&quot;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
    <a href="http://www.php.net/sscanf"><span style="color: #990000;">sscanf</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$ip</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;<span style="color: #009933; font-weight: bold;">%d</span>.<span style="color: #009933; font-weight: bold;">%d</span>.<span style="color: #009933; font-weight: bold;">%d</span>&quot;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$ip1</span><span style="color: #339933;">,</span> <span style="color: #000088;">$ip2</span><span style="color: #339933;">,</span> <span style="color: #000088;">$ip3</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #000088;">$ipv4arr</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/file"><span style="color: #990000;">file</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;<span style="color: #006699; font-weight: bold;">$RootDir</span>/zi-jin.com/china-ipv4.txt&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #000088;">$cn</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #339933;">;</span>
    <span style="color: #b1b100;">foreach</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$ipv4arr</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$ipv4</span><span style="color: #009900;">&#41;</span>
    <span style="color: #009900;">&#123;</span>
        <a href="http://www.php.net/sscanf"><span style="color: #990000;">sscanf</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$ipv4</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;<span style="color: #009933; font-weight: bold;">%d</span>.<span style="color: #009933; font-weight: bold;">%d</span>.<span style="color: #009933; font-weight: bold;">%d</span> - <span style="color: #009933; font-weight: bold;">%d</span>.<span style="color: #009933; font-weight: bold;">%d</span>.<span style="color: #009933; font-weight: bold;">%d</span>&quot;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$lip1</span><span style="color: #339933;">,</span> <span style="color: #000088;">$lip2</span><span style="color: #339933;">,</span> <span style="color: #000088;">$lip3</span><span style="color: #339933;">,</span> <span style="color: #000088;">$rip1</span><span style="color: #339933;">,</span> <span style="color: #000088;">$rip2</span><span style="color: #339933;">,</span> <span style="color: #000088;">$rip3</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$ip1</span> <span style="color: #339933;">&lt;</span> <span style="color: #000088;">$lip1</span> <span style="color: #339933;">||</span> <span style="color: #000088;">$ip1</span> <span style="color: #339933;">&gt;</span> <span style="color: #000088;">$rip1</span><span style="color: #009900;">&#41;</span>
            <span style="color: #b1b100;">continue</span><span style="color: #339933;">;</span>
        <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$lip1</span> <span style="color: #339933;">==</span> <span style="color: #000088;">$rip1</span><span style="color: #009900;">&#41;</span>
        <span style="color: #009900;">&#123;</span>
            <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$ip2</span> <span style="color: #339933;">&lt;</span> <span style="color: #000088;">$lip2</span> <span style="color: #339933;">||</span> <span style="color: #000088;">$ip2</span> <span style="color: #339933;">&gt;</span> <span style="color: #000088;">$rip2</span><span style="color: #009900;">&#41;</span>
                <span style="color: #b1b100;">continue</span><span style="color: #339933;">;</span>
            <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$lip2</span> <span style="color: #339933;">==</span> <span style="color: #000088;">$rip2</span><span style="color: #009900;">&#41;</span>
            <span style="color: #009900;">&#123;</span>
                <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$ip3</span> <span style="color: #339933;">&gt;=</span> <span style="color: #000088;">$lip3</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #000088;">$ip3</span> <span style="color: #339933;">&lt;=</span> <span style="color: #000088;">$rip3</span><span style="color: #009900;">&#41;</span>
                <span style="color: #009900;">&#123;</span>
                    <span style="color: #000088;">$cn</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #339933;">;</span>
                    <span style="color: #b1b100;">break</span><span style="color: #339933;">;</span>
                <span style="color: #009900;">&#125;</span>
            <span style="color: #009900;">&#125;</span>
            <span style="color: #b1b100;">else</span> <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$ip2</span> <span style="color: #339933;">==</span> <span style="color: #000088;">$lip2</span><span style="color: #009900;">&#41;</span>
            <span style="color: #009900;">&#123;</span>
                <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$ip3</span> <span style="color: #339933;">&gt;=</span> <span style="color: #000088;">$lip3</span><span style="color: #009900;">&#41;</span>
                <span style="color: #009900;">&#123;</span>
                    <span style="color: #000088;">$cn</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #339933;">;</span>
                    <span style="color: #b1b100;">break</span><span style="color: #339933;">;</span>
                <span style="color: #009900;">&#125;</span>
            <span style="color: #009900;">&#125;</span>
            <span style="color: #b1b100;">else</span> <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$ip2</span> <span style="color: #339933;">==</span> <span style="color: #000088;">$rip2</span><span style="color: #009900;">&#41;</span>
            <span style="color: #009900;">&#123;</span>
                <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$ip3</span> <span style="color: #339933;">&lt;=</span> <span style="color: #000088;">$rip3</span><span style="color: #009900;">&#41;</span>
                <span style="color: #009900;">&#123;</span>
                    <span style="color: #000088;">$cn</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #339933;">;</span>
                    <span style="color: #b1b100;">break</span><span style="color: #339933;">;</span>
                <span style="color: #009900;">&#125;</span>
            <span style="color: #009900;">&#125;</span>
            <span style="color: #b1b100;">else</span>
            <span style="color: #009900;">&#123;</span>
                <span style="color: #000088;">$cn</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #339933;">;</span>
                <span style="color: #b1b100;">break</span><span style="color: #339933;">;</span>
            <span style="color: #009900;">&#125;</span>
        <span style="color: #009900;">&#125;</span>
    <span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>然后就可以根据</p>

<div class="wp_codebox"><table><tr id="p39818"><td class="line_numbers"><pre>1
2
3
4
</pre></td><td class="code" id="p398code18"><pre class="php" style="font-family:monospace;">    <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$cn</span><span style="color: #009900;">&#41;</span>
        <span style="color: #666666; font-style: italic;">//do sth for Chinese;</span>
    <span style="color: #b1b100;">else</span>
        <span style="color: #666666; font-style: italic;">// do sth for not Chinese;</span></pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://zi-jin.com/archives/398/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>全部中国大陆IP段</title>
		<link>http://zi-jin.com/archives/393</link>
		<comments>http://zi-jin.com/archives/393#comments</comments>
		<pubDate>Mon, 20 Sep 2010 12:37:40 +0000</pubDate>
		<dc:creator>至尊明帅</dc:creator>
				<category><![CDATA[Web]]></category>
		<category><![CDATA[ip段]]></category>

		<guid isPermaLink="false">http://zi-jin.com/?p=393</guid>
		<description><![CDATA[因为为了让大陆访问者看到本博的facebook和twitter 所以先得区分大陆访问者和非大陆访问者 首先要有所有中国大陆IP地址的数据 附上APNIC网站IP段数据下载地址 http://ftp.apnic.net/apnic/dbase/data/country-ipv4.lst 写个小程序把中国大陆的ip段全部抽取出来： 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 #include &#60;stdio.h&#62; #include &#60;string.h&#62; &#160; int main&#40;&#41; &#123; freopen&#40;&#34;country-ipv4.lst&#34;, &#34;r&#34;, stdin&#41;; freopen&#40;&#34;china-ipv4.txt&#34;, &#34;w&#34;, &#8230; <a href="http://zi-jin.com/archives/393">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>因为为了让大陆访问者看到本博的facebook和twitter<br />
所以先得区分大陆访问者和非大陆访问者<br />
首先要有所有中国大陆IP地址的数据<br />
附上APNIC网站IP段数据下载地址</p>
<p>http://ftp.apnic.net/apnic/dbase/data/country-ipv4.lst</p>
<p>写个小程序把中国大陆的ip段全部抽取出来：</p>

<div class="wp_codebox"><table><tr id="p39320"><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
</pre></td><td class="code" id="p393code20"><pre class="cpp" style="font-family:monospace;"><span style="color: #00ffff;">#include &lt;stdio.h&gt;</span>
<span style="color: #00ffff;">#include &lt;string.h&gt;</span>
&nbsp;
<span style="color: #40C4ff;">int</span> main<span style="color: #c0c0c0;">&#40;</span><span style="color: #c0c0c0;">&#41;</span>
<span style="color: #c0c0c0;">&#123;</span>
    <span style="color: #eee8aa;">freopen</span><span style="color: #c0c0c0;">&#40;</span><span style="color: #60ff60;">&quot;country-ipv4.lst&quot;</span>, <span style="color: #60ff60;">&quot;r&quot;</span>, <span style="color: #40C4ff;">stdin</span><span style="color: #c0c0c0;">&#41;</span><span style="color: #c0c0c0;">;</span>
    <span style="color: #eee8aa;">freopen</span><span style="color: #c0c0c0;">&#40;</span><span style="color: #60ff60;">&quot;china-ipv4.txt&quot;</span>, <span style="color: #60ff60;">&quot;w&quot;</span>, <span style="color: #40C4ff;">stdout</span><span style="color: #c0c0c0;">&#41;</span><span style="color: #c0c0c0;">;</span>
    <span style="color: #40C4ff;">char</span> buf<span style="color: #c0c0c0;">&#91;</span><span style="color: #60ff60;">1024</span><span style="color: #c0c0c0;">&#93;</span>, <span style="color: #c0c0c0;">*</span>pch, outch<span style="color: #c0c0c0;">&#91;</span><span style="color: #60ff60;">64</span><span style="color: #c0c0c0;">&#93;</span><span style="color: #c0c0c0;">;</span>
    <span style="color: #40C4ff;">while</span> <span style="color: #c0c0c0;">&#40;</span><span style="color: #eee8aa;">gets</span><span style="color: #c0c0c0;">&#40;</span>buf<span style="color: #c0c0c0;">&#41;</span><span style="color: #c0c0c0;">&#41;</span>
    <span style="color: #c0c0c0;">&#123;</span>
        <span style="color: #40C4ff;">if</span> <span style="color: #c0c0c0;">&#40;</span>buf<span style="color: #c0c0c0;">&#91;</span><span style="color: #60ff60;">0</span><span style="color: #c0c0c0;">&#93;</span> <span style="color: #c0c0c0;">==</span> <span style="color: #60ff60;">'#'</span><span style="color: #c0c0c0;">&#41;</span>
            <span style="color: #40C4ff;">continue</span><span style="color: #c0c0c0;">;</span>
        pch <span style="color: #c0c0c0;">=</span> <span style="color: #eee8aa;">strstr</span><span style="color: #c0c0c0;">&#40;</span>buf, <span style="color: #60ff60;">&quot;cn&quot;</span><span style="color: #c0c0c0;">&#41;</span><span style="color: #c0c0c0;">;</span>
        <span style="color: #40C4ff;">if</span> <span style="color: #c0c0c0;">&#40;</span><span style="color: #40C4ff;">NULL</span> <span style="color: #c0c0c0;">==</span> pch<span style="color: #c0c0c0;">&#41;</span>
            <span style="color: #40C4ff;">continue</span><span style="color: #c0c0c0;">;</span>
        pch <span style="color: #c0c0c0;">=</span> <span style="color: #eee8aa;">strstr</span><span style="color: #c0c0c0;">&#40;</span>buf, <span style="color: #60ff60;">&quot; :&quot;</span><span style="color: #c0c0c0;">&#41;</span><span style="color: #c0c0c0;">;</span>
        <span style="color: #eee8aa;">strncpy</span><span style="color: #c0c0c0;">&#40;</span>outch, buf, pch <span style="color: #c0c0c0;">-</span> buf<span style="color: #c0c0c0;">&#41;</span><span style="color: #c0c0c0;">;</span>
        outch<span style="color: #c0c0c0;">&#91;</span>pch <span style="color: #c0c0c0;">-</span> buf<span style="color: #c0c0c0;">&#93;</span> <span style="color: #c0c0c0;">=</span> <span style="color: #60ff60;">'<span style="">\0</span>'</span><span style="color: #c0c0c0;">;</span>
        <span style="color: #eee8aa;">puts</span><span style="color: #c0c0c0;">&#40;</span>outch<span style="color: #c0c0c0;">&#41;</span><span style="color: #c0c0c0;">;</span>
    <span style="color: #c0c0c0;">&#125;</span>
<span style="color: #c0c0c0;">&#125;</span></pre></td></tr></table></div>

<p>大家可以直接下载已经抽取出来的<a class="downloadlink" href="http://zi-jin.com/download/china-ipv4.txt" title=" downloaded 246 times" >china-ipv4.txt (246)</a></p>
]]></content:encoded>
			<wfw:commentRss>http://zi-jin.com/archives/393/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>【WordPress】WP-CodeBox-水平滚动条导致高度问题</title>
		<link>http://zi-jin.com/archives/292</link>
		<comments>http://zi-jin.com/archives/292#comments</comments>
		<pubDate>Tue, 13 Jul 2010 07:09:02 +0000</pubDate>
		<dc:creator>至尊明帅</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[CODEBOX]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[WP]]></category>
		<category><![CDATA[WP-CodeBox]]></category>
		<category><![CDATA[插件]]></category>
		<category><![CDATA[滚动条]]></category>
		<category><![CDATA[高度]]></category>

		<guid isPermaLink="false">http://zi-jin.com/?p=292</guid>
		<description><![CDATA[CodeBox当代码过长时底部会出现一个水平滚动条，可这样导致高度计算错误，垂直方向也出现了一个滚动条，这本也不是什么大不了的事。 关键就在于如果只有一行代码，那这行代码就看不到了（不信你可以试试，长度只要超过页面宽度就行） 同样，设计网页时也可能会出现这种情况（IE内核） 解决方法： 1.进入后台，编辑插件，(Plugins – Editor) （也可以用ftp软件编辑、下载下来编辑好再上传、通过WebShell编辑等） 2.打开codebox.css文件 3.找到 1 2 3 4 /* codebox */ .wp_codebox &#123; …… &#125; 4.将 1 overflow: auto; 修改成： 1 2 3 overflow-x: auto; overflow-y: hidden; padding-bottom: expression&#40;this.scrollWidth &#62; this.offsetWidth ? 15 : &#8230; <a href="http://zi-jin.com/archives/292">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>CodeBox当代码过长时底部会出现一个水平滚动条，可这样导致高度计算错误，垂直方向也出现了一个滚动条，这本也不是什么大不了的事。<br />
关键就在于如果只有一行代码，那这行代码就看不到了（不信你可以试试，长度只要超过页面宽度就行）</p>
<p>同样，设计网页时也可能会出现这种情况（IE内核）</p>
<p>解决方法：<br />
1.进入后台，编辑插件，(Plugins – Editor)<br />
（也可以用ftp软件编辑、下载下来编辑好再上传、通过WebShell编辑等）<br />
2.打开codebox.css文件<br />
3.找到</p>

<div class="wp_codebox"><table><tr id="p29224"><td class="line_numbers"><pre>1
2
3
4
</pre></td><td class="code" id="p292code24"><pre class="css" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">/* codebox */</span>
<span style="color: #6666ff;">.wp_codebox</span>  <span style="color: #00AA00;">&#123;</span>
……
<span style="color: #00AA00;">&#125;</span></pre></td></tr></table></div>

<p>4.将</p>

<div class="wp_codebox"><table><tr id="p29225"><td class="line_numbers"><pre>1
</pre></td><td class="code" id="p292code25"><pre class="css" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">overflow</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">auto</span><span style="color: #00AA00;">;</span></pre></td></tr></table></div>

<p>修改成：</p>

<div class="wp_codebox"><table><tr id="p29226"><td class="line_numbers"><pre>1
2
3
</pre></td><td class="code" id="p292code26"><pre class="css" style="font-family:monospace;">overflow-x<span style="color: #00AA00;">:</span> <span style="color: #993333;">auto</span><span style="color: #00AA00;">;</span>
overflow-y<span style="color: #00AA00;">:</span> <span style="color: #993333;">hidden</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">padding-bottom</span><span style="color: #00AA00;">:</span> expression<span style="color: #00AA00;">&#40;</span>this<span style="color: #6666ff;">.scrollWidth</span> <span style="color: #00AA00;">&gt;</span> this<span style="color: #6666ff;">.offsetWidth</span> ? <span style="color: #cc66cc;">15</span> <span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span></pre></td></tr></table></div>

<p>5.保存修改</p>
<p>搞定，刷新页面可看到变化。<br />
注意：笔者写这篇文章时，WP-CodeBox最新版本为1.4.3</p>
]]></content:encoded>
			<wfw:commentRss>http://zi-jin.com/archives/292/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>【WordPress】WP表情插件-Custom Smilies自动填充自动输入表情代码符号&#8221;What to type&#8221;</title>
		<link>http://zi-jin.com/archives/290</link>
		<comments>http://zi-jin.com/archives/290#comments</comments>
		<pubDate>Tue, 13 Jul 2010 05:14:27 +0000</pubDate>
		<dc:creator>至尊明帅</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Custom Smilies]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[WP]]></category>
		<category><![CDATA[插件]]></category>
		<category><![CDATA[自动填充]]></category>
		<category><![CDATA[自动输入]]></category>
		<category><![CDATA[表情]]></category>
		<category><![CDATA[表情代码]]></category>
		<category><![CDATA[表情符号]]></category>

		<guid isPermaLink="false">http://zi-jin.com/?p=290</guid>
		<description><![CDATA[Custom Smilies在你添加新表情后，必须手动为每一个表情键入一个独特的表情代码，如果表情比较多，这也是相当浪费时间的，而且一般我们的表情代码都有一定规律，比如我的[#01][#02][#03]…… 操作： 1.进入后台，编辑插件，(Plugins &#8211; Editor) （也可以用ftp软件编辑、下载下来编辑好再上传、通过WebShell编辑等） 2.打开common.inc.php文件 3.查找这一行代码： 1 &#60;td&#62;&#60;input type=&#34;text&#34; name=&#34;&#60;?php echo $smilie_name ?&#62;&#34; value=&#34;&#60;?php echo $old_smilies[$smilie] ?&#62;&#34; style=&#34;text-align:center&#34; /&#62;&#60;/td&#62; 4.将其修改为： 1 2 3 4 5 6 7 8 &#60;td&#62;&#60;input type=&#34;text&#34; name=&#34;&#60;?php echo $smilie_name ?&#62;&#34; value=&#34;&#60;? if ($old_smilies[$smilie]) &#8230; <a href="http://zi-jin.com/archives/290">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Custom Smilies在你添加新表情后，必须手动为每一个表情键入一个独特的表情代码，如果表情比较多，这也是相当浪费时间的，而且一般我们的表情代码都有一定规律，比如我的[#01][#02][#03]……</p>
<p>操作：<br />
1.进入后台，编辑插件，(Plugins &#8211; Editor)<br />
（也可以用ftp软件编辑、下载下来编辑好再上传、通过WebShell编辑等）<br />
2.打开common.inc.php文件<br />
3.查找这一行代码：</p>

<div class="wp_codebox"><table><tr id="p29029"><td class="line_numbers"><pre>1
</pre></td><td class="code" id="p290code29"><pre class="php" style="font-family:monospace;"><span style="color: #339933;">&lt;</span>td<span style="color: #339933;">&gt;&lt;</span>input type<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;text&quot;</span> name<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;&lt;?php echo <span style="color: #006699; font-weight: bold;">$smilie_name</span> ?&gt;&quot;</span> value<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;&lt;?php echo <span style="color: #006699; font-weight: bold;">$old_smilies</span>[<span style="color: #006699; font-weight: bold;">$smilie</span>] ?&gt;&quot;</span> style<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;text-align:center&quot;</span> <span style="color: #339933;">/&gt;&lt;/</span>td<span style="color: #339933;">&gt;</span></pre></td></tr></table></div>

<p>4.将其修改为：</p>

<div class="wp_codebox"><table><tr id="p29030"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
</pre></td><td class="code" id="p290code30"><pre class="php" style="font-family:monospace;">                    <span style="color: #339933;">&lt;</span>td<span style="color: #339933;">&gt;&lt;</span>input type<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;text&quot;</span> name<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;&lt;?php echo <span style="color: #006699; font-weight: bold;">$smilie_name</span> ?&gt;&quot;</span> value<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;&lt;?
                        if (<span style="color: #006699; font-weight: bold;">$old_smilies</span>[<span style="color: #006699; font-weight: bold;">$smilie</span>]) {
                            echo <span style="color: #006699; font-weight: bold;">$old_smilies</span>[<span style="color: #006699; font-weight: bold;">$smilie</span>];
                        }
                        else {
                            ?&gt;[#&lt;?=<span style="color: #006699; font-weight: bold;">$count</span>+1?&gt;]&lt;?
                        }
                    ?&gt;&quot;</span> style<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;text-align:center&quot;</span> <span style="color: #339933;">/&gt;&lt;/</span>td<span style="color: #339933;">&gt;</span></pre></td></tr></table></div>

<p>5.别忘了最后一步，一定要更新你的表情才有效：进入博客后台Smilies设置页面，点击Update</p>
<p>以后只要你进入Smilies的管理页面，都会将所有表情自动编号，你点击Update即可</p>
<p>注意：笔者写这篇文章时，Custom Smilies最新版本为2.9.1</p>
]]></content:encoded>
			<wfw:commentRss>http://zi-jin.com/archives/290/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>【WordPress】WP表情插件-Custom Smilies图片变成叉叉烧包无法显示地址中空格被下划线取代问题</title>
		<link>http://zi-jin.com/archives/289</link>
		<comments>http://zi-jin.com/archives/289#comments</comments>
		<pubDate>Tue, 13 Jul 2010 04:22:13 +0000</pubDate>
		<dc:creator>至尊明帅</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Custom Smilies]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[WP]]></category>
		<category><![CDATA[下划线]]></category>
		<category><![CDATA[叉叉]]></category>
		<category><![CDATA[叉烧包]]></category>
		<category><![CDATA[图片无法显示]]></category>
		<category><![CDATA[插件]]></category>
		<category><![CDATA[无法显示]]></category>
		<category><![CDATA[空格]]></category>
		<category><![CDATA[表情]]></category>

		<guid isPermaLink="false">http://zi-jin.com/?p=289</guid>
		<description><![CDATA[今天装了Custom Smilies (By Crazy Loong) 插件，可是却发现表情图片都变成了叉烧包，右键点属性，发现图片地址中本来是空格的莫名其妙变成了下划线：&#8217;_&#8217; 打开插件文件，找到cs_save_smilies函数，再往上找，是cs_save_smilies($_POST);看来可能并不是这个插件的bug，那我们就在cs_save_smilies函数这里动点手脚吧 1.进入后台，编辑插件，(Plugins &#8211; Editor) （也可以用ftp软件编辑、下载下来编辑好再上传、通过WebShell编辑等） 2.打开common.inc.php文件 3.找到cs_save_smilies函数的定义（找到下面这段代码） 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 // &#8230; <a href="http://zi-jin.com/archives/289">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>今天装了Custom Smilies (By Crazy Loong) 插件，可是却发现表情图片都变成了叉烧包，右键点属性，发现图片地址中本来是空格的莫名其妙变成了下划线：&#8217;_&#8217;</p>
<p>打开插件文件，找到cs_save_smilies函数，再往上找，是cs_save_smilies($_POST);看来可能并不是这个插件的bug，那我们就在cs_save_smilies函数这里动点手脚吧</p>
<p>1.进入后台，编辑插件，(Plugins &#8211; Editor)<br />
（也可以用ftp软件编辑、下载下来编辑好再上传、通过WebShell编辑等）<br />
2.打开common.inc.php文件<br />
3.找到cs_save_smilies函数的定义（找到下面这段代码）</p>

<div class="wp_codebox"><table><tr id="p28934"><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
</pre></td><td class="code" id="p289code34"><pre class="php" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">// save smilies to file</span>
<span style="color: #000000; font-weight: bold;">function</span> cs_save_smilies<span style="color: #009900;">&#40;</span><span style="color: #000088;">$array</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><a href="http://www.php.net/is_array"><span style="color: #990000;">is_array</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$array</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>
&nbsp;
    <span style="color: #b1b100;">foreach</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$array</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$k</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$v</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #666666; font-style: italic;">// sanitize smilies: remove \ ' &quot; and trim whitespaces</span>
        <span style="color: #000088;">$array</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$k</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/trim"><span style="color: #990000;">trim</span></a><span style="color: #009900;">&#40;</span><a href="http://www.php.net/str_replace"><span style="color: #990000;">str_replace</span></a><span style="color: #009900;">&#40;</span><a href="http://www.php.net/array"><span style="color: #990000;">array</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'\''</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'\\'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'&quot;'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">''</span><span style="color: #339933;">,</span> <span style="color: #000088;">$v</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    <span style="color: #000088;">$array</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/array_flip"><span style="color: #990000;">array_flip</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$array</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #000088;">$array4db</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/array"><span style="color: #990000;">array</span></a><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #b1b100;">foreach</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$array</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$k</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$v</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #666666; font-style: italic;">// sanitize smilies file name</span>
        <span style="color: #000088;">$array</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$k</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$v</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/str_replace"><span style="color: #990000;">str_replace</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'|'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'.'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$v</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><a href="http://www.php.net/in_array"><span style="color: #990000;">in_array</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$v</span><span style="color: #339933;">,</span> <a href="http://www.php.net/array"><span style="color: #990000;">array</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'update-smilies'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'page'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #339933;">!</span><a href="http://www.php.net/in_array"><span style="color: #990000;">in_array</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$k</span><span style="color: #339933;">,</span> <a href="http://www.php.net/array"><span style="color: #990000;">array</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">''</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'QAD'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #000088;">$array4db</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$k</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$v</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
	update_option<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'clcs_smilies'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$array4db</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #b1b100;">return</span> <span style="color: #000088;">$array</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>4.在</p>

<div class="wp_codebox"><table><tr id="p28935"><td class="line_numbers"><pre>1
</pre></td><td class="code" id="p289code35"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$array</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$k</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$v</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/str_replace"><span style="color: #990000;">str_replace</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'|'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'.'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$v</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>后面添加：</p>

<div class="wp_codebox"><table><tr id="p28936"><td class="line_numbers"><pre>1
</pre></td><td class="code" id="p289code36"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$array</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$k</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$v</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/str_replace"><span style="color: #990000;">str_replace</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'_'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">' '</span><span style="color: #339933;">,</span> <span style="color: #000088;">$v</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>5.别忘了最后一步，一定要更新你的表情才有效：进入博客后台Smilies设置页面，点击Update</p>
<p>注意：笔者写这篇文章时，Custom Smilies最新版本为2.9.1</p>
]]></content:encoded>
			<wfw:commentRss>http://zi-jin.com/archives/289/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

