<?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>ZFreet . CHeung &#187; User-Agent</title>
	<atom:link href="http://www.zfreet.com/post/tag/user-agent/feed" rel="self" type="application/rss+xml" />
	<link>http://www.zfreet.com</link>
	<description>我在“门”缝里 望着互联网</description>
	<lastBuildDate>Mon, 06 Sep 2010 16:58:48 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>让WP插件Reviewers_Info 识别Windows 7</title>
		<link>http://www.zfreet.com/post/wp-plugin-reviewers_info-windows-7.html</link>
		<comments>http://www.zfreet.com/post/wp-plugin-reviewers_info-windows-7.html#comments</comments>
		<pubDate>Tue, 27 Oct 2009 02:09:50 +0000</pubDate>
		<dc:creator>ZFreet</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[Reviewers_Info]]></category>
		<category><![CDATA[User-Agent]]></category>
		<category><![CDATA[Windows 7]]></category>
		<category><![CDATA[插件]]></category>
		<category><![CDATA[操作系统]]></category>

		<guid isPermaLink="false">http://www.zfreet.com/?p=72</guid>
		<description><![CDATA[<p>昨天新装了个插件——<a href="http://photozero.net/wp-plugins/reviewers_info/" rel="external">Reviewers_Info</a>，用于在评论者姓名旁边显示操作系统和浏览器信息（效果见各页评论），据Screenshots 说还可以显示国旗，但从来没见着过。</p>
<p>该插件安装顺畅，启用顺利，无需配置，和主题的兼容性很不错，并且信息准确到相当精确，图标还可以在RSS 中正常输出，是一款难得的傻瓜式插件。</p>
<p>但是仔细观察发现，有少数的Windows 操作系统被识别为“<strong>Windows other version</strong>”，并且唯独没有Windows 7 出现。再回到插件发布页，发现该版本<strong><a href="http://wordpress.org/extend/plugins/reviewers-info/" rel="external">最后更新于2009-5-21 </a></strong>，貌似那时候才正在流行Build 7100，各新闻还在介绍如何下载安装激活——也就是插件没收录Windo<small> [...]</small></p>]]></description>
			<content:encoded><![CDATA[<p>昨天新装了个插件——<a href="http://photozero.net/wp-plugins/reviewers_info/" rel="external">Reviewers_Info</a>，用于在评论者姓名旁边显示操作系统和浏览器信息（效果见各页评论），据Screenshots 说还可以显示国旗，但从来没见着过。</p>
<p>该插件安装顺畅，启用顺利，无需配置，和主题的兼容性很不错，并且信息准确到相当精确，图标还可以在RSS 中正常输出，是一款难得的傻瓜式插件。</p>
<p>但是仔细观察发现，有少数的Windows 操作系统被识别为“<strong>Windows other version</strong>”，并且唯独没有Windows 7 出现。再回到插件发布页，发现该版本<strong><a href="http://wordpress.org/extend/plugins/reviewers-info/" rel="external">最后更新于2009-5-21 </a></strong>，貌似那时候才正在流行Build 7100，各新闻还在介绍如何下载安装激活——也就是插件没收录Windows 7。</p>
<p>翻看代码，是通过User-Agent 来识别各版本的，显然的，唯独没有Windows 7。所以，只要自己在代码里加上一段即可正常识别了，关键就在于Windows 7 的User-Agent？</p>
<p>先来段<strong>Windows 操作系统的User-Agent 列表</strong>，至于Windows 操作系统的发展线路，<a href="http://img4.cache.netease.com/digi/2009/10/20/200910201321365d9fe.jpg" rel="external">这里有张图</a>：</p>
<ul>
<li>Windows NT 6.1 = WIN 7</li>
<li>Windows NT 6.0 = WIN VISTA</li>
<li>Windows NT 5.1 = WIN XP</li>
<li>Windows 4.9 = WIN ME</li>
<li>Windows NT 5.0 = WIN 2K</li>
<li>Windows 4.1 = WIN 98 SE</li>
<li>Windows 4.01998 = WIN 98</li>
<li>Windows 4.0 = WIN 95</li>
<li>Windows 3.1 = WIN 3.1</li>
<li>Windows 3.0 = WIN 3.0</li>
<li>Windows 2.0 = WIN 2.0</li>
<li>Windows 1.0 = WIN 1.0</li>
</ul>
<p>需要自行添加的代码很简单，找到130行左右，接照原代码的格式和if 关系，加上一段：</p>
<blockquote><p>}elseif(strpos($str,&#8217;nt 6.1&#8242;) !== false){<br />
$result['os'] = &#8216;Windows 7&#8242;;</p></blockquote>
<p>保存，上传，更新缓存，OK。</p>
<br /><h4>本文评论 »</h4><ul><li><b><a href='http://www.techstudio.cn/' rel='external nofollow' class='url' rel="external">techStudio</a>&nbsp;<img src="http://www.zfreet.com/wp-content/plugins/reviewers-info/icon/windows.png" title="Windows 7" alt="Windows 7"/>&nbsp;<img src="http://www.zfreet.com/wp-content/plugins/reviewers-info/icon/ie.png" title="Internet Explorer 7.0" alt="Internet Explorer 7.0"/></b> - <small><a href="http://www.zfreet.com/post/wp-plugin-reviewers_info-windows-7.html#comment-972">2009/10/27</a></small> ：看看效果…… </li><li><b><a href='http://www.bestdong.com/' rel='external nofollow' class='url' rel="external">BestDong</a>&nbsp;<img src="http://www.zfreet.com/wp-content/plugins/reviewers-info/icon/windows.png" title="Windows XP" alt="Windows XP"/>&nbsp;<img src="http://www.zfreet.com/wp-content/plugins/reviewers-info/icon/maxthon.png" title="Maxthon 2.0 based on IE 7.0" alt="Maxthon 2.0 based on IE 7.0"/></b> - <small><a href="http://www.zfreet.com/post/wp-plugin-reviewers_info-windows-7.html#comment-989">2009/10/27</a></small> ：测试一下我用的什么浏览器~ </li><li><b><a href='http://www.caxblog.com' rel='external nofollow' class='url' rel="external">Alex</a>&nbsp;<img src="http://www.zfreet.com/wp-content/plugins/reviewers-info/icon/windows.png" title="Windows XP" alt="Windows XP"/>&nbsp;<img src="http://www.zfreet.com/wp-content/plugins/reviewers-info/icon/firefox.png" title="Firefox 3.5.5" alt="Firefox 3.5.5"/></b> - <small><a href="http://www.zfreet.com/post/wp-plugin-reviewers_info-windows-7.html#comment-1243">2009/11/09</a></small> ：不想安装那么多的插件。。。 </li></ul><p><hr style="height:1px;"><small>© <a href="http://www.ZFreet.com/" target="_blank"><b>ZFreet CHeung</b></a> 2010 | <a href="http://www.zfreet.com/post/wp-plugin-reviewers_info-windows-7.html">原文链接</a> | <a href="http://www.zfreet.com/post/wp-plugin-reviewers_info-windows-7.html#comments">3 条评论</a> | <a href="http://freeimer.com/guestbook/" rel="external">留言</a> | <a href="http://creativecommons.org/licenses/by-nc-nd/2.5/cn/" rel="external">cc</a> fbd921dfda9476ce! (38.107.191.80) </small><hr></p>

<p><h2>相关文章 »</h2><ol><li><a href='http://www.zfreet.com/post/wordpress-thumbnails-solution-1.html' rel='bookmark' title='《一套自用WordPress 缩略图解决方案（一）》'>一套自用WordPress 缩略图解决方案（一）</a>： <small>之所以要写这篇简陋的“方案”，是因为之前被WP 的缩略图折腾了不少回，最后，总算被折腾出了一个比较满意的缩略图效果——效果演示见此，它其实是</small></li></ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.zfreet.com/post/wp-plugin-reviewers_info-windows-7.html/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>
