<?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; style</title>
	<atom:link href="http://www.rainmoe.com/tag/style/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.rainmoe.com</link>
	<description>One code, one world ...</description>
	<lastBuildDate>Thu, 29 Dec 2011 14:04:21 +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>让评论的时间日期变得更加有个性化</title>
		<link>http://www.rainmoe.com/2010/08/03/comments-date-style/</link>
		<comments>http://www.rainmoe.com/2010/08/03/comments-date-style/#comments</comments>
		<pubDate>Tue, 03 Aug 2010 15:41:25 +0000</pubDate>
		<dc:creator>小邪</dc:creator>
				<category><![CDATA[代码 [Code]]]></category>
		<category><![CDATA[comments]]></category>
		<category><![CDATA[date]]></category>
		<category><![CDATA[style]]></category>

		<guid isPermaLink="false">http://www.evlos.org/?p=1978</guid>
		<description><![CDATA[> 最近看到一些盆友的博客评论上面有了 “XXX 于 2小时22分钟 之前说” 的字样，例如 万戈 的评论列表。

> 觉得蛮有意思的，不过感觉网上很多方法都不大适合小邪，所以小邪就写了一个函数来显示这效果。



<span class="readmore"><a href="http://www.rainmoe.com/2010/08/03/comments-date-style/" title="让评论的时间日期变得更加有个性化">阅读全文——共2563字</a></span>]]></description>
			<content:encoded><![CDATA[<p>> 最近看到一些盆友的博客评论上面有了 “XXX 于 2小时22分钟 之前说” 的字样，例如 <a target='_blank' rel='nofollow' href='http://wange.im/'>万戈</a> 的评论列表。<br />
> 觉得蛮有意思的，不过感觉网上很多方法都不大适合小邪，所以小邪就写了一个函数来显示这效果。</p>
<p><img src='http://www.rainmoe.com/wp-content/uploads/old/Cap0000726.png' /></p>
<p><span id="more-1978"></span><strong>一. 如何安装：</strong></p>
<p>> 安装是蛮简单的，只要把小邪的函数放到主题函数文件里，然后在需要显示时间的地方调用就 OK 咯。</p>
<pre class="brush: php; auto-links: false; html-script: false; title: ; notranslate">
&lt;?php printf(__('%1$s at %2$s'), get_comment_date(),  get_comment_time()) ?&gt;
//如果你的主题用了回调评论样式的方法，就在 function.php 中找到如上的代码
//类似的也行喔，搜索 get_comment_date() 或者 get_comment_time() 来查找

&lt;?php comment_date(); ?&gt; &lt;?php comment_time(); ?&gt;
//旧的主题可能是上面这个样子

//然后把它们替换成如下代码
&lt;?php evlos_funtime($comment-&gt;comment_date_gmt); ?&gt;
</pre>
<p>> 最后在主题文件夹里面的 function.php 中添加下方代码框中的函数即可，刷新一下就能看到效果鸟。</p>
<pre class="brush: php; auto-links: false; html-script: false; title: ; notranslate">
/* 小邪的个性化评论时间函数 v1.00 Start */
function evlos_funtime($gmto) {
	$set = 24*60*60;
	$info = array(array(86400,'天'),array(3600,'小时'),array(60,'分钟'),array(1,'秒'));
	$gmt = strtotime($gmto);
	$inte = strtotime(gmdate('Y-m-j G:i:s')) - $gmt;
	if (($inte &lt;= $set)&amp;($inte &gt; 0)) {
		foreach ($info as $val) {
			$count = 0;
			while ($inte - $val[0] &gt; 0) {
				$inte = $inte - $val[0];
				$count++;
			}
			if ($count&lt;&gt;0) { $res .= $count.$val[1]; }
		}
		if ($res == '') { $res = '0s'; }
		$res = '于 '.$res.' 之前';
	}
	else {
		$res = date(get_settings('date_format').' \a\t '.get_settings('time_format'),$gmt+get_settings(&quot;gmt_offset&quot;)*3600);
	}
	echo $res;
}
/* 小邪的个性化评论时间函数 v1.00 End */
</pre>
<p><strong>二. 代码解说：</strong></p>
<pre class="brush: php; auto-links: false; html-script: false; title: ; notranslate">
function evlos_funtime($gmto) {
	$set = 24*60*60;
	//注意：在这里设置个性化时间的最大限制
	//比如 24*60*60 就是只对最近 24 小时之内的评论时间进行个性化显示
	//当然也可以使用 3*24*60*60 来表示 3 天之内的评论时间需要个性化显示
	$info = array(array(86400,'天'),array(3600,'小时'),array(60,'分钟'),array(1,'秒'));
	//定义了一些单位，但是考虑到要计算闰年闰月，所以未提供年月的显示
	//有强烈需求的童鞋可以留言 o(*≧▽≦)ツ
	$gmt = strtotime($gmto); //把文本日期转换为数字日期
	$inte = strtotime(gmdate('Y-m-j G:i:s')) - $gmt;
	//使用这种猥琐的方法来取得当前 GMT 时间戳的原因在文章底部 &gt;.&lt;
	if (($inte &lt;= $set)&amp;($inte &gt; 0)) {
		foreach ($info as $val) {
			$count = 0;
			while ($inte - $val[0] &gt; 0) {
				$inte = $inte - $val[0];
				$count++;
			} //分离出各个单位的时间数
			if ($count&lt;&gt;0) { $res .= $count.$val[1]; }
		}
		if ($res == '') { $res = '0s'; } //感谢流年报告BUG，当 $inte 为 0 时，输出 0s
		$res = '于 '.$res.' 之前'; //可自定义输出结果
	}
	else {
		$res = date(get_settings('date_format').' \a\t '.get_settings('time_format'),$gmt+get_settings(&quot;gmt_offset&quot;)*3600);
	} //输出原本格式的时间
	echo $res;
}
</pre>
<p><strong>三. 尾记：</strong></p>
<pre class="brush: php; auto-links: false; html-script: false; title: ; notranslate">
//这段代码应该依次输出 本地时间戳 本地时间戳 GMT时间戳 GMT时间戳
echo time().' '.mktime().' '.gmmktime().' '.strtotime(gmdate('Y-m-j G:i:s'));

//结果在 VPS 上面看到的是 本地时间戳 本地时间戳 本地时间戳 GMT时间戳
//在本地的 PHPNOW 上面看到的是 本地时间戳 本地时间戳 本地时间戳 本地时间戳

//疯掉鸟，PHPNOW的设置的确是有问题的，不过VPS上面也太诡异了吧 (PД`q。)·。'
</pre>
<p>> 写这段尾记的时候，小邪已经被时间的函数弄得完全崩溃鸟，现在意识已经在逐渐消失中，就快翘了。<br />
> 回头要找小邪请烧纸，记得烧几台纸电脑、纸手鸡、再来几台纸服务器就好鸟 ╮(￣▽￣)╭ 哈雷路亚。</p>
<p><strong>四. 收藏：</strong></p>
<pre class="brush: php; auto-links: false; html-script: false; title: ; notranslate">
//Twit-ter 强力推收藏 hoho ^O^

RT @zyy824 RT @pufei: 女版：众里寻他千百度，慕然回首，那人已在三年之前为人父。

RT @DMpat: 女版：众里寻他千百度，蓦然回首，那人已在太监招募处RT  @even5435: 人鬼情未了版：众里寻他（她）千百度，慕然回首，那人已在八宝山革命公墓。RT  @pufei: 男版：众里寻她千百度，慕然回首，那人已在独生子女登记处。 

RT @pufei: 男版：众你寻她千百度，慕然回首，那人已在独生子女登记处。

RT @Angelsolo: 唐僧的紧箍咒内容 - 悟空木有小JJ，悟空木有小JJ ..
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.rainmoe.com/2010/08/03/comments-date-style/feed/</wfw:commentRss>
		<slash:comments>89</slash:comments>
		</item>
		<item>
		<title>如何给站点添加Icon</title>
		<link>http://www.rainmoe.com/2009/10/07/how-to-add-icon-to-website/</link>
		<comments>http://www.rainmoe.com/2009/10/07/how-to-add-icon-to-website/#comments</comments>
		<pubDate>Wed, 07 Oct 2009 12:12:00 +0000</pubDate>
		<dc:creator>小邪</dc:creator>
				<category><![CDATA[代码 [Code]]]></category>
		<category><![CDATA[favicon]]></category>
		<category><![CDATA[icon]]></category>
		<category><![CDATA[style]]></category>
		<category><![CDATA[theme]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://www.evlos.org/?p=399</guid>
		<description><![CDATA[站点的Icon是除了Logo的另一个图形标志

好的Icon能够很快得在收藏夹中凸显出来

本站现在还是暂时使用Inove自带的Icon

<span class="readmore"><a href="http://www.rainmoe.com/2009/10/07/how-to-add-icon-to-website/" title="如何给站点添加Icon">阅读全文——共338字</a></span>]]></description>
			<content:encoded><![CDATA[<p>站点的Icon是除了Logo的另一个图形标志<br />
好的Icon能够很快得在收藏夹中凸显出来<br />
本站现在还是暂时使用Inove自带的Icon<br />
新的Icon正在制作中 </p>
<p><img src="http://www.rainmoe.com/wp-content/uploads/old/Capture273.JPG" /></p>
<p>步骤 For WordPress：<br />
&gt; 只要编辑模板中的Header.php即头部<br />
&gt; 找到标签</p>
<pre class="brush: css; auto-links: false; html-script: false; title: ; notranslate">&lt;title&gt;</pre>
<p>> 当然非Wordpress站点可能在index文件 实际上是title标签在哪就插哪<br />
> 在其<下方新建一行插入以下代码<br />
&gt; 显示页面的时候即会自动使用网站根目录的favicon.ico文件</p>
<pre class="brush: css; auto-links: false; html-script: false; title: ; notranslate">&lt;link rel=&quot;Shortcut Icon&quot; href=&quot;/favicon.ico&quot; type=&quot;image/x-icon&quot; /&gt;</pre>
<p>> 当然你也可以把以下函数加在地址段中 可用来指向当前模板根目录 </p>
<pre class="brush: css; auto-links: false; html-script: false; title: ; notranslate">&lt;?php bloginfo('template_directory');?&gt;</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.rainmoe.com/2009/10/07/how-to-add-icon-to-website/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>怎样给图片加边框</title>
		<link>http://www.rainmoe.com/2009/10/03/add-a-border-to-pic/</link>
		<comments>http://www.rainmoe.com/2009/10/03/add-a-border-to-pic/#comments</comments>
		<pubDate>Sat, 03 Oct 2009 12:49:49 +0000</pubDate>
		<dc:creator>小邪</dc:creator>
				<category><![CDATA[代码 [Code]]]></category>
		<category><![CDATA[style]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://www.evlos.org/?p=33</guid>
		<description><![CDATA[打开模板文件夹里的style.css，然后搜索 img{ 换成以下代码就可以了。



img {

<span class="readmore"><a href="http://www.rainmoe.com/2009/10/03/add-a-border-to-pic/" title="怎样给图片加边框">阅读全文——共185字</a></span>]]></description>
			<content:encoded><![CDATA[<p>打开模板文件夹里的style.css，然后搜索 img{ 换成以下代码就可以了。</p>
<pre class="brush: css; auto-links: false; html-script: false; title: ; notranslate">
img {
border:#cc9 1px solid;
padding:3px;
}
a img {
border-bottom: #b8860b 1px solid;
}
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.rainmoe.com/2009/10/03/add-a-border-to-pic/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using memcached (Feed is rejected)
Page Caching using memcached
Database Caching 1/17 queries in 0.011 seconds using memcached
Object Caching 299/331 objects using memcached

Served from: www.rainmoe.com @ 2012-02-09 16:53:40 -->
