<?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>技术分享 &#8211; 任平生</title>
	<atom:link href="https://rpsh.net/category/yuanchuang/feed/" rel="self" type="application/rss+xml" />
	<link>https://rpsh.net</link>
	<description>待从头</description>
	<lastBuildDate>Wed, 16 Sep 2015 16:09:18 +0000</lastBuildDate>
	<language>zh-CN</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.2.2</generator>
	<item>
		<title>在网站中使用微软雅黑字体是否会构成侵权？</title>
		<link>https://rpsh.net/archives/font-licensing-for-the-web/</link>
					<comments>https://rpsh.net/archives/font-licensing-for-the-web/#comments</comments>
		
		<dc:creator><![CDATA[任平生]]></dc:creator>
		<pubDate>Fri, 23 Mar 2012 11:45:07 +0000</pubDate>
				<category><![CDATA[技术分享]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[Web Font]]></category>
		<category><![CDATA[版权]]></category>
		<guid isPermaLink="false">http://rpsh.net/?p=384</guid>

					<description><![CDATA[在网页的CSS中使用 font-family 定义字体为雅黑是否会构成侵权？ 根据微软的 EULA 及专门的答复邮件，这属于合法的使用范围，而不容许的情况是使用 @font-face 的方式引入 web字体。这也提醒我们，通过 CSS3 的 @font-face 在网页上引入 Web 字体是有风险的，尤其对于商业性网站。]]></description>
										<content:encoded><![CDATA[<p><a href="http://sofish.de/" target="_blank">sofish</a> 在知乎提了这么一个问题：</p>
<blockquote><p><a href="http://www.zhihu.com/question/20132460" target="_blank">在网站中使用微软雅黑会不会构成侵权？</a><br />
如果在网站的字体中使用 “微软雅黑”，在 CSS font-family 中（也就是说只有在系统默认有的时候才显示），不用在图片和外观设计上，会不会侵权？</p></blockquote>
<p>对于这个问题之前还真没想到过，很感兴趣，于是就做了一番查找。<br />
<span id="more-384"></span><br />
<img decoding="async" alt="" src="https://public.bay.livefilestore.com/y1pwUQB2tBHsYE8ZTKa4bKH1wxxVxMTrSmp5GAfpzCsHpmMwgM5bJDhgWZIsPWjcGRmSWyHRWWO0BF4Dljb2lQnwg/msyh.png?psid=1" title="微软雅黑字体" class="aligncenter" width="375" height="479" /></p>
<p>在微软雅黑字体文件的属性里，我们可以 EULA （最终用户许可协议）描述为：<br />
You may use this font as permitted by the EULA for the product in which this font is included to display and print content. You may only (i) embed this font in content as permitted by the embedding restrictions included in this font; and (ii) temporarily download this font to a printer or other output device to help print content. </p>
<p>中文大意：<br />
你可以依照包含这款字体的产品的 EULA 来使用此字体用来显示或打印内容。包含以下两种情况：<br />
1、当你要使用嵌入字体时需要遵循该字体的内嵌许可；<br />
2、临时性地下载到打印机或其他设备用于打印文档。</p>
<p>没有提到在网页上使用CSS 定义字体的情况，在 google 上了了一下，微软对于微软雅黑<a href="http://www.microsoft.com/typography/fonts/family.aspx?FID=350">字体授权</a>方面的一个网页，其中提供了一个联系方式可以询问对字体许可方面的疑问，于是就发了邮件询问。</p>
<p>二天后收到答复如下：</p>
<blockquote><p>Thank you for your inquiry. You should refer to your Windows license to understand the what rights Microsoft grants in their fonts.</p>
<p>Generally the license would allow you to use the font to use the font on workstations for your own personal or business use. The major restrictions in the EULA limit the fonts to be used on a certain number of workstations, prevent the fonts from being installed and used on a server, the fonts cannot be used with @font-face CSS, the font data cannot be modified and the font data cannot be distributed as part of a software or hardware product. You would need an additional license for these activities.</p>
<p>You can see the web fonts we offer at the link below:</p>
<p>http://webfonts.fonts.com/</p>
<p>Please let me know if you have any questions or if you want to extend the license for any of these uses.</p>
<p>Best regards,</p>
<p>Steve Kuhlman<br />
Monotype Imaging</p></blockquote>
<p>根据这篇回复，我们可以将字体用在个人或商业的工作站上。EULA 中主要的限制是不允许将字体安装在服务器上，不能使用 CSS 的 @font-face 的方式调用，及字体文件不能被修改或者作为软件一部分进行分发。这些都需要单独获得相应授权。</p>
<p>网上可以找到一篇 Adobe 的文章 <a href="http://blogs.adobe.com/typblography/2010/10/web-font-licensing.html" target="_blank">Understanding Web Font Licensing</a> ，其中讲了 Adobe 对字体也有相似的使用规定。</p>
<p><strong>所以，我们在 CSS 中使用 body{ font-family: &#8216;microsoft yahei&#8217; } 是在合法的使用范围内，不容许的是在CSS 中使用 @font-face 的方式引入字体文件。</strong></p>
<p>这也提醒我们，通过 CSS3 的 @font-face 在网页上引入 Web 字体是有风险的，尤其对于商业性网站。</p>
<p>对于个人站点，如果想使用有合法授权的 Web字体，可以访问这些：<br />
<a href="http://webfonts.fonts.com/" target="_blank">http://webfonts.fonts.com/</a><br />
<a href="https://typekit.com/" target="_blank">https://typekit.com/</a><br />
<a href="http://www.google.com/webfonts" target="_blank">http://www.google.com/webfonts</a></p>
<p><strong>3/29 更新</strong>:<br />
有趣的是，一周后又收到一封回复邮件，如下：</p>
<blockquote><p>Dear Haiyang,</p>
<p>Thanks a lot for your enquiry. Sorry for keep you waiting.<br />
After checking, you actually do not need a license to include the font name in your CSS, because it is only calling on the system font already existing in the end user&#8217;s computer, which does not need any extra license.</p>
<p>However, if you wish to know more about the licensing of this font, you need to contact Microsoft because they own the copyright of Yahei.</p>
<p>Should you have any queries, please do not hesitate to contact us.</p>
<p>Best Regards,</p>
<p>Janet Lau<br />
Sales Executive </p></blockquote>
<p>中心思想：经过核查，你不必担心在CSS 中使用字体名称，因为它仅仅是调用了终端用户自身系统中已经存在的字体，这不需要任何额外的授权许可。</p>
]]></content:encoded>
					
					<wfw:commentRss>https://rpsh.net/archives/font-licensing-for-the-web/feed/</wfw:commentRss>
			<slash:comments>23</slash:comments>
		
		
			</item>
		<item>
		<title>sp2wp:导出Live Spaces数据到WordPress</title>
		<link>https://rpsh.net/archives/move-live-spaces-to-wordpress/</link>
					<comments>https://rpsh.net/archives/move-live-spaces-to-wordpress/#comments</comments>
		
		<dc:creator><![CDATA[任平生]]></dc:creator>
		<pubDate>Thu, 25 Mar 2010 02:00:18 +0000</pubDate>
				<category><![CDATA[技术分享]]></category>
		<category><![CDATA[Live Spaces]]></category>
		<category><![CDATA[原创]]></category>
		<guid isPermaLink="false">http://rpsh.net/?p=293</guid>

					<description><![CDATA[sp2wp 提供 Live Spaces 的日志、评论、留言等资料的数据导出服务，帮你轻松搬家到WordPress]]></description>
										<content:encoded><![CDATA[<p><a href="http://liveto.me/sp2wp" target="_blank">sp2wp</a> 提供 Live Spaces 的日志、评论、留言及个人资料的导出服务，它可以帮助你轻松完成从 Live Spaces 到 WordPress 的数据迁移工作。</p>
<p><span id="more-293"></span></p>
<h2>导出 Live Spaces 数据</h2>
<div class="entryhline"></div>
<p style="text-align:center"><a href="http://liveto.me/sp2wp" target="_blank"><img decoding="async" loading="lazy" title="sp2wp提供Live Spaces数据导出服务 | 任平生rpsh.net" height="390" alt="sp2wp提供Live Spaces数据导出服务" src="http://public.bay.livefilestore.com/y1p4E2jXCkJEHqczUaLloBeVQ5s1XXv-FHBliiiNIOIqQrXysglpNSC-l1N8VZ9VyD43P1kZ2oXhwLCW5CWmrgMtw/sp2wp.png" width="500" border="0" /></a> </p>
<ol>
<li>访问 <a href="http://liveto.me/sp2wp" target="_blank">sp2wp</a> </li>
<li>填入你要导出数据的 Live Spaces 地址及登录它的 Windows Live ID</li>
<li>确认提交</li>
</ol>
<p>当数据抓取处理完毕就会打包发送到你的邮箱里（你所填写的 Windows Live ID）。</p>
<p style="font-size: 12px; color: #6c6c6c">* 从你提交导出数据的请求到收到邮件一般需要较长的时间。如果一周后你依然没收到邮件，那么可以邮件我： myrpsh[at]gmail.com</p>
<h2>导入 WordPress</h2>
<div class="entryhline"></div>
<p>解压缩你收到的邮件的附件，其中有个 xxxx.xml 文件，这个就是你的 Live Spaces 的数据导出文件 —— 它被优化的十分适宜于导入 WordPress 。具体导入操作如下：</p>
<ol>
<li>登陆 WordPress 后台</li>
<li>在左侧的导航菜单中，点击“工具” &#8211; “导入”</li>
<li>导入源选择 WordPress</li>
<li>选择 xxxx.xml 文件，上传导入</li>
</ol>
<p style="text-align:center"><img decoding="async" loading="lazy" title="导入数据到WordPress | 任平生rpsh.net"  height="438" alt="导入数据到WordPress" src="http://public.bay.livefilestore.com/y1pC6sRCa-iUop4E5_GuJ9gadIINvUYlBATac5LQ3p6I6ofchkLwF1AJ03rGYm3zySQOYt-bcbErdHhhXVs1muvSw/import-xml.png" width="500" border="0" /> </p>
<p>&#160;</p>
<p>sp2wp 目前的问题：</p>
<ol>
<li>不能导出日志的分类</li>
<li><del>无法获取2009/02 后添加的评论的评论者名字</del><ins>已解决</ins></li>
</ol>
<p>访问 sp2wp: <a title="提供 Live Spaces 的日志、评论、留言及个人资料的导出服务" href="http://liveto.me/sp2wp" target="_blank">http://liveto.me/sp2wp</a></p>
]]></content:encoded>
					
					<wfw:commentRss>https://rpsh.net/archives/move-live-spaces-to-wordpress/feed/</wfw:commentRss>
			<slash:comments>126</slash:comments>
		
		
			</item>
		<item>
		<title>获取 Live SkyDrive 外链地址的 Bookmarklet 更新+Greasemonkey 脚本</title>
		<link>https://rpsh.net/archives/greasemonkey-script-live-skydrive-direct-link/</link>
					<comments>https://rpsh.net/archives/greasemonkey-script-live-skydrive-direct-link/#comments</comments>
		
		<dc:creator><![CDATA[任平生]]></dc:creator>
		<pubDate>Mon, 14 Sep 2009 11:38:32 +0000</pubDate>
				<category><![CDATA[技术分享]]></category>
		<category><![CDATA[Bookmarklet]]></category>
		<category><![CDATA[Greasemonkey]]></category>
		<category><![CDATA[Live SkyDrive]]></category>
		<category><![CDATA[原创]]></category>
		<category><![CDATA[脚本]]></category>
		<guid isPermaLink="false">http://rpsh.net/?p=287</guid>

					<description><![CDATA[用于获取 Live SkyDrive 文件唯一外链地址的Bookmarklet小书签，使用这个小书签可以轻松获得上传到 SkyDrive 文件的外链地址，并且外链地址永久有效。此外，还提供一个油猴脚本，在 Firefox 和 Chrome 中可以自动添加 SkyDrive 文件外链信息，省去每次都要点击小书签的烦恼。]]></description>
										<content:encoded><![CDATA[<p>Live SkyDrive 前几日做了次<a href="http://livesino.net/archives/2226.live" target="_blank">升级</a>，导致之前介绍的用于获取 SkyDrive 唯一外链地址的 <a href="https://rpsh.net/archives/get-direct-url-of-files-on-live-skydrive/">Bookmarklet</a> 失效了。（感谢 <a href="https://twitter.com/cooku" target="_blank">cooku</a> 提醒）</p>
<p>于是，更新了下 Bookmarklet 的代码，需要的同学，请删除你书签里的旧 Bookmarklet ，到<a href="http://liveto.me/bookmarklet/#skydrive">这里</a>添加新的用于获取 Live SkyDrive 文件唯一外链地址的 Bookmarklet 。</p>
<p><span id="more-287"></span></p>
<div class="notice">如果你第一次接触这个脚本，请阅读之前的<a href="https://rpsh.net/archives/get-direct-url-of-files-on-live-skydrive/">介绍</a>，这里不再叙述其原理及使用方法</div>
<p>使用 IE6 或以IE6为内核的浏览器（比如傲游，世界之窗）的同学请注意：新的 Bookmarklet&#160; 在 IE6 上无法执行，请升级你的 IE 浏览器到 IE8（<a href="http://microsoft.com/ie8" target="_blank">下载</a>） ，或者换用 Firefox、Chrome 等其他浏览器。</p>
<p>再提供一个 Greasemonkey 脚本，添加后，可以自动在右侧的文件预览导航下边显示“外链信息”（替换原来的广告部分），不用每次去书签栏点书签了 <img src="https://s.w.org/images/core/emoji/14.0.0/72x72/1f61b.png" alt="😛" class="wp-smiley" style="height: 1em; max-height: 1em;" /> </p>
<p><img decoding="async" loading="lazy" title="获取Skydrive外链地址的油猴脚本 | 任平生 - Rpsh.net" border="0" alt="获取Skydrive外链地址的油猴脚本" src="http://tgqujw.blu.livefilestore.com/y1pF8FeMKaetLniRo-xAJNM_vEDU4Pa-fhe-Kx9HfSsLn-OJF-LM44BlnS8A36fwGcqHes5AC4mTF-2jZFL0qxGsuWS0zkWPxuO/get-skydrive-file-driect-link.png" width="600" height="424" /> </p>
<p>Friefox 用户请点<a href="http://rpshnet.googlecode.com/files/get_skyrive_direct_link.user.js">这里</a>安装这个脚本。</p>
<p>Chrome 也可以使用这个脚本，不过首次打开页面不能自动添加“外链信息”，需要再点一下右侧文件导航中的此文件图标才行（囧，这下跟点 Bookmarklet 没区别了）。我没找到这个问题的解决办法，请路过的各位高手不吝赐教。</p>
<p><img decoding="async" loading="lazy" title="获取Skydrive外链地址的油猴脚本 | 任平生 - Rpsh.net" border="0" alt="Chrome 获取Skydrive外链地址的油猴脚本" src="http://tgqujw.blu.livefilestore.com/y1pXjFrP9j1CM84N32Sxq4SnwxSkjihdj_e_YzvBJBOhr21d0JdhFjHvn82cpYpLO_DXYYDCoGE25q0j5o9C1PSMdDi-Ci5dBSp/get-skydrive-file-driect-link-for-chrome.png" width="600" height="424" /></p>
<p>Greasemonkey 脚本下载： <a href="http://code.google.com/p/rpshnet/downloads/list">get skydrive direct link</a></p>
]]></content:encoded>
					
					<wfw:commentRss>https://rpsh.net/archives/greasemonkey-script-live-skydrive-direct-link/feed/</wfw:commentRss>
			<slash:comments>195</slash:comments>
		
		
			</item>
		<item>
		<title>过滤 Windows Live 在线服务广告的 Greasemokey 脚本</title>
		<link>https://rpsh.net/archives/remove-ads-from-windows-live-online-service/</link>
					<comments>https://rpsh.net/archives/remove-ads-from-windows-live-online-service/#comments</comments>
		
		<dc:creator><![CDATA[任平生]]></dc:creator>
		<pubDate>Sat, 05 Sep 2009 05:01:39 +0000</pubDate>
				<category><![CDATA[技术分享]]></category>
		<category><![CDATA[Chrome]]></category>
		<category><![CDATA[Greasemonkey]]></category>
		<category><![CDATA[Windows Live]]></category>
		<category><![CDATA[原创]]></category>
		<category><![CDATA[去广告]]></category>
		<category><![CDATA[脚本]]></category>
		<guid isPermaLink="false">http://rpsh.net/?p=286</guid>

					<description><![CDATA[Google Chrome 和 Firefox  ,IE 都能使用的可以过滤 Windows Live 在线服务(包括 Hotmail, Spaces,SkyDrive,Photos 等页面)上大大小小的广告块的Greasemokey 脚本.]]></description>
										<content:encoded><![CDATA[<p>Chrome 上迟迟没有好用的广告过滤插件，Windows Live 在线服务上的广告又实在是难看的离谱（能把广告画成那种恶心的样子也真不容易）。于是就想，有没有可以移除 Windows Live 在线服务广告的 Greasemonkey 脚本用，搜了下找到一个 <a href="http://userscripts.org/scripts/show/38990" target="_blank">Windows Live no Ads</a>，使用后发现并不能完全移除 Windows Live 在线服务上的广告，于是我自己动手修改了下，经测试已经完全可以移除 Windows Live Home, Profile, People,Hotmail,Calendar,Spaces 等页面的广告。</p>
<p><span id="more-286"></span></p>
<p>过滤的广告包括：</p>
<ol>
<li>过滤 Hotmail 收件箱右侧的广告，并使收件箱部分向右扩展充满右侧屏幕； </li>
<li>过滤发送邮件成功后转向页面中的广告； </li>
<li>过滤 Live Calendar&#160; “天” 视图右侧的广告； </li>
<li>过滤所有 Windows Live 在线服务的“提示型”、“方块型”、“长条形”广告； </li>
<li>过滤所有 Windows Live 服务中来自 MSN 中文网(cn.msn.com) 的布满挑逗的新闻标题； </li>
<li>过滤 MyPhone 页面中的广告。 </li>
</ol>
<p><img decoding="async" title="移除 Windows Live 在线服务上的广告的 Greasemonkey 脚本 | 任平生 - rpsh.net" alt="过滤 Windows Live 在线服务上的广告" src="http://tgqujw.blu.livefilestore.com/y1pYv8xPCwCnafHg-LKtrIxKtRI3wiZpBo-qMmmoz4vDKc3dI6CzBOy41WW8Yh9nyPKOb3yOV37a80n727zEe97NHIzKSHJflND/Windows_live_no_ads.png" /></p>
<p><strong>脚本下载</strong>：<a href="http://rpshnet.googlecode.com/files/windows_live_no_ads.user.js" target="_blank">Windows Live no Ads</a>&#160; (请右击链接选择另存为)</p>
<p>使用 Chrome 的同学，添加【&#8211;enable-user-scripts 】 参数启用脚本后，将这个文件放在 User Scripts 即可。当然，Firefox 也可以使用这个脚本。</p>
]]></content:encoded>
					
					<wfw:commentRss>https://rpsh.net/archives/remove-ads-from-windows-live-online-service/feed/</wfw:commentRss>
			<slash:comments>43</slash:comments>
		
		
			</item>
		<item>
		<title>修改 WordPress 后台IP地址查询链接</title>
		<link>https://rpsh.net/archives/wordpress-ip-whois/</link>
					<comments>https://rpsh.net/archives/wordpress-ip-whois/#comments</comments>
		
		<dc:creator><![CDATA[任平生]]></dc:creator>
		<pubDate>Wed, 13 May 2009 04:00:52 +0000</pubDate>
				<category><![CDATA[技术分享]]></category>
		<category><![CDATA[IP]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[原创]]></category>
		<guid isPermaLink="false">http://rpsh.net/?p=268</guid>

					<description><![CDATA[修改 WordPress 后台IP地址查询链接。给 WordPress 后台评论部分增加 IP Whois 查询链接。修改评论 email 通知中的 IP Whois 查询为 ip.cn 更加符合中国区用户的使用需求。]]></description>
										<content:encoded><![CDATA[<p><a href="https://rpsh.net/tag/wordpress/">WordPress</a> 后台自带的 IP Whois 查询，我感觉对中国区的用户用处不大，为什么不<a href="https://rpsh.net/archives/wordpress-ip-whois/">改</a>下呢？ </p>
<p><span id="more-268"></span></p>
<p>修改方法：</p>
<p>1. 用编辑器打开 wp-admin\includes\template.php</p>
<p>查找 comment_author_IP，找到第三个 comment_author_IP（2074行），将此行下边一行（2075行）的：</p>
<pre><code class="php">echo '&lt;/a&gt;';</code></pre>
<p>替换为：</p>
<pre><code class="php">echo '&lt;/a&gt; [&lt;a href=&quot;http://www.ip.cn/getip.php?action=queryip&amp;ip_url='; 
comment_author_IP(); 
echo'&quot; target=&quot;_blank&quot;&gt;IP&lt;/a&gt;]';</code></pre>
<p>此修改可以给 WordPress 后台 每条评论的IP部分增加一个 IP 查询链接。</p>
<p><img decoding="async" loading="lazy" title="给 WordPress 后台增加 IP Whois 查询 - 任平生@rpsh.net" alt="给 WordPress 后台增加 IP Whois 查询" src="http://lh4.ggpht.com/_aLmNmqD0H4M/SgBV24uMblI/AAAAAAAAA3E/xJvemxdA5KI/s800/ip-edit-comment-page.png" width="529" height="140" /> </p>
<p>2. 用编辑器打开 wp-includes\pluggable.php</p>
<p>查找：（共两处，分别在953行，1048行）</p>
<pre><code class="php">http://ws.arin.net/cgi-bin/whois.pl?queryinput=</code></pre>
<p>替换为：</p>
<pre><code class="php">http://www.ip.cn/getip.php?action=queryip&amp;ip_url=</code></pre>
<p>这个修改可以将 评论 Email 通知中的 IP Whois 查询链接修改为 ip.cn 。</p>
<p><img decoding="async" loading="lazy" title="修改 WordPress 评论 Email 通知的 IP Whois 查询链接 - 任平生@rpsh.net" alt="修改 WordPress 评论 Email 通知的 IP Whois 查询链接" src="http://lh6.ggpht.com/_aLmNmqD0H4M/SgBV22jCchI/AAAAAAAAA28/LyQuBKGrrEM/s800/email-notify-ip-whois.png" width="529" height="200" /></p>
<p>以上方法在 WordPress 2.7 中可用，如果你的 WordPress 版本较低上述方法无效的话，可以试试<a href="http://www.osxcn.com/wordpress/wordpress-ip-whois.html" target="_blank" class="external">此文</a>提供的方法。</p>
]]></content:encoded>
					
					<wfw:commentRss>https://rpsh.net/archives/wordpress-ip-whois/feed/</wfw:commentRss>
			<slash:comments>33</slash:comments>
		
		
			</item>
		<item>
		<title>如何获得 Live Skydrive 音乐文件唯一外链地址</title>
		<link>https://rpsh.net/archives/get-direct-url-of-files-on-live-skydrive/</link>
					<comments>https://rpsh.net/archives/get-direct-url-of-files-on-live-skydrive/#comments</comments>
		
		<dc:creator><![CDATA[任平生]]></dc:creator>
		<pubDate>Mon, 20 Apr 2009 00:00:00 +0000</pubDate>
				<category><![CDATA[技术分享]]></category>
		<category><![CDATA[Bookmarklet]]></category>
		<category><![CDATA[Live SkyDrive]]></category>
		<category><![CDATA[Liveto.me]]></category>
		<category><![CDATA[原创]]></category>
		<guid isPermaLink="false">http://rpsh.net/?p=253</guid>

					<description><![CDATA[获取 Live SkyDrive 音乐文件唯一外链地址，此唯一地址不受 live skydrive 文件直接地址每天变化的影响]]></description>
										<content:encoded><![CDATA[<p>无论之前还是最近得到的消息均已经指出 Live SkyDrive 文件已经不再支持外链了。</p>
<blockquote>
<p>SkyDrive is not designed as a general webhost to give direct access to the files. We don’t guarantee that they won’t break or change (and, in fact, they will). </p>
<p>SkyDrive 的设计初衷不是作为一个可以直接外链文件的网盘的， 我们不能保证文件真实地址有效而不变动（实际上，它们的确在变）。</p>
</blockquote>
<p>他们采用的措施就是 <a href="https://rpsh.net/tag/live-skydrive/">Live SkyDrive</a> 的文件真实地址（外链）是每天变动的。并且出于安全的缘故，<strong>HTML、Flash等类型的文件都是只能下载而不能直接浏览</strong>了。</p>
<p><span id="more-253"></span></p>
<p>我不知道这样的 Live SkyDrive 还有什么用处（不要忘记，Live SkyDrive 最大只能上传50M的文件），备份本地文件？与好友共享文件？ Live Mesh 的操作比 Live SkyDrive更简便（客户端自动同步文件），可以上传的文件大小也基本没限制。那么，Live SkyDrive 将继续以什么角色存在呢？</p>
<p>这个问题还是让微软来回答吧。</p>
<p>现在来说说音乐文件的外链，我们用一个网盘，大多数时候是用其外链图片、外链音乐。恰好，我知道一种方法可以让我们不受上面所提到的文件真实地址天天变动的影响而外链音乐文件。其他文件则没有外链的意义（图片例外，下面会单独说明），比如 Flash 只能下载，即使用此方法得到的<strong>唯一外链地址</strong>也是不能在线播放的！（可能有些Flash例外，原因不明）</p>
<p>&#160;</p>
<h2>获取音乐文件唯一外链地址的方法：</h2>
<div class="entryhline"></div>
<p>到 <a class="external" href="http://liveto.me/bookmarklet/#skydrive" target="_blank">这里</a> 安装用于获取 Live SkyDrive 唯一外链地址的小书签（Bookmarklet），在 Live SkyDrive 文件下载页面使用此小书签即可<a href="https://rpsh.net/archives/get-direct-url-of-files-on-live-skydrive/">获得文件的唯一外链地址</a>，比如：<a class="external" href="http://storage.live.com/items/10BEB08F8F3CBC84!7314?filename=Home.wma" target="_blank">http://storage.live.com/items/10BEB08F8F3CBC84!7314?filename=Home.wma</a></p>
<p>请注意，这个地址只可用于在网页上播放使用，如果下载文件，请仍按照老方法下载！</p>
<p><embed src="http://liveto.me/bookmarklet/img/demo/bookmarklet.swf" quality="high" style="width:500px;height:438px" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" flashvars="autostart=false&#038;thumb=http%3A%2F%2Fliveto.me%2Fbookmarklet%2Fbltsc.png&#038;thumbscale=45&#038;color=0x1A1A1A,0x1A1A1A" wmode="transparent"></embed></p>
<p>使用这个小书签还可以得到一个“分享地址”，使用这个分享地址的好处是，当你在 Live SkyDrive 移动、重命名了一个文件，“分享地址”将依然有效，可以自动指向修改后的文件页面。同样，使用这个小书签得到的<strong>唯一“外链地址”</strong>也有这样的特性，除非你删除了原文件，否则此地址将一直有效。</p>
<p>&#160;</p>
<p>但是（又是可恶的但是），Live SkyDrive 每天有段时间文件是不能下载的（一般是深夜），外链就更不用说了，服务器会一直返回 “Bandwidth Limit Exceeded”（流量超限）。所以，我只能说，这个<a href="https://rpsh.net/archives/get-direct-url-of-files-on-live-skydrive/">外链</a>会在大部分时间中可以正常工作 <img src="https://s.w.org/images/core/emoji/14.0.0/72x72/1f621.png" alt="😡" class="wp-smiley" style="height: 1em; max-height: 1em;" /></p>
<p>&#160;</p>
<p>关于 Live SkyDrive 图片的外链， Lei 提供了这样的信息：</p>
<blockquote>
<p>Skydrive is not designed to be a general webhost to give direct access to the files. <br />However, we do realize many people use Skydrive to host image files in their blogs etc&#8230;, so we don&#8217;t move image files at the moment.</p>
<p>SkyDrive 的设计初衷不是作为一个可以直接外链文件的网盘。<br />可是，我们发现许多用户使用 SkyDrive 来存储他们博客上的图片&#8230; 所以，目前我们还没有对图片文件的外链进行变动的打算</p>
</blockquote>
<p>所以 at the moment，Live SkyDrive 的图片依然是可以外链的，但显然微软保留了随时终止图片外链的权利。。。 希望微软不要做如此 NC 的决定。</p>
<p>另外，想特别指出的是， <strong>Live SkyDrive 的文件只能单线程下载</strong>，如果你使用诸如迅雷等下载工具下载的话，很可能会下载失败，或者下载回来的是不完整的文件！ 其实使用 IE 的另存为方式下载，我感觉速度就很快的 <img src="https://s.w.org/images/core/emoji/14.0.0/72x72/1f61b.png" alt="😛" class="wp-smiley" style="height: 1em; max-height: 1em;" /></p>
<div class="notice">
<p><span class="date">2009/09/14更新：</span> 微软更新了 SkyDrive 页面构架，导致之前的小书签失效，请各位同学重新添加新的小书签到你的收藏夹，方法跟以前一样。<br /> 目前还提供 Greasemonkey 脚本给各位同学，这个油猴脚本可以直接在 SkyDrive 文件页面上显示【外链地址】，省去了每次都要点小书签的麻烦，详情请看<a href="https://rpsh.net/archives/greasemonkey-script-live-skydrive-direct-link/">这里</a>。</p>
</div>
]]></content:encoded>
					
					<wfw:commentRss>https://rpsh.net/archives/get-direct-url-of-files-on-live-skydrive/feed/</wfw:commentRss>
			<slash:comments>94</slash:comments>
		
		<enclosure url="http://storage.live.com/items/10BEB08F8F3CBC84!7314?filename=Home.wma" length="1843613" type="audio/x-ms-wma" />

			</item>
		<item>
		<title>移除 WordPress 分类链接的前缀</title>
		<link>https://rpsh.net/archives/remove-the-category-prefix-from-permalinks-on-wordpress/</link>
					<comments>https://rpsh.net/archives/remove-the-category-prefix-from-permalinks-on-wordpress/#comments</comments>
		
		<dc:creator><![CDATA[任平生]]></dc:creator>
		<pubDate>Sun, 01 Mar 2009 12:00:23 +0000</pubDate>
				<category><![CDATA[技术分享]]></category>
		<category><![CDATA[Blogging]]></category>
		<category><![CDATA[SEO]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[原创]]></category>
		<guid isPermaLink="false">http://rpsh.net/?p=227</guid>

					<description><![CDATA[移除 WordPress 分类 固定链接中的category前缀。方法非常简单：WordPress后台管理 - 设置 - 永久链接（固定链接）-分类目录前缀，填入一个英文的点号即可]]></description>
										<content:encoded><![CDATA[<p>最近帮人修改Blog时，分类链接要求是这样子：</p>
<pre>https://rpsh.net/google/</pre>
<p>但默认的为：</p>
<pre>https://rpsh.net/category/google/</pre>
<p><span id="more-227"></span></p>
<p>WP会自动给分类的 URL 添加一个category 的前缀，在 WP 后台的固定连接中只能设置修改这个前缀 category 为其他字符，却不能隐藏这个前缀。</p>
<p>Google 了一下这个问题，中文的文章只有<a href="http://www.cciuu.com/html/remove-prefix-from-url-for-a-wordpress-category.html" target="_blank" class="external">一</a>篇，不过提供的方法我用后却无效， category 是移除了，但分类链接却变成了</p>
<pre>https://rpsh.net/?cat=1</pre>
<p>这不是我想要的，用英文关键字搜了一下，找到一篇有价值的<a href="http://www.clausheinrich.com/change-or-remove-the-category-from-your-permalinks-on-a-wordpress-blog/" target="_blank" class="external">文章</a>，提供的解决这个问题的方法也异常简单：</p>
<p>WordPress后台管理 &#8211; 设置 &#8211; 永久链接（固定链接），在“分类目录前缀”里填入一个点[ . ](只一个点，不含括号)即可完美<a href="https://rpsh.net/archives/remove-the-category-prefix-from-permalinks-on-wordpress/">移除分类链接中的前缀</a>。</p>
<p><img decoding="async" loading="lazy" alt="移除WordPress分类链接的前缀" src="http://lh3.ggpht.com/_aLmNmqD0H4M/SapzE3CRH2I/AAAAAAAAArY/4UmTlyCkumY/s800/remove_category_prefix.png" width="546" height="185"/> </p>
<p>原文中说的是填入[ /. ]，不过保存后斜杠会被自动删除，而且经我测试，直接填一个点就行了。</p>
<p>原文中还提到说这是 2.5 以后版本 WordPress 分类的一个特性。至于之前版本的 WP 是否支持，我不清楚，我目前用的是 2.7，可正常使用这一技巧。</p>
<p>p.s. 我不需要这种效果，所以本Blog的分类链接依然是含有category前缀的  <img src="https://s.w.org/images/core/emoji/14.0.0/72x72/1f633.png" alt="😳" class="wp-smiley" style="height: 1em; max-height: 1em;" /> </p>
]]></content:encoded>
					
					<wfw:commentRss>https://rpsh.net/archives/remove-the-category-prefix-from-permalinks-on-wordpress/feed/</wfw:commentRss>
			<slash:comments>65</slash:comments>
		
		
			</item>
		<item>
		<title>增加 Web Slices 支持</title>
		<link>https://rpsh.net/archives/create-web-slices-for-ie8/</link>
					<comments>https://rpsh.net/archives/create-web-slices-for-ie8/#comments</comments>
		
		<dc:creator><![CDATA[任平生]]></dc:creator>
		<pubDate>Thu, 12 Feb 2009 07:35:26 +0000</pubDate>
				<category><![CDATA[技术分享]]></category>
		<category><![CDATA[IE8]]></category>
		<category><![CDATA[Web Slices]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[原创]]></category>
		<guid isPermaLink="false">http://rpsh.net/?p=221</guid>

					<description><![CDATA[为 Rpsh.net 增加 Web Slices 支持，并且评论部分也具有 Web Slices 特性。如何给自己的博客添加 Web Slices 特性支持。]]></description>
										<content:encoded><![CDATA[<p>最近对这个主题进行了一些小改进，主要就是增加了对 IE8 Web Slices 特性的支持。</p>
<p>增加 <a href="https://rpsh.net/webslices/">Web Slices</a> 页面，提供了几个 Web Slices 供添加。不过感觉这似乎跟 RSS 基本无甚差别，然后又突发奇想给本Blog的评论增加 Web Slice 特性，得益于 WordPress Thread Comments 插件的嵌套评论让这一想法得以完美实现。</p>
<p><span id="more-221"></span></p>
<p>现在除了使用邮件获得自己评论是否被回复外，又多了一个途径：<a href="https://rpsh.net/archives/create-web-slices-for-ie8/">Web Slices</a>。</p>
<p>如果你正在使用 <a href="http://www.microsoft.com/ie8" target="_blank" class="external">Internet Explorer 8</a>，当你鼠标移过本博的每条评论时，就会注意到每条评论的周围都会出现一个绿色的矩形框，这就是IE8发现 Web Slice 的提示，点击那个绿绿的 Web Slice 图标即可添加一个 Web Slice 到你的IE8收藏栏。</p>
<p><img decoding="async" loading="lazy" alt="鼠标在评论上移动时即可发现 Web Slices - 任平生 rpsh.net" src="http://lh5.ggpht.com/_aLmNmqD0H4M/SZPPo8eWIQI/AAAAAAAAAp0/ZKCzqAh4kK8/s800/comment-web-slice.png" width="540" height="154" /> </p>
<p>如此，当你的评论被回复时，IE8 的 Web Slices 会自动更新提醒你，这样你不用回到本博就可以看到对你评论的回复内容了 <img src="https://s.w.org/images/core/emoji/14.0.0/72x72/1f600.png" alt="😀" class="wp-smiley" style="height: 1em; max-height: 1em;" /></p>
<p><img decoding="async" loading="lazy" alt="IE8可以自动提醒您Web Slices的更新 - 任平生 rpsh.net" src="http://lh3.ggpht.com/_aLmNmqD0H4M/SZPPpJHT83I/AAAAAAAAAp8/VbhIhUO1Gqw/s800/rpsh-comment-web-slice.png" width="540" height="343" /> </p>
<p>如果你也想给你的 WordPress 博客增加这样特性支持，十分容易。首先，我们了解一下 IE8 发现 Web Slices 的机制：</p>
<div style="padding-bottom: 10px; background-color: rgb(47,79,79); padding-left: 10px; padding-right: 10px; font-family: &#39;[object HTMLOptionElement]&#39;, consolas, &#39;Lucida Console&#39;, &#39;Courier New&#39;; padding-top: 10px" class="source"><span style="color: rgb(176,196,222); font-weight: bold">&lt;div</span> <span style="color: rgb(255,255,255)">class=</span><span style="color: rgb(127,255,212)">&quot;hslice&quot;</span> <span style="color: rgb(255,255,255)">id=</span><span style="color: rgb(127,255,212)">&quot;mywebslice&quot;</span><span style="color: rgb(176,196,222); font-weight: bold">&gt;</span> <br /><span style="color: rgb(176,196,222); font-weight: bold">&lt;h1</span> <span style="color: rgb(255,255,255)">class=</span><span style="color: rgb(127,255,212)">&quot;entry-title&quot;</span><span style="color: rgb(176,196,222); font-weight: bold">&gt;</span><span style="color: rgb(245,222,179)">Web Slice 标题</span><span style="color: rgb(176,196,222); font-weight: bold">&lt;/h1&gt;</span> <br /><span style="color: rgb(176,196,222); font-weight: bold">&lt;div</span> <span style="color: rgb(255,255,255)">class=</span><span style="color: rgb(127,255,212)">&quot;entry-content&quot;</span><span style="color: rgb(176,196,222); font-weight: bold">&gt;</span> <br /><span style="color: rgb(245,222,179)">web slice 内容</span> <br /><span style="color: rgb(176,196,222); font-weight: bold">&lt;/div&gt;</span>  <br /><span style="color: rgb(176,196,222); font-weight: bold">&lt;/div&gt;</span></div>
<p>当IE8浏览器浏览这个页面时，发现了html 标签的 class 属性： &quot;hslice” ,&quot;entry-title”,&quot;entry-content”&#160; 按既定顺序出现，并且内容完整，就会将其标记为一个 Web Slice。&#160; 所以，你只需给你的页面添加如 &quot;hslice”，&quot;entry-title”，&quot;entry-content” 的属性就可以让你的页面支持 IE8 的 Web Slices 特性了。(注意：第一行代码中 id 也是必不可少的，id 用来确定一个页面中多个 web slice 的唯一性)</p>
<p>了解了这些，我们就可以对自己的主题文件中的 comments.php 进行修改了，这里提供一个修改后的代码供参考（以默认主题为例）：</p>
<div style="padding-bottom: 10px; background-color: rgb(47,79,79); padding-left: 10px; padding-right: 10px; font-family: &#39;[object HTMLOptionElement]&#39;, consolas, &#39;Lucida Console&#39;, &#39;Courier New&#39;; padding-top: 10px" class="source"><span style="color: rgb(245,222,179)">&lt;li </span><span style="color: rgb(238,238,0)">&lt;?php</span> <span style="color: rgb(176,196,222); font-weight: bold">echo</span> <span style="color: rgb(216,191,216)">$oddcomment</span>;<span style="color: rgb(238,238,0)">?&gt;</span><span style="color: rgb(245,222,179)">id=&quot;comment-</span><span style="color: rgb(238,238,0)">&lt;?php</span> <span style="color: rgb(245,222,179)">comment_ID</span>(<span style="color: rgb(238,238,0)">?&gt;</span><span style="color: rgb(245,222,179)">&quot; <span style="background-color: #1b2c2c">class=&quot;hslice&quot;</span>&gt;</span> <br /><span style="background-color: #1b2c2c"><span style="color: rgb(245,222,179)">&lt;div class=&quot;entry-title&quot; style=&quot;display:none&quot;&gt;</span><span style="color: rgb(238,238,0)">&lt;?php</span> <span style="color: rgb(245,222,179)">comment_author</span>() <span style="color: rgb(238,238,0)">?&gt;</span><span style="color: rgb(245,222,179)"> 的评论&lt;/div&gt;</span></span> <br /><span style="background-color: #1b2c2c; color: rgb(245,222,179)">&lt;div class=&quot;entry-content&quot;&gt;</span> <br /><span style="color: rgb(238,238,0)">&lt;?php</span> <span style="color: rgb(176,196,222); font-weight: bold">echo</span> <span style="color: rgb(245,222,179)">get_avatar</span>( <span style="color: rgb(216,191,216)">$comment</span><span style="color: rgb(245,222,179)">,</span> <span style="color: rgb(173,216,230)">50</span> <span style="color: rgb(238,238,0)">?&gt;</span> <br /><span style="color: rgb(245,222,179)">&lt;cite&gt;</span><span style="color: rgb(238,238,0)">&lt;?php</span> <span style="color: rgb(245,222,179)">comment_author_link</span>(<span style="color: rgb(238,238,0)">?&gt;</span><span style="color: rgb(245,222,179)">&lt;/cite&gt; Says:</span> <br /><span style="color: rgb(238,238,0)">&lt;?php</span> <span style="color: rgb(176,196,222); font-weight: bold">if</span> (<span style="color: rgb(216,191,216)">$comment</span><span style="color: rgb(245,222,179)">-&gt;</span><span style="color: rgb(255,255,255)">comment_approved</span> <span style="color: rgb(245,222,179)">==</span> <span style="color: rgb(127,255,212)">&#8216;0&#8217;</span>)<span style="color: rgb(245,222,179)">:</span> <span style="color: rgb(238,238,0)">?&gt;</span> <br /><span style="color: rgb(245,222,179)">&lt;em&gt;Your comment is awaiting moderation.&lt;/em&gt;</span>  <br /><span style="color: rgb(238,238,0)">&lt;?php</span> <span style="color: rgb(176,196,222); font-weight: bold">endif</span>; <span style="color: rgb(238,238,0)">?&gt;</span>  <br /><span style="color: rgb(245,222,179)">&lt;br /&gt;</span> <br /><span style="color: rgb(245,222,179)">&lt;small class=&quot;commentmetadata&quot;&gt;&lt;a href=&quot;#comment-</span><span style="color: rgb(238,238,0)">&lt;?php</span> <span style="color: rgb(245,222,179)">comment_ID</span>(<span style="color: rgb(238,238,0)">?&gt;</span><span style="color: rgb(245,222,179)">&quot; title=&quot;&quot;&gt;</span><span style="color: rgb(238,238,0)">&lt;?php</span> <span style="color: rgb(245,222,179)">comment_date</span>(<span style="color: rgb(127,255,212)">&#8216;F jS, Y&#8217;</span><span style="color: rgb(238,238,0)">?&gt;</span><span style="color: rgb(245,222,179)"> at </span><span style="color: rgb(238,238,0)">&lt;?php</span> <span style="color: rgb(245,222,179)">comment_time </span><span style="color: rgb(238,238,0)">?&gt;</span><span style="color: rgb(245,222,179)">&lt;/a&gt; </span><span style="color: rgb(238,238,0)">&lt;?php</span> <span style="color: rgb(245,222,179)">edit_comment_link</span>(<span style="color: rgb(127,255,212)">&#8216;edit&#8217;</span><span style="color: rgb(245,222,179)">,</span><span style="color: rgb(127,255,212)">&#8216;&amp;nbsp;&amp;nbsp;&#8217;</span><span style="color: rgb(245,222,179)">,</span><span style="color: rgb(127,255,212)">&#8221;</span>)<span style="color: rgb(238,238,0)">?&gt;</span><span style="color: rgb(245,222,179)">&lt;/small&gt;</span> <br /><span style="color: rgb(238,238,0)">&lt;?php</span> <span style="color: rgb(245,222,179)">comment_text</span>(<span style="color: rgb(238,238,0)">?&gt;</span>  <br /><span style="background-color: #1b2c2c; color: rgb(245,222,179)">&lt;/div&gt;</span>  <br /><span style="color: rgb(245,222,179)">&lt;/li&gt;</span> </div>
<p>&#160;</p>
<p>Web Slices的确是个很棒的功能，它让人们可以订阅网页上自己需要持续关注的某一部分内容的更新而非整个页面，这是RSS所不能及的。如果有更多浏览器支持 Web Slices 特性就好了。</p>
<p>有关 IE8 Web Slices 开发的文档，可到<a href="http://code.msdn.microsoft.com/Release/ProjectReleases.aspx?ProjectName=ie8whitepapers&amp;ReleaseId=567" target="_blank" class="external">这里</a>下载。下边是 IE8 Web Slices 特性的介绍视频：</p>
<div style="text-align: center"><iframe loading="lazy" width="560" height="315" src="https://www.youtube.com/embed/qgsArP6P7iE" frameborder="0" allowfullscreen></iframe></div>
<p>ps. 如果你在浏览本博时发现页面错位，图片错乱等问题，先用 Ctrl + F5 强制刷新页面，如果问题依然存在，请留言告知 <img src="https://s.w.org/images/core/emoji/14.0.0/72x72/1f642.png" alt="🙂" class="wp-smiley" style="height: 1em; max-height: 1em;" /></p>
]]></content:encoded>
					
					<wfw:commentRss>https://rpsh.net/archives/create-web-slices-for-ie8/feed/</wfw:commentRss>
			<slash:comments>45</slash:comments>
		
		
			</item>
		<item>
		<title>根据时间调用不同的CSS文件</title>
		<link>https://rpsh.net/archives/how-to-change-css-according-to-time/</link>
					<comments>https://rpsh.net/archives/how-to-change-css-according-to-time/#comments</comments>
		
		<dc:creator><![CDATA[任平生]]></dc:creator>
		<pubDate>Mon, 22 Dec 2008 01:00:00 +0000</pubDate>
				<category><![CDATA[技术分享]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Theme]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[原创]]></category>
		<guid isPermaLink="false">http://rpsh.net/archives/how-to-change-css-according-to-time/</guid>

					<description><![CDATA[iGoogle 和新发布的 Windows Live Wave3 中都有根据时间调用不同CSS样式的动态主题，想不想也将此效果里用到自己 Blog 上，使用 PHP 函数只需一个小小的修改就可以根据时间调用不同的CSS文件啦]]></description>
										<content:encoded><![CDATA[<p>iGoogle 和新发布的 Windows Live <a href="https://rpsh.net/tag/wave3/">Wave3</a> 中都有根据时间调用不同CSS样式的动态主题，想不想也将此效果里用到自己 Blog 上，只需一个小小的<a href="https://rpsh.net/archives/how-to-change-css-according-to-time/">修改</a>就可以做到啦 <img src="https://s.w.org/images/core/emoji/14.0.0/72x72/1f600.png" alt="😀" class="wp-smiley" style="height: 1em; max-height: 1em;" /></p>
<p><span id="more-206"></span></p>
<p>示例：</p>
<pre><code class="php">&lt;?php ini_set(&quot;date.timezone&quot;,&quot;Asia/Shanghai&quot;); $hc = date(&quot;H&quot;);
  if($hc &gt;= 7 &amp;&amp; $hc &lt; 18)
  echo '&lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;https://rpsh.net/<span style="color: #ff8040">day.css</span>&quot; media=&quot;screen&quot; /&gt;';
  else
  echo '&lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;https://rpsh.net/<span style="color: #ff8040">night.css</span>&quot; media=&quot;screen&quot; /&gt;';
?&gt;</code></pre>
<p>鉴于大多数同学都租用的米国的虚拟主机，所以开始加上一句 ini_set(&quot;date.timezone&quot;,&quot;Asia/Shanghai&quot;) 来让时间设定为咱中国时间，剩下的就很好理解了，7点到18点为白天调用 day.css&#160; 文件，18点到次日7点为夜间调用 night.css 文件。</p>
<p>具体到我们 WordPress ，你可能就要修改你主题 header.php 文件中的调用CSS 文件的部分： </p>
<pre><code class="php">&lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;&lt;?php bloginfo('stylesheet_url'); ?&gt;&quot; media=&quot;screen&quot; /&gt;</code></pre>
<p>为： </p>
<pre><code class="php">&lt;?php ini_set(&quot;date.timezone&quot;,&quot;Asia/Shanghai&quot;); $hc = date(&quot;H&quot;);
  if($hc &gt;= 7 &amp;&amp; $hc &lt; 18)
  echo '&lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;';<br />  echo bloginfo('stylesheet_directory'); <br />  echo '/<span style="color: #ff8040">day</span>.css&quot;';
  else
  echo '/<span style="color: #ff8040">night</span>.css&quot;'<br />  echo 'media=&quot;screen&quot; /&gt;';
?&gt;</code></pre>
<p>* 你需要编写一个 day.css 和一个 night.css 的文件放在你的主题文件夹里。</p>
<p>如果像本 <a href="https://rpsh.net/">Blog</a> 一样只是按时间显示不同的 banner 或 背景图片，CSS文件的其他地方都相同的话，CSS的调用保持不便，只需在你主题 header.php 文件的 &lt;/head&gt;&#160; 之前加入下边的代码即可</p>
<pre><code class="php">&lt;style type=&quot;text/css&quot;&gt;
  body{background: url(&lt;?php ini_set(&quot;date.timezone&quot;,&quot;Asia/Shanghai&quot;); $hc = date(&quot;H&quot;);
  if($hc &gt;= 6 &amp;&amp; $hc &lt; 9)
  echo '图片地址一';
  else if($hc &gt;= 9 &amp;&amp; $hc &lt; 18)
  echo '图片地址一';
  else
  echo '图片地址三';
  ?&gt;) no-repeat scroll center top;}
&lt;/style&gt;</code></pre>
<p>类似的，你还可以写出 早上好，下午好，晚上好 之类的欢迎语~~</p>
<p>如果要根据访问用户的系统时间来做判断的话，就有点麻烦了，需要用 js 来返回用户时间，对这个有要求的，可以请教最近玩 js 走火入魔的 <a target="_blank" href="http://ishawn.net/" class="external">Shawn</a> 大师 <img src="https://s.w.org/images/core/emoji/14.0.0/72x72/1f61b.png" alt="😛" class="wp-smiley" style="height: 1em; max-height: 1em;" /></p>
]]></content:encoded>
					
					<wfw:commentRss>https://rpsh.net/archives/how-to-change-css-according-to-time/feed/</wfw:commentRss>
			<slash:comments>35</slash:comments>
		
		
			</item>
		<item>
		<title>新增朋友页面</title>
		<link>https://rpsh.net/archives/a-new-friends-page/</link>
					<comments>https://rpsh.net/archives/a-new-friends-page/#comments</comments>
		
		<dc:creator><![CDATA[任平生]]></dc:creator>
		<pubDate>Sun, 30 Nov 2008 08:15:33 +0000</pubDate>
				<category><![CDATA[技术分享]]></category>
		<category><![CDATA[r]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[原创]]></category>
		<guid isPermaLink="false">http://rpsh.net/archives/a-new-friends-page/</guid>

					<description><![CDATA[受 Jor 朋友圈 的启发，也想创建一个朋友页面，花了一个晚上，做出了初步效果： 朋友的头像是根据评论数目自动调用。 “朋友们的新鲜事”采用 Google AJAX Feed API 完成。 其中没有 <a class="read-more" href="https://rpsh.net/archives/a-new-friends-page/">查看全文</a>]]></description>
										<content:encoded><![CDATA[<p>受 Jor <a class="external" target="_blank" href="http://jorwang.com/htm/320.htm">朋友圈</a> 的启发，也想创建一个<a target="_blank" href="https://rpsh.net/friends/">朋友页面</a>，花了一个晚上，做出了初步效果：</p>
<p><span id="more-190"></span></p>
<p><img decoding="async" loading="lazy" alt="Friends - 任平生" src="http://lh3.ggpht.com/_aLmNmqD0H4M/STI_wRJTD3I/AAAAAAAAAhs/CuzFepSNEcA/s800/fr.png" width="499" height="542" /> </p>
<p><a href="https://rpsh.net/friends/">朋友</a>的头像是根据评论数目自动调用。 “朋友们的新鲜事”采用 <a class="external" target="_blank" href="http://code.google.com/apis/ajaxfeeds/">Google AJAX Feed API</a> 完成。</p>
<p>其中没有头像的朋友，赶快注册一个 <a href="https://rpsh.net/wordpress/using-gravatar-in-wordpress/">Gravatar 头像</a> 吧，让自己更醒目些 <img src="https://s.w.org/images/core/emoji/14.0.0/72x72/1f642.png" alt="🙂" class="wp-smiley" style="height: 1em; max-height: 1em;" /></p>
<p>&#160;</p>
<p>另外，换这个主题后，favicon 一直没有更换还用得以前旧的，今天也顺道换上了新的：</p>
<p><img decoding="async" loading="lazy" alt="Favicon - Rpsh" src="http://lh6.ggpht.com/_aLmNmqD0H4M/STJBFkix-SI/AAAAAAAAAh0/ng8YvhXbVIY/s800/rpsh.png" width="200" height="200" /></p>
]]></content:encoded>
					
					<wfw:commentRss>https://rpsh.net/archives/a-new-friends-page/feed/</wfw:commentRss>
			<slash:comments>81</slash:comments>
		
		
			</item>
	</channel>
</rss>
