<?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; comment</title>
	<atom:link href="http://www.evlos.org/tag/comment/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.evlos.org</link>
	<description>A straw shows which way the wind blows ..</description>
	<lastBuildDate>Thu, 09 Sep 2010 13:27:04 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>成功把Ajax提交评论效果添加到Zbench</title>
		<link>http://www.evlos.org/2010/07/22/add-ajax-comment-to-zbench/</link>
		<comments>http://www.evlos.org/2010/07/22/add-ajax-comment-to-zbench/#comments</comments>
		<pubDate>Wed, 21 Jul 2010 18:05:25 +0000</pubDate>
		<dc:creator>小邪</dc:creator>
				<category><![CDATA[WP风格 [WP Theme]]]></category>
		<category><![CDATA[ajax]]></category>
		<category><![CDATA[comment]]></category>
		<category><![CDATA[theme]]></category>
		<category><![CDATA[zbench]]></category>

		<guid isPermaLink="false">http://www.evlos.org/?p=1966</guid>
		<description><![CDATA[> 话说小邪碰巧在 5d6d 子论坛看到个很牛的 Ajax 评论提交效果，显示灰常好，与一般提交几乎一样呢。 > 所以立马开始动手折腾。不过具体折腾内容小邪只能透露一部分额，不然影响原作者的销售就不好鸟。 一. 部分 Zbench 的 CSS 修正： > 上次的修改还是木有达到小邪心中的完美样式，所以咱们继续补充，添加 Wp-pagenavi 的 CSS 代码。 1 2 3 4 5 6 7 8 9 10 11 12 13 .wp-pagenavi .page&#123;padding:0 4px;&#125; .wp-pagenavi .pages&#123;padding-right:5px&#125; .wp-pagenavi .current&#123;padding:0 4px;&#125; .wp-pagenavi .nextpostslink&#123;padding:0 4px;&#125; .wp-pagenavi .larger&#123;&#125; .wp-pagenavi .last&#123;padding:0 5px;&#125; //补上 Wp-pagenavi 插件的 CSS &#160; .post [...]]]></description>
			<content:encoded><![CDATA[<p>> 话说小邪碰巧在 5d6d 子论坛看到个很牛的 Ajax 评论提交效果，显示灰常好，与一般提交几乎一样呢。<br />
> 所以立马开始动手折腾。不过具体折腾内容小邪只能透露一部分额，不然影响原作者的销售就不好鸟。</p>
<p><img src='http://www.evlos.org/ev-box/myimg/uploads/old/Cap0000535.png' /></p>
<p><span id="more-1966"></span><strong>一. 部分 Zbench 的 CSS 修正：</strong></p>
<p>> 上次的修改还是木有达到小邪心中的完美样式，所以咱们继续补充，添加 Wp-pagenavi 的 CSS 代码。</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
</pre></td><td class="code"><pre class="css" style="font-family:monospace;"><span style="color: #6666ff;">.wp-pagenavi</span> <span style="color: #6666ff;">.page</span><span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span><span style="color: #cc66cc;">0</span> <span style="color: #933;">4px</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.wp-pagenavi</span> <span style="color: #6666ff;">.pages</span><span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">padding-right</span><span style="color: #00AA00;">:</span><span style="color: #933;">5px</span><span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.wp-pagenavi</span> <span style="color: #6666ff;">.current</span><span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span><span style="color: #cc66cc;">0</span> <span style="color: #933;">4px</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.wp-pagenavi</span> <span style="color: #6666ff;">.nextpostslink</span><span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span><span style="color: #cc66cc;">0</span> <span style="color: #933;">4px</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.wp-pagenavi</span> <span style="color: #6666ff;">.larger</span><span style="color: #00AA00;">&#123;</span><span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.wp-pagenavi</span> <span style="color: #6666ff;">.last</span><span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span><span style="color: #cc66cc;">0</span> <span style="color: #933;">5px</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span>
//补上 Wp-pagenavi 插件的 CSS
&nbsp;
<span style="color: #6666ff;">.post</span> <span style="color: #6666ff;">.entry</span> img<span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">position</span><span style="color: #00AA00;">:</span><span style="color: #993333;">relative</span><span style="color: #00AA00;">;</span>left<span style="color: #00AA00;">:</span><span style="color: #933;">-2px</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span>
//文章中图片整体向左偏移 <span style="color: #933;">2px</span>
&nbsp;
<span style="color: #cc00cc;">#footer-inside</span> <span style="color: #cc00cc;">#back-to-top</span><span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">position</span><span style="color: #00AA00;">:</span><span style="color: #993333;">absolute</span><span style="color: #00AA00;">;</span>top<span style="color: #00AA00;">:</span><span style="color: #933;">5px</span><span style="color: #00AA00;">;</span>right<span style="color: #00AA00;">:</span><span style="color: #933;">10px</span><span style="color: #00AA00;">;</span>font-<span style="color: #000000; font-weight: bold;">size</span><span style="color: #00AA00;">:</span><span style="color: #933;">12px</span><span style="color: #00AA00;">;</span>border<span style="color: #00AA00;">:</span><span style="color: #993333;">none</span><span style="color: #00AA00;">;</span>color<span style="color: #00AA00;">:</span><span style="color: #cc00cc;">#AAA</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span>
//TOP按键向右偏移 <span style="color: #933;">20px</span></pre></td></tr></table></div>

<p><strong>二. Ajax 效果预览：</strong></p>
<p>> 标题下方的图片是进行 AJAX 提交之后的效果图，看起来和无 AJAX 提交的时候的效果几乎一摸一样。<br />
> 下面则是点击提交按键之后的效果，嘎嘎，小邪太鸡冻了。蛋定，蛋定蛋定，春哥保佑，阿门嘎嘎。</p>
<p><img src='http://www.evlos.org/ev-box/myimg/uploads/old/Cap0000534.png' /></p>
<p><strong>三. 添加 Ajax 效果的部分步骤：</strong></p>
<p>> 小邪只能透露一部分的修改过程，需要的童鞋请到 <a target='_blank' rel='nofollow' href='http://zww.me/'>Zww主题大湿</a> 的淘宝店去看看，那里有提供服务。<br />
> 额，虽然那里的效果可能有一点儿不同，不过也是很好滴，下面提供Zww的淘宝店传送门 -</p>
<p>> <a target='_blank' rel='nofollow' href='http://item.taobao.com/auction/item_detail-0db1-f7c8975a70ef482efd2d90754d09a9a5.jhtml'>http://item.taobao.com/auction/item_detail-0db1-f7c8975a70ef482efd2d90754d09a9a5.jhtml</a></p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
</pre></td><td class="code"><pre class="css" style="font-family:monospace;"><span style="color: #cc00cc;">#commentbox_reload</span><span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span><span style="color: #cc00cc;">#F2F2F2</span><span style="color: #00AA00;">;</span>display<span style="color: #00AA00;">:</span><span style="color: #993333;">none</span><span style="color: #00AA00;">;</span>padding-<span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">:</span><span style="color: #933;">10px</span><span style="color: #00AA00;">;</span>border<span style="color: #00AA00;">:</span><span style="color: #933;">1px</span> <span style="color: #993333;">solid</span> <span style="color: #cc00cc;">#ccc</span><span style="color: #00AA00;">;</span>line-<span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span><span style="color: #933;">40px</span><span style="color: #00AA00;">;</span>margin<span style="color: #00AA00;">:</span><span style="color: #933;">10px</span> <span style="color: #993333;">auto</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span>
//首先我们增加一个载入提示框的样式</pre></td></tr></table></div>


<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #339933;">&lt;</span>div id<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;commentbox_reload_con&quot;</span><span style="color: #339933;">&gt;&lt;/</span>div<span style="color: #339933;">&gt;</span>
<span style="color: #096;">//然后用上面的 div 把整个评论列表范围框住以实现 jQuery 的局部刷新</span></pre></td></tr></table></div>


<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #339933;">&lt;</span>script type<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;text/javascript&quot;</span> src<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;http://tool.evlos.org/file/jquery-1.2.6.min.js&quot;</span><span style="color: #339933;">&gt;&lt;/</span>script<span style="color: #339933;">&gt;</span>
<span style="color: #096;">//载入 jQuery 库，使用 1.0 版本以上的皆可以实现</span>
<span style="color: #096;">//再载入包含局部刷新代码的 js 文件，为保护原作者成果这里并不列举</span>
&nbsp;
<span style="color: #339933;">&lt;</span>div id<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;commentbox_reload&quot;</span><span style="color: #339933;">&gt;&lt;/</span>div<span style="color: #339933;">&gt;</span>
<span style="color: #096;">//最后在适当地方加入载入提示框的 div 即可</span></pre></td></tr></table></div>

<p><strong>四. Willin 回复邮件通知 Evlos 样式修改版：</strong></p>
<p>> 嘿嘿，因为木有提供具体的 Ajax 代码，作为补偿。小邪把自己的评论回复邮件通知样式送给大家。</p>
<p><img src='http://www.evlos.org/ev-box/myimg/uploads/old/Cap0000537.png' /></p>
<p>> <a target='_blank' rel='nofollow' href='http://code.google.com/p/evlosbox/downloads/detail?name=cmn_cssed.zip&#038;can=2&#038;q='>http://code.google.com/p/evlosbox/downloads/detail?name=cmn_cssed.zip&#038;can=2&#038;q=</a></p>
<p><strong>五. 附言：</strong></p>
<p>> 参考文章 -<br />
> Comment Mail Notify - <a target='_blank' rel='nofollow' href='http://kan.willin.org/?p=1295'>http://kan.willin.org/?p=1295</a></p>
<p>> 话说某天看到 Lazy_R 在推上说道 -<br />
> “作为一个懒人，我躺在完全没收拾的沙发上，身下压着衣服撑子。我懒得翻身把撑子抽出来。<br />
> 不过我还不是丧心病狂嘛，我还知道把这个发到twitter上，说明我还是有感觉的 …”</p>
<p>> 嘿嘿，当时小邪就 Orz 了。(*￣▽￣)y ~~</p>
]]></content:encoded>
			<wfw:commentRss>http://www.evlos.org/2010/07/22/add-ajax-comment-to-zbench/feed/</wfw:commentRss>
		<slash:comments>115</slash:comments>
		</item>
		<item>
		<title>制作WP评论者邮件地址导出程序</title>
		<link>http://www.evlos.org/2009/12/29/wp-commenters-mails-outputer/</link>
		<comments>http://www.evlos.org/2009/12/29/wp-commenters-mails-outputer/#comments</comments>
		<pubDate>Tue, 29 Dec 2009 10:07:14 +0000</pubDate>
		<dc:creator>小邪</dc:creator>
				<category><![CDATA[小程序 [Lit Work]]]></category>
		<category><![CDATA[comment]]></category>
		<category><![CDATA[info]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://www.evlos.org/?p=1867</guid>
		<description><![CDATA[> 呵呵，新年快到了，因为圣诞节时候小邪给大家的博客全部都发去了圣诞祝福。 > 所以新年祝福小邪就换个方式，发新年贺卡邮件给大家，(*^__^*) 嘻嘻。 > 小邪写了一个小程序，可以导出所有评论者的邮箱列表，然后就可以发贺卡咯。 > 邮箱不要填在收件人那里，要填在密件人，以防被垃圾邮件者得到整个地址列表。 1. 为什么要填在密件人处： > 如果邮箱填在收件人处，那么每个人都能看到你的收件人列表的。 > 小邪不是担心大家做坏事，而是担心一不小心给垃圾邮件发送者拿去。 > 那样他就开心了。因为可能有的童鞋填错邮箱之类的。 > 那么地址列表就会跑到未知的地方，就杯具鸟。 > 最主要的是有的邮件客户端会搞不清楚发件人的，他要是直接在客户端点回复。 > 那么回复邮件的收件人却是所有收件人加上发件人，很诡异的说。 2. 使用方法： > 把源代码保存为PHP文件，然后按照注释修改其中的以下代码。 1 2 3 4 5 6 $db_tab = 'wp_comments';//表名（一般不用修改） $db_url = 'localhost'; //服务器地址（一般不用修改） $db_user = ''; //用户名 $db_psw = ''; //密码 $db_base = 'wordpress';//数据库名 $au_mail = '4tyle8@gmail.com'; //自己的邮箱地址 [...]]]></description>
			<content:encoded><![CDATA[<p>> 呵呵，新年快到了，因为圣诞节时候小邪给大家的博客全部都发去了圣诞祝福。<br />
> 所以新年祝福小邪就换个方式，发新年贺卡邮件给大家，(*^__^*) 嘻嘻。</p>
<p><img src="http://www.evlos.org/ev-box/myimg/uploads/old/Capture0972.jpg" /></p>
<p>> 小邪写了一个小程序，可以导出所有评论者的邮箱列表，然后就可以发贺卡咯。<br />
> 邮箱不要填在收件人那里，要填在密件人，以防被垃圾邮件者得到整个地址列表。</p>
<p><span id="more-1867"></span><strong>1. 为什么要填在密件人处：</strong></p>
<p>> 如果邮箱填在收件人处，那么每个人都能看到你的收件人列表的。</p>
<p>> 小邪不是担心大家做坏事，而是担心一不小心给垃圾邮件发送者拿去。<br />
> 那样他就开心了。因为可能有的童鞋填错邮箱之类的。<br />
> 那么地址列表就会跑到未知的地方，就杯具鸟。</p>
<p>> 最主要的是有的邮件客户端会搞不清楚发件人的，他要是直接在客户端点回复。<br />
> 那么回复邮件的收件人却是所有收件人加上发件人，很诡异的说。</p>
<p><strong>2. 使用方法：</strong></p>
<p>> 把源代码保存为PHP文件，然后按照注释修改其中的以下代码。</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$db_tab</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'wp_comments'</span><span style="color: #339933;">;</span><span style="color: #096;">//表名（一般不用修改）</span>
<span style="color: #000088;">$db_url</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'localhost'</span><span style="color: #339933;">;</span> <span style="color: #096;">//服务器地址（一般不用修改）</span>
<span style="color: #000088;">$db_user</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">''</span><span style="color: #339933;">;</span> <span style="color: #096;">//用户名</span>
<span style="color: #000088;">$db_psw</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">''</span><span style="color: #339933;">;</span> <span style="color: #096;">//密码</span>
<span style="color: #000088;">$db_base</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'wordpress'</span><span style="color: #339933;">;</span><span style="color: #096;">//数据库名</span>
<span style="color: #000088;">$au_mail</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'4tyle8@gmail.com'</span><span style="color: #339933;">;</span> <span style="color: #096;">//自己的邮箱地址</span></pre></td></tr></table></div>

<p><strong>3. 源代码：</strong></p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
&nbsp;
<span style="color: #000088;">$db_url</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'localhost'</span><span style="color: #339933;">;</span> <span style="color: #096;">//服务器地址，一般都是这个</span>
<span style="color: #000088;">$db_user</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">''</span><span style="color: #339933;">;</span> <span style="color: #096;">//用户名</span>
<span style="color: #000088;">$db_psw</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">''</span><span style="color: #339933;">;</span> <span style="color: #096;">//密码</span>
<span style="color: #000088;">$db_base</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'wordpress'</span><span style="color: #339933;">;</span><span style="color: #096;">//数据库名</span>
<span style="color: #000088;">$db_tab</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'wp_comments'</span><span style="color: #339933;">;</span><span style="color: #096;">//表名</span>
<span style="color: #000088;">$au_mail</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'4tyle8@gmail.com'</span><span style="color: #339933;">;</span> <span style="color: #096;">//自己的邮箱地址</span>
&nbsp;
<span style="color: #000088;">$db</span> <span style="color: #339933;">=</span> <span style="color: #990000;">mysql_connect</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$db_url</span><span style="color: #339933;">,</span><span style="color: #000088;">$db_user</span><span style="color: #339933;">,</span><span style="color: #000088;">$db_psw</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">mysql_select_db</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$db_base</span><span style="color: #339933;">,</span><span style="color: #000088;">$db</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000088;">$sql</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;CREATE TABLE <span style="color: #006699; font-weight: bold;">$db_base</span>.`ev_mails` (
	`id` INT(8) NOT NULL AUTO_INCREMENT PRIMARY KEY,
	`mail` TEXT NOT NULL,
	`count` INT(8) NOT NULL
	) ENGINE = MyISAM;&quot;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">mysql_query</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$sql</span><span style="color: #339933;">,</span><span style="color: #000088;">$db</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$db_list</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'comment_author_email'</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">function</span> clear_table<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #000088;">$num</span> <span style="color: #339933;">=</span> count_read<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #000000; font-weight: bold;">global</span> <span style="color: #000088;">$db_tab</span><span style="color: #339933;">,</span><span style="color: #000088;">$db</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$sql</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;DELETE FROM `ev_mails` WHERE count&gt;=0&quot;</span><span style="color: #339933;">;</span>
	<span style="color: #990000;">mysql_query</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$sql</span><span style="color: #339933;">,</span><span style="color: #000088;">$db</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">return</span> <span style="color: #000088;">$num</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">function</span> count_read<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">global</span> <span style="color: #000088;">$db_tab</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$sql</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;SELECT * FROM <span style="color: #006699; font-weight: bold;">$db_tab</span>&quot;</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$query</span> <span style="color: #339933;">=</span> <span style="color: #990000;">mysql_query</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$sql</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$num</span> <span style="color: #339933;">=</span> <span style="color: #990000;">mysql_num_rows</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$query</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">return</span> <span style="color: #000088;">$num</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">function</span> count_evread<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">global</span> <span style="color: #000088;">$db_tab</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$sql</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;SELECT * FROM `ev_mails`&quot;</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$query</span> <span style="color: #339933;">=</span> <span style="color: #990000;">mysql_query</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$sql</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$num</span> <span style="color: #339933;">=</span> <span style="color: #990000;">mysql_num_rows</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$query</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">return</span> <span style="color: #000088;">$num</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
clear_table<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000088;">$end</span> <span style="color: #339933;">=</span> count_read<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot; 
	&quot;http://w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;&gt; 
	&lt;html xmlns=&quot;http://url=w3.org/1999/xhtml&quot;&gt; 
	&lt;head&gt; 
	&lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=utf-8&quot; /&gt;
	&lt;title&gt;邪罗刹的工具箱&lt;/title&gt;
	&lt;style&gt; 
	#main{margin:0 auto;text-align:center;width:650px;color:#777;
	background-color:#eef2fa;border:1px solid #d8e3e8;margin-top:30px;}
	#main .content{text-align:left;padding:30px;}a{color:#777;
	text-decoration:none;}a:hover{color:#444;text-decoration:none;
	}p{padding:0;margin:0;}
	&lt;/style&gt;
	&lt;/head&gt;&lt;body&gt;
	&lt;div id=&quot;main&quot; style=&quot;height:1.5em;color:#777;margin-top:30px;
	margin-bottom:-20px;padding:10px 0;&quot;&gt; 
	&lt;p style=&quot;float:left;padding:0px 20px;&quot;&gt; 
	&lt;a target=&quot;_blank&quot; href=&quot;http://www.evlos.org/&quot;&gt;邪罗刹的菠萝阁&lt;/a&gt; 
	» 评论者邮箱导出工具 Ver 1.10 - 中途请勿刷新 [&lt;a target=&quot;_blank&quot; 
	href=&quot;http://www.evlos.org/2009/12/29/wp-commenters-mails-outputer/&quot;&gt;
	帮助&lt;/a&gt; ]
	&lt;/p&gt;&lt;/div&gt;&lt;div id=&quot;main&quot;&gt;&lt;div class=&quot;content&quot;&gt;'</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #b1b100;">for</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$i</span><span style="color: #339933;">=</span><span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span><span style="color: #000088;">$i</span><span style="color: #339933;">&lt;=</span><span style="color: #000088;">$end</span><span style="color: #339933;">;</span><span style="color: #000088;">$i</span><span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #000088;">$sql</span> <span style="color: #339933;">=</span> <span style="color: #990000;">mysql_query</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;SELECT * FROM <span style="color: #006699; font-weight: bold;">$db_tab</span> WHERE comment_ID = <span style="color: #006699; font-weight: bold;">$i</span>&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$ary</span> <span style="color: #339933;">=</span> <span style="color: #990000;">mysql_fetch_array</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$sql</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;">$ary</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$db_list</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">&lt;&gt;</span><span style="color: #0000ff;">''</span><span style="color: #339933;">&amp;&amp;</span><span style="color: #000088;">$ary</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$db_list</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">&lt;&gt;</span><span style="color: #000088;">$au_mail</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #000088;">$get_mail</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$ary</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$db_list</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
		<span style="color: #000088;">$sqla</span> <span style="color: #339933;">=</span> <span style="color: #990000;">mysql_query</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;SELECT * FROM ev_mails WHERE mail='&quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$get_mail</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;'&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #000088;">$arya</span> <span style="color: #339933;">=</span> <span style="color: #990000;">mysql_fetch_array</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$sqla</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;">$arya</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'mail'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">==</span> <span style="color: #000088;">$ary</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$db_list</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			<span style="color: #000088;">$acount</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$arya</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'count'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">+</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span>
			<span style="color: #000088;">$aid</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$arya</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'id'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
			<span style="color: #990000;">mysql_query</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;UPDATE ev_mails SET count = <span style="color: #006699; font-weight: bold;">$acount</span> WHERE id = <span style="color: #006699; font-weight: bold;">$aid</span>&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
		<span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
			<span style="color: #000088;">$numoo</span> <span style="color: #339933;">=</span> count_evread<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">+</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span>
			<span style="color: #000088;">$sqlb</span> <span style="color: #339933;">=</span> <span style="color: #990000;">mysql_query</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;INSERT INTO ev_mails (id, mail, count)
				VALUES (<span style="color: #006699; font-weight: bold;">$numoo</span>, '<span style="color: #006699; font-weight: bold;">$ary</span>[<span style="color: #006699; font-weight: bold;">$db_list</span>]', 1)&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
		<span style="color: #096;">//echo $num;</span>
	<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #b1b100;">for</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$i</span><span style="color: #339933;">=</span><span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span><span style="color: #000088;">$i</span><span style="color: #339933;">&lt;=</span>count_evread<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><span style="color: #000088;">$i</span><span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #000088;">$sql</span> <span style="color: #339933;">=</span> <span style="color: #990000;">mysql_query</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;SELECT * FROM ev_mails WHERE id = <span style="color: #006699; font-weight: bold;">$i</span>&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$ary</span> <span style="color: #339933;">=</span> <span style="color: #990000;">mysql_fetch_array</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$sql</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">echo</span> <span style="color: #000088;">$ary</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'mail'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">','</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$i</span><span style="color: #339933;">/</span><span style="color: #cc66cc;">3</span> <span style="color: #339933;">==</span> <span style="color: #009900;">&#40;</span>int<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$i</span><span style="color: #339933;">/</span><span style="color: #cc66cc;">3</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'&lt;br /&gt;'</span><span style="color: #339933;">;</span> <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'&lt;/div&gt;&lt;p style=&quot;float:left;width:100%;height:30px;&quot;&gt;
	&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;'</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000088;">$sql</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;DROP TABLE `ev_mails`&quot;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">mysql_query</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$sql</span><span style="color: #339933;">,</span><span style="color: #000088;">$db</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #990000;">mysql_close</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$db</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<p><strong>4. 运行原理：</strong></p>
<p>> 先新建一个空表，然后将所有这个表中不包含的邮件地址添加入这个表。<br />
> 包含了的就不添加了，嘎嘎，就这么简单，完成后输出。<br />
> 输出好了以后就把这个表删除掉，就完工咯，嘿嘿嘿 O(∩_∩)O。</p>
<p>> P.s. 好累，嘎嘎，30分钟赶出来的程序，最近时间紧，小邪好可怜 <img src='http://www.evlos.org/wp-includes/images/smilies/icon_cry.gif' alt=':cry:' class='wp-smiley' /> 。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.evlos.org/2009/12/29/wp-commenters-mails-outputer/feed/</wfw:commentRss>
		<slash:comments>121</slash:comments>
		</item>
		<item>
		<title>为留言本单独倒序评论与分页</title>
		<link>http://www.evlos.org/2009/12/23/choose-comments-order-and-pages-for-guestbook/</link>
		<comments>http://www.evlos.org/2009/12/23/choose-comments-order-and-pages-for-guestbook/#comments</comments>
		<pubDate>Wed, 23 Dec 2009 07:34:32 +0000</pubDate>
		<dc:creator>小邪</dc:creator>
				<category><![CDATA[WP风格 [WP Theme]]]></category>
		<category><![CDATA[comment]]></category>
		<category><![CDATA[guestbook]]></category>
		<category><![CDATA[order]]></category>

		<guid isPermaLink="false">http://www.evlos.org/?p=1725</guid>
		<description><![CDATA[> 刚才小邪在想，如果能为留言本页面指定单独的评论排列顺序与分页设置就好咯。 > 然后就去查了一下官方文档，研究了下 Comments_template() 函数。 > (*^__^*) 现在汇报成果，方法对于修改过模板的童鞋来说绝不是问题。 > P.s. 话说下午又要停电了，听说是哪个地方的变压器遭雷劈了，估计丫装X了哈哈。 1. 首先为留言本单独建立模板： > 先把模版文件夹中，Page.php（页面模板）和 comments.php （评论模板）复制副本。 > Page.php 的副本命名为 gbook.php，然后 comments.php 副本命名为 gbookc.php。 > 然后给 gbook.php 加上格外的页面模板头部，说明此文件为格外的页面模板。 1 2 3 4 5 &#60;?php /* Template Name: Guestbook */ ?&#62; > 把以上代码加到 gbook.php 的顶部，然后进入后台编辑页面处，打开留言本页面。 > 在右边的模板挂件处，选择 Guestbook，此名称与上面代码处相符合。 > 然后修改 gbook.php 指定 gbookc.php 为此模板的评论模板。 1 [...]]]></description>
			<content:encoded><![CDATA[<p>> 刚才小邪在想，如果能为留言本页面指定单独的评论排列顺序与分页设置就好咯。<br />
> 然后就去查了一下官方文档，研究了下 Comments_template() 函数。</p>
<p><img src="http://www.evlos.org/ev-box/myimg/uploads/old/Capture0894.jpg" /></p>
<p>> (*^__^*) 现在汇报成果，方法对于修改过模板的童鞋来说绝不是问题。<br />
> P.s. 话说下午又要停电了，听说是哪个地方的变压器遭雷劈了，估计丫装X了哈哈。</p>
<p><span id="more-1725"></span><strong>1. 首先为留言本单独建立模板：</strong></p>
<p>> 先把模版文件夹中，Page.php（页面模板）和 comments.php （评论模板）复制副本。<br />
> Page.php 的副本命名为 gbook.php，然后 comments.php 副本命名为 gbookc.php。<br />
> 然后给 gbook.php 加上格外的页面模板头部，说明此文件为格外的页面模板。</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #096;">/*
Template Name: Guestbook
*/</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<p>> 把以上代码加到 gbook.php 的顶部，然后进入后台编辑页面处，打开留言本页面。<br />
> 在右边的模板挂件处，选择 Guestbook，此名称与上面代码处相符合。</p>
<p>> 然后修改 gbook.php 指定 gbookc.php 为此模板的评论模板。</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
	<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #990000;">function_exists</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'wp_list_comments'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		comments_template<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">''</span><span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
		comments_template<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<p>> 将上面代码修改为以下的代码即可。</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
	<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #990000;">function_exists</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'wp_list_comments'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		comments_template<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'/gbookc.php'</span><span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
		comments_template<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<p>> 可能有的模板不一样，我们的目标是把下面代码中第一行的内容。<br />
> 修改为第二行的样子，这样就好咯。</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">comments_template<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">''</span><span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
comments_template<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'/gbookc.php'</span><span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>> 然后修改 gbookc.php 的排序问题，单独要设定为倒序。</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">foreach</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$comments</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$comment</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">:</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<p>> 将上面代码修改为下面代码即可，这里是 PHP Foreach 循环。<br />
> 过程是根据数组中每个元素来循环代码块。</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">foreach</span> <span style="color: #009900;">&#40;</span><span style="color: #990000;">array_reverse</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$comments</span><span style="color: #009900;">&#41;</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$comment</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">:</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<p><strong>2. 将留言框提到顶部：</strong></p>
<p>> 这是亮点，对于评论不喜欢分页的童鞋来说，估计能有很大的作用。<br />
> 但是同样的，这也是难点，没修改过模板的童鞋估计很难办。<br />
> 坚持住，胜利就在眼前，勇士们，嘎嘎，冲哇 O(∩_∩)O哈！</p>
<p>> 因为各个模板都是不同的，我这里贴出的是一些特征。</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'open'</span> <span style="color: #339933;">==</span> <span style="color: #000088;">$post</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">comment_status</span> <span style="color: #009900;">&#41;</span> <span style="color: #339933;">:</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
// 中间是评论框体的代码
<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">endif</span> <span style="color: #096;">/* if ( 'open' == $post-&gt;comment_status ) */</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<p>> 把上面的代码移动到下面的代码之下。</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #000088;">$comments</span> <span style="color: #009900;">&#41;</span> <span style="color: #339933;">:</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<p>> 就好了，下面单独给出一些识别各种代码的方法。</p>
<p><strong>3. 如何识别评论框体代码：</strong></p>
<p>> 这些只是一些具有特征性的代码段，不是完整的代码喔。</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'open'</span> <span style="color: #339933;">==</span> <span style="color: #000088;">$post</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">comment_status</span> <span style="color: #009900;">&#41;</span> <span style="color: #339933;">:</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
// 首先会判断是否允许留言
&nbsp;
&lt;div id=&quot;comments-list&quot; class=&quot;comments&quot;&gt;
// 一般来说评论框体的 ID 和 CLASS 都是这样的
&nbsp;
&lt;div class=&quot;comment-text&quot;&gt;
// 你可以在其中看到评论内容的 DIV
&nbsp;
echo('&lt;i&gt;Your comment is awaiting moderation&lt;/i&gt;');
// 也可以看到类似于你的评论正在审核的提示语句
&nbsp;
<span style="color: #000000; font-weight: bold;">&lt;?php</span> comment_author_link<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
// 能看到留言则的网站链接调用代码
&nbsp;
<span style="color: #000000; font-weight: bold;">&lt;?php</span> comment_date<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
// 评论日期的调用代码
&nbsp;
<span style="color: #000000; font-weight: bold;">&lt;?php</span> comment_time<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
// 评论时间的调用代码
&nbsp;
&lt;input id=&quot;submit&quot; name=&quot;submit&quot; type=&quot;submit&quot; 
value=&quot;提交（Ctrl+Enter）&quot; tabindex=&quot;7&quot; accesskey=&quot;P&quot; /&gt;
// 接着再往下就看到了“提交”按键的代码
&nbsp;
&lt;/form&gt;&lt;!-- #commentform --&gt;
// 然后评论框表单被这个代码合上了
&nbsp;
<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">endif</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
// 这个判断结束的标志一般都能在评论框底部代码处找到的
// 这个判断当然是判断是否允许留言的判断咯</pre></td></tr></table></div>

<p><strong>4. 贴贴图，放松一下：</strong></p>
<p>> (*^__^*) 嘻嘻，技术文章老让一些童鞋头疼，贴贴图放松下吧。<br />
> 这些图在电脑里有些时间了，因为最近超级忙的说。<br />
> 只有时间看完博友的博客就下线了，表介意哈。</p>
<p><img src="http://www.evlos.org/ev-box/myimg/uploads/old/Capture0115.jpg" /></p>
<p>> VeryCD 的热门评论呦，嘿嘿嘿。</p>
<p><img src="http://www.evlos.org/ev-box/myimg/uploads/old/Capture0374.jpg" /></p>
<p>> 嘿嘿，无聊的时候大囧国也是个好去处。</p>
<p><img src="http://www.evlos.org/ev-box/myimg/uploads/old/Capture0445.jpg" /></p>
<p>> 这是3位在煎蛋的超级大湿人的真迹呢，看图喔，他们在吟诗作对。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.evlos.org/2009/12/23/choose-comments-order-and-pages-for-guestbook/feed/</wfw:commentRss>
		<slash:comments>87</slash:comments>
		</item>
		<item>
		<title>共享下我的邮件回复通知代码</title>
		<link>http://www.evlos.org/2009/11/30/share-my-comments-reply-mail-sourcecode/</link>
		<comments>http://www.evlos.org/2009/11/30/share-my-comments-reply-mail-sourcecode/#comments</comments>
		<pubDate>Mon, 30 Nov 2009 07:38:57 +0000</pubDate>
		<dc:creator>小邪</dc:creator>
				<category><![CDATA[WP插件 [WP Plugin]]]></category>
		<category><![CDATA[comment]]></category>
		<category><![CDATA[mail]]></category>
		<category><![CDATA[plugins]]></category>
		<category><![CDATA[reply]]></category>
		<category><![CDATA[share]]></category>
		<category><![CDATA[sourcecode]]></category>

		<guid isPermaLink="false">http://www.evlos.org/?p=1244</guid>
		<description><![CDATA[> 昨天星网童鞋留言说想要我的 WP Thread Comment 的邮件回复通知插件的邮件样式的源代码。 > 干脆给大家都共享一下。特地调整了一下代码，我想很多童鞋不喜欢灰朦朦的，就改成兰色啦。 > O(∩_∩)O 好东西就是共享给朋友们一起用的嘛。我的副标题是“4ll f0r on3 , 0ne for a1l ~ !” > 因为宽带忘记缴费了，所以现在使用老爸的3G上网卡，不过他自己也要用，所以写完就下线了。 > 老爸说明天再去缴费，今天很忙，所以大概明天才能继续上网，可能有些任务完成不了了，不好意思。 1. 插件作者关于自动替换字符串的说明： > 1. [pc_date] - 表示父评论的日期 > 2. [pc_content] - 表示父评论的内容 > 3. [cc_author] - 表示子评论的作者 > 4. [cc_date] - 表示子评论的日期 > 5. [cc_url] - 表示子评论的作者链接 > 6. [cc_content] - 表示子评论的内容 [...]]]></description>
			<content:encoded><![CDATA[<p>> 昨天星网童鞋留言说想要我的 WP Thread Comment 的邮件回复通知插件的邮件样式的源代码。<br />
> 干脆给大家都共享一下。特地调整了一下代码，我想很多童鞋不喜欢灰朦朦的，就改成兰色啦。</p>
<p><img src="http://www.evlos.org/ev-box/myimg/uploads/old/Capture0757.jpg" /></p>
<p>> O(∩_∩)O 好东西就是共享给朋友们一起用的嘛。我的副标题是“4ll f0r on3 , 0ne for a1l ~ !”</p>
<p>> 因为宽带忘记缴费了，所以现在使用老爸的3G上网卡，不过他自己也要用，所以写完就下线了。<br />
> 老爸说明天再去缴费，今天很忙，所以大概明天才能继续上网，可能有些任务完成不了了，不好意思。</p>
<p><span id="more-1244"></span>1. <strong>插件作者关于自动替换字符串的说明</strong>：</p>
<p>> 1. [pc_date] - 表示父评论的日期<br />
> 2. [pc_content] - 表示父评论的内容<br />
> 3. [cc_author] - 表示子评论的作者<br />
> 4. [cc_date] - 表示子评论的日期<br />
> 5. [cc_url] - 表示子评论的作者链接<br />
> 6. [cc_content] - 表示子评论的内容<br />
> 7. [commentlink] - 表示父评论的链接<br />
> 8. [blogname] - 表示博客名<br />
> 9. [postname] - 表示文章名</p>
<p>2. <strong>本人在源代码里找到的一些未说明的替换字符串</strong>：</p>
<p>> 1. [pc_author] - 评论留言者名称</p>
<p>3. <strong>我的邮件回复通知代码</strong>：</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
</pre></td><td class="code"><pre class="html" style="font-family:monospace;">&lt;div style=&quot;margin: 1em 40px 1em 40px;background-color:#eef2fa;
border:1px solid #d8e3e8;color:#111;padding: 0 15px;&quot;&gt;
&lt;p&gt;Hi！&lt;strong&gt;[pc_author]&lt;/strong&gt;，你在 &lt;strong&gt;《[postname]》&lt;/strong&gt; 
上的评论有了新回复&lt;/p&gt;
&lt;/div&gt;
&lt;div style=&quot;margin: 1em 40px 1em 40px;background-color:#eef2fa;
border:1px solid #d8e3e8;color:#111;padding: 0 15px;&quot;&gt;
&lt;p&gt;&gt;&gt; &lt;strong&gt;你&lt;/strong&gt; 说：&lt;br /&gt;&lt;br /&gt; [pc_content]&lt;/p&gt;
&lt;p&gt;&gt;&gt; &lt;strong&gt;[cc_author]&lt;/strong&gt; 回复说： &lt;br /&gt;&lt;br /&gt;[cc_content]&lt;/p&gt;
&lt;p&gt;&gt;&gt; 继续围观，请传送至： &lt;a href=&quot;[commentlink]&quot;&gt;[commentlink]&lt;/a&gt;&lt;/p&gt;
&lt;p style=&quot;float:right&quot;&gt; —— From &lt;a href=&quot;http://www.evlos.org/&quot;&gt;
&lt;strong&gt;My Blog&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;
&lt;/div&gt;</pre></td></tr></table></div>

<p>4. <strong>这个是插件中替换字符串的源代码，有兴趣的童鞋可以看看</strong>：</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$mail_subject</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">options</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'mail_subject'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$mail_subject</span> <span style="color: #339933;">=</span> <span style="color: #990000;">str_replace</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'[blogname]'</span><span style="color: #339933;">,</span> get_option<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'blogname'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$mail_subject</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$mail_subject</span> <span style="color: #339933;">=</span> <span style="color: #990000;">str_replace</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'[postname]'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$post</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">post_title</span><span style="color: #339933;">,</span> <span style="color: #000088;">$mail_subject</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000088;">$mail_message</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">options</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'mail_message'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$mail_message</span> <span style="color: #339933;">=</span> <span style="color: #990000;">str_replace</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'[pc_date]'</span><span style="color: #339933;">,</span> 
	mysql2date<span style="color: #009900;">&#40;</span> get_option<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'date_format'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$pc</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">comment_date</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$mail_message</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$mail_message</span> <span style="color: #339933;">=</span> <span style="color: #990000;">str_replace</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'[pc_content]'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$pc</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">comment_content</span><span style="color: #339933;">,</span> <span style="color: #000088;">$mail_message</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$mail_message</span> <span style="color: #339933;">=</span> <span style="color: #990000;">str_replace</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'[pc_author]'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$pc</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">comment_author</span><span style="color: #339933;">,</span> <span style="color: #000088;">$mail_message</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000088;">$mail_message</span> <span style="color: #339933;">=</span> <span style="color: #990000;">str_replace</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'[cc_author]'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$cc</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">comment_author</span><span style="color: #339933;">,</span> <span style="color: #000088;">$mail_message</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$mail_message</span> <span style="color: #339933;">=</span> <span style="color: #990000;">str_replace</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'[cc_date]'</span><span style="color: #339933;">,</span> 
	mysql2date<span style="color: #009900;">&#40;</span> get_option<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'date_format'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$cc</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">comment_date</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$mail_message</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$mail_message</span> <span style="color: #339933;">=</span> <span style="color: #990000;">str_replace</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'[cc_url]'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$cc</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">comment_url</span><span style="color: #339933;">,</span> <span style="color: #000088;">$mail_message</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$mail_message</span> <span style="color: #339933;">=</span> <span style="color: #990000;">str_replace</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'[cc_content]'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$cc</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">comment_content</span><span style="color: #339933;">,</span> <span style="color: #000088;">$mail_message</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000088;">$mail_message</span> <span style="color: #339933;">=</span> <span style="color: #990000;">str_replace</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'[blogname]'</span><span style="color: #339933;">,</span> get_option<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'blogname'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$mail_message</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$mail_message</span> <span style="color: #339933;">=</span> <span style="color: #990000;">str_replace</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'[blogurl]'</span><span style="color: #339933;">,</span> get_option<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'home'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$mail_message</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$mail_message</span> <span style="color: #339933;">=</span> <span style="color: #990000;">str_replace</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'[postname]'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$post</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">post_title</span><span style="color: #339933;">,</span> <span style="color: #000088;">$mail_message</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000088;">$permalink</span> <span style="color: #339933;">=</span> get_permalink<span style="color: #009900;">&#40;</span><span style="color: #000088;">$comment_post_id</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://www.evlos.org/2009/11/30/share-my-comments-reply-mail-sourcecode/feed/</wfw:commentRss>
		<slash:comments>68</slash:comments>
		</item>
		<item>
		<title>最近垃圾评论很是猖狂</title>
		<link>http://www.evlos.org/2009/11/09/comment-spam-is-rampant/</link>
		<comments>http://www.evlos.org/2009/11/09/comment-spam-is-rampant/#comments</comments>
		<pubDate>Mon, 09 Nov 2009 12:15:12 +0000</pubDate>
		<dc:creator>小邪</dc:creator>
				<category><![CDATA[站内 [Website]]]></category>
		<category><![CDATA[akimat]]></category>
		<category><![CDATA[cache]]></category>
		<category><![CDATA[comment]]></category>
		<category><![CDATA[plugins]]></category>
		<category><![CDATA[spam]]></category>
		<category><![CDATA[speed]]></category>

		<guid isPermaLink="false">http://www.evlos.org/?p=887</guid>
		<description><![CDATA[> 话说最近垃圾评论超级猖狂的，半天就给我发了61条。 > 而且貌似还都是属于同一个域名下的。嘎嘎，这个人好热情。 > 然后，我屏蔽了那个域名，很有效的说 O(∩_∩)O 哈哈。 > 好几天一点垃圾评论都没有啦。 ╮(╯▽╰)╭ > 最近老是担心这个拖慢网站速度，那个拖慢网站速度的。没办法，就喜欢高速高效的东西。 > 然后我网站上基本上不引用任何外部网站的东西，像站长统计、微博挂件都不敢放。 > 还把Akimat都关了，貌似每次发评论都要经过它的服务器过滤。 > 然后我开了3个缓存插件，缓存数据库查询、博客页面、博客挂件。 > 嘿嘿，看样子速度还是不错滴，蛮让人满意的，数据库查询到了最低点呢。]]></description>
			<content:encoded><![CDATA[<p>> 话说最近垃圾评论超级猖狂的，半天就给我发了61条。<br />
> 而且貌似还都是属于同一个域名下的。嘎嘎，这个人好热情。</p>
<p><img src="http://www.evlos.org/ev-box/myimg/uploads/old/Capture0159.jpg" /></p>
<p>> 然后，我屏蔽了那个域名，很有效的说 O(∩_∩)O 哈哈。<br />
> 好几天一点垃圾评论都没有啦。 ╮(╯▽╰)╭</p>
<p>> 最近老是担心这个拖慢网站速度，那个拖慢网站速度的。没办法，就喜欢高速高效的东西。<br />
> 然后我网站上基本上不引用任何外部网站的东西，像站长统计、微博挂件都不敢放。<br />
> 还把Akimat都关了，貌似每次发评论都要经过它的服务器过滤。<br />
> 然后我开了3个缓存插件，缓存数据库查询、博客页面、博客挂件。<br />
> 嘿嘿，看样子速度还是不错滴，蛮让人满意的，数据库查询到了最低点呢。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.evlos.org/2009/11/09/comment-spam-is-rampant/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>iNove的简单缓存头像法</title>
		<link>http://www.evlos.org/2009/10/26/inove-gravatar-simple/</link>
		<comments>http://www.evlos.org/2009/10/26/inove-gravatar-simple/#comments</comments>
		<pubDate>Mon, 26 Oct 2009 14:35:55 +0000</pubDate>
		<dc:creator>小邪</dc:creator>
				<category><![CDATA[WP风格 [WP Theme]]]></category>
		<category><![CDATA[cache]]></category>
		<category><![CDATA[comment]]></category>
		<category><![CDATA[inove]]></category>
		<category><![CDATA[theme]]></category>

		<guid isPermaLink="false">http://www.evlos.org/?p=637</guid>
		<description><![CDATA[我发现我的方法和whisperer童鞋的方法是不同的 但是还是有蛮多人按照他的方法 虽然他的方法使用的代码非常容易理解和阅读 但是貌似有些过长鸟 打开模板目录里的主题支持函数 (functions.php)文件 1 2 3 4 &#60;div class=&#34;pic&#34;&#62; &#60;?php if &#40;function_exists&#40;'get_avatar'&#41; &#38;&#38; get_option&#40;'show_avatars'&#41;&#41; &#123; echo get_avatar&#40;$comment, 32&#41;; &#125; ?&#62; &#60;/div&#62; 然后按照如下改动即可 1 2 3 4 &#60;div class=&#34;pic&#34;&#62; &#60;img src=&#34;你的缓存头像目录/cache/avatar/ &#60;?php echo md5&#40;strtolower&#40;$comment-&#62;comment_author_email&#41;&#41;; ?&#62;&#34; alt=&#34;&#34; /&#62; &#60;/div&#62; 嘿嘿 搞定鸟]]></description>
			<content:encoded><![CDATA[<p>我发现我的方法和whisperer童鞋的方法是不同的<br />
但是还是有蛮多人按照他的方法<br />
虽然他的方法使用的代码非常容易理解和阅读<br />
但是貌似有些过长鸟 </p>
<p>打开模板目录里的主题支持函数 (functions.php)文件</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">&lt;div class=&quot;pic&quot;&gt;
<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: #990000;">function_exists</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'get_avatar'</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;&amp;</span> get_option<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'show_avatars'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> 
<span style="color: #009900;">&#123;</span> <span style="color: #b1b100;">echo</span> get_avatar<span style="color: #009900;">&#40;</span><span style="color: #000088;">$comment</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">32</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #009900;">&#125;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
&lt;/div&gt;</pre></td></tr></table></div>

<p>然后按照如下改动即可 <span id="more-637"></span></p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">&lt;div class=&quot;pic&quot;&gt;
&lt;img src=&quot;你的缓存头像目录/cache/avatar/
<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #990000;">md5</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">strtolower</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$comment</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">comment_author_email</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot; alt=&quot;&quot; /&gt;
&lt;/div&gt;</pre></td></tr></table></div>

<p>嘿嘿 搞定鸟 </p>
]]></content:encoded>
			<wfw:commentRss>http://www.evlos.org/2009/10/26/inove-gravatar-simple/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>给ElegantBox缓存评论头像</title>
		<link>http://www.evlos.org/2009/10/26/elegantbox-gravatar/</link>
		<comments>http://www.evlos.org/2009/10/26/elegantbox-gravatar/#comments</comments>
		<pubDate>Mon, 26 Oct 2009 14:27:50 +0000</pubDate>
		<dc:creator>小邪</dc:creator>
				<category><![CDATA[WP风格 [WP Theme]]]></category>
		<category><![CDATA[box]]></category>
		<category><![CDATA[cache]]></category>
		<category><![CDATA[comment]]></category>
		<category><![CDATA[elegant]]></category>
		<category><![CDATA[theme]]></category>

		<guid isPermaLink="false">http://www.evlos.org/?p=636</guid>
		<description><![CDATA[打开主题目录里的主题支持函数 (functions.php)文件 然后开始看代码 1 2 3 4 5 6 7 8 9 10 &#60;?php // WordPress 2.5 or higher if &#40;function_exists&#40;'get_avatar'&#41; &#38;&#38; get_option&#40;'show_avatars'&#41;&#41; &#123; echo '&#60;div class=&#34;userpic&#34;&#62;'; echo get_avatar&#40;$comment, 24&#41;; echo '&#60;/div&#62;'; // WordPress 2.3.3 or lower &#125; else if &#40;function_exists&#40;'gravatar'&#41;&#41; &#123; echo '&#60;div class=&#34;userpic&#34;&#62;&#60;img class=&#34;avatar&#34; src=&#34;'; gravatar&#40;&#34;G&#34;, 24&#41;; echo '&#34; alt=&#34;avatar&#34; /&#62;&#60;/div&#62;'; &#125; ?&#62; [...]]]></description>
			<content:encoded><![CDATA[<p>打开主题目录里的主题支持函数 (functions.php)文件<br />
然后开始看代码</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #096;">// WordPress 2.5 or higher</span>
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #990000;">function_exists</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'get_avatar'</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;&amp;</span> get_option<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'show_avatars'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'&lt;div class=&quot;userpic&quot;&gt;'</span><span style="color: #339933;">;</span> <span style="color: #b1b100;">echo</span> get_avatar<span style="color: #009900;">&#40;</span><span style="color: #000088;">$comment</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">24</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'&lt;/div&gt;'</span><span style="color: #339933;">;</span>
<span style="color: #096;">// WordPress 2.3.3 or lower</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: #990000;">function_exists</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'gravatar'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'&lt;div class=&quot;userpic&quot;&gt;&lt;img class=&quot;avatar&quot; src=&quot;'</span><span style="color: #339933;">;</span> 
		gravatar<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;G&quot;</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">24</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'&quot; alt=&quot;avatar&quot; /&gt;&lt;/div&gt;'</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<p>这里和iNove完全不一样<br />
所以要做如下修改 <span id="more-636"></span></p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #096;">// WordPress 2.5 or higher</span>
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #990000;">function_exists</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'get_avatar'</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;&amp;</span> get_option<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'show_avatars'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'&lt;div class=&quot;userpic&quot;&gt;
	&lt;img src=&quot;你的头像缓存目录/cache/avatar/'</span><span style="color: #339933;">.</span> 
	<span style="color: #990000;">md5</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">strtolower</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$comment</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">comment_author_email</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span><span style="color: #0000ff;">'&quot; alt=&quot;&quot; 
	height=&quot;24&quot; width=&quot;24&quot; /&gt;&lt;/div&gt;'</span><span style="color: #339933;">;</span>
<span style="color: #096;">// WordPress 2.3.3 or lower</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: #990000;">function_exists</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'gravatar'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'&lt;div class=&quot;userpic&quot;&gt;&lt;img class=&quot;avatar&quot; src=&quot;'</span><span style="color: #339933;">;</span> 
		gravatar<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;G&quot;</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">24</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'&quot; alt=&quot;avatar&quot; /&gt;&lt;/div&gt;'</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<p>这里不能像我修改recent-comments插件似地<br />
在这里是无法使用$mail的<br />
所以我们用$comment->comment_author_email<br />
完工鸟 ~~<br />
　</p>
]]></content:encoded>
			<wfw:commentRss>http://www.evlos.org/2009/10/26/elegantbox-gravatar/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>缓存Wp-recentcomments头像</title>
		<link>http://www.evlos.org/2009/10/12/wp-recentcomments-avatar-cache/</link>
		<comments>http://www.evlos.org/2009/10/12/wp-recentcomments-avatar-cache/#comments</comments>
		<pubDate>Mon, 12 Oct 2009 11:53:21 +0000</pubDate>
		<dc:creator>小邪</dc:creator>
				<category><![CDATA[WP风格 [WP Theme]]]></category>
		<category><![CDATA[cache]]></category>
		<category><![CDATA[comment]]></category>
		<category><![CDATA[gravatar]]></category>
		<category><![CDATA[plugins]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://www.evlos.org/?p=547</guid>
		<description><![CDATA[网上大多都是直接引用 [/cache/avatar/] 目录的头像 但是这个插件涉及到PHP字符串 新手可能会搞糊涂 在这里稍微提示下 此插件的作者Mg12的注解很规范 看 [Core.php] 代码 1 2 3 4 5 // 当不包含默认头像时 &#125; else &#123; $avatar = '&#60;div class=&#34;rc_avatar rc_' . $position . '&#34;&#62; ' . get_avatar&#40;$email, $size&#41; . '&#60;/div&#62;'; &#125; 我们需要修改下字符串 在PHP里的"."符号是连接字符串的意思 所以我们要在DIV标签后面加上IMG标签 这里的md5函数需要进行PHP运算 所以要在单引号的外面 1 2 3 4 5 // 当不包含默认头像时 &#125; else &#123; $avatar = '&#60;div class=&#34;rc_avatar [...]]]></description>
			<content:encoded><![CDATA[<p>网上大多都是直接引用 [/cache/avatar/] 目录的头像<br />
但是这个插件涉及到PHP字符串<br />
新手可能会搞糊涂  在这里稍微提示下<br />
此插件的作者Mg12的注解很规范  看 [Core.php] 代码</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #096;">// 当不包含默认头像时</span>
<span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
<span style="color: #000088;">$avatar</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'&lt;div class=&quot;rc_avatar rc_'</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$position</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'&quot;&gt;
'</span> <span style="color: #339933;">.</span> get_avatar<span style="color: #009900;">&#40;</span><span style="color: #000088;">$email</span><span style="color: #339933;">,</span> <span style="color: #000088;">$size</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'&lt;/div&gt;'</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>我们需要修改下字符串<br />
在PHP里的"."符号是连接字符串的意思<br />
所以我们要在DIV标签后面加上IMG标签<br />
这里的md5函数需要进行PHP运算 所以要在单引号的外面</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #096;">// 当不包含默认头像时</span>
<span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
<span style="color: #000088;">$avatar</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'&lt;div class=&quot;rc_avatar rc_'</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$position</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'&quot;&gt;
&lt;img src=&quot;缓存插件目录/cache/avatar/'</span><span style="color: #339933;">.</span> <span style="color: #990000;">md5</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">strtolower</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$email</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span><span style="color: #0000ff;">'&quot; /&gt;&lt;/div&gt;'</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://www.evlos.org/2009/10/12/wp-recentcomments-avatar-cache/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>如何设置Gravatar</title>
		<link>http://www.evlos.org/2009/10/06/how-to-create-a-gravatar/</link>
		<comments>http://www.evlos.org/2009/10/06/how-to-create-a-gravatar/#comments</comments>
		<pubDate>Wed, 07 Oct 2009 03:04:54 +0000</pubDate>
		<dc:creator>小邪</dc:creator>
				<category><![CDATA[探索 [Explore]]]></category>
		<category><![CDATA[comment]]></category>
		<category><![CDATA[gravatar]]></category>
		<category><![CDATA[mail]]></category>

		<guid isPermaLink="false">http://www.evlos.org/?p=334</guid>
		<description><![CDATA[什么是Gravatar： &#62; 当你在别人的博客留言时 &#62; 只需输入正确的E-mail地址即可显示自己事先设定好的头像 &#62;&#62; 送给 Xue.Xin 步骤： &#62; 首先进入http://en.gravatar.com/ - 暂时不支持中文 &#62; 点击 Gat your gravatar &#62; 输入你的E-mail地址 &#62; 点击 Sign Up &#62; Confirmation email sent! 表示你得到邮箱里去收封确认信 &#62; 你会收到一封 Welcome to Gravatar 的信 &#62; 点击类似于如下的长链接 &#62; http://en.gravatar.com/accounts/activate/xxxx%40gmail.com/69aad2bd11 &#62; 在Username里填入用户名 Password里填入密码 输俩次 密码一定要字母与数字混合 &#62; 点击 Add one by clicking here! &#62; 点击 My computer's [...]]]></description>
			<content:encoded><![CDATA[<p>什么是Gravatar：<br />
&gt; 当你在别人的博客留言时<br />
&gt; 只需输入正确的E-mail地址即可显示自己事先设定好的头像</p>
<p>&gt;&gt; 送给 Xue.Xin </p>
<p>步骤：<br />
&gt; 首先进入<a href="http://en.gravatar.com/">http://en.gravatar.com/</a> - 暂时不支持中文<br />
&gt; 点击 Gat your gravatar<br />
&gt; 输入你的E-mail地址<br />
&gt; 点击 Sign Up<br />
&gt; Confirmation email sent! 表示你得到邮箱里去收封确认信<br />
&gt; 你会收到一封 Welcome to Gravatar 的信<br />
&gt; 点击类似于如下的长链接<br />
&gt; http://en.gravatar.com/accounts/activate/xxxx%40gmail.com/69aad2bd11<br />
&gt; 在Username里填入用户名 Password里填入密码 输俩次 密码一定要字母与数字混合<br />
&gt; 点击 Add one by clicking here!<br />
&gt; 点击 My computer's hard drive 在你电脑里选择头像的位置<br />
&gt; 点击 Next<br />
&gt; 把要当做头像的图片部分用框选择起来<br />
&gt; 点击 G 表示通用头像 - 下面有更多解释<br />
&gt; 成功 在下面留言可以测试下</p>
<p><span id="more-334"></span><br />
附录：<br />
A G rated gravatar is suitable for display on all websites with any audience type.<br />
&gt; 普通级别，不包含成人元素,任何年龄的访客都适合查看。<br />
PG rated gravatars may contain rude gestures, provocatively dressed individuals, the lesser swear words, or mild violence.<br />
&gt; 有一定争议性的头像，只适合13岁以上查看。<br />
R rated gravatars may contain such things as harsh profanity, intense violence, nudity, or hard drug use.<br />
&gt; 成人级，只适合17岁以上成年人查看。<br />
X rated gravatars may contain hardcore sexual imagery or extremely disturbing violence.<br />
&gt; 最高等级，不适合大多数人查看。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.evlos.org/2009/10/06/how-to-create-a-gravatar/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>回复邮件通知被当成垃圾邮件</title>
		<link>http://www.evlos.org/2009/10/04/avert-replymail-as-rubbish/</link>
		<comments>http://www.evlos.org/2009/10/04/avert-replymail-as-rubbish/#comments</comments>
		<pubDate>Sun, 04 Oct 2009 14:48:28 +0000</pubDate>
		<dc:creator>小邪</dc:creator>
				<category><![CDATA[站内 [Website]]]></category>
		<category><![CDATA[comment]]></category>
		<category><![CDATA[mail]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://www.evlos.org/?p=174</guid>
		<description><![CDATA[刚刚安装了回复邮件通知[Mail To Commenter]插件， 结果发出去的邮件被当成了垃圾邮件， 因为发件人是邪罗刹的菠萝阁@主机域名.com。 Update : 最重要的一点绝对不要开启Autoptimize 不然你会疯掉的 我这俩个插件冲突 折磨了我一晚上 Update : 原来太懒了 不想修改插件 现在花了点时间自己搞定了 其实只要把sendmail函数修改下就好了]]></description>
			<content:encoded><![CDATA[<p>刚刚安装了回复邮件通知[Mail To Commenter]插件，<br />
结果发出去的邮件被当成了垃圾邮件，<br />
因为发件人是邪罗刹的菠萝阁@主机域名.com。</p>
<p>Update :<br />
最重要的一点绝对不要开启Autoptimize 不然你会疯掉的<br />
我这俩个插件冲突 折磨了我一晚上</p>
<p>Update :<br />
原来太懒了 不想修改插件<br />
现在花了点时间自己搞定了<br />
其实只要把sendmail函数修改下就好了</p>
]]></content:encoded>
			<wfw:commentRss>http://www.evlos.org/2009/10/04/avert-replymail-as-rubbish/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
	</channel>
</rss>
