<?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; 发表评论</title>
	<atom:link href="http://www.happyet.org/tag/%e5%8f%91%e8%a1%a8%e8%af%84%e8%ae%ba/feed" rel="self" type="application/rss+xml" />
	<link>http://www.happyet.org</link>
	<description>自娱自乐，不亦乐乎!</description>
	<lastBuildDate>Fri, 10 Sep 2010 00:30:36 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>利用jQuery提高访客评论的用户体验</title>
		<link>http://www.happyet.org/247.html</link>
		<comments>http://www.happyet.org/247.html#comments</comments>
		<pubDate>Thu, 09 Jul 2009 05:56:30 +0000</pubDate>
		<dc:creator>LMS</dc:creator>
				<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[体验]]></category>
		<category><![CDATA[发表评论]]></category>
		<category><![CDATA[技巧]]></category>

		<guid isPermaLink="false">http://www.happyet.com.cn/archives/247</guid>
		<description><![CDATA[好吧，我承认，今天是第二次从immmmm那直接复制粘贴文章过来了，可是没办法，实在是太喜欢这个功能了，在好几个wp博客上发现过这个功能，正好想找的时候被我遇到了，而且我也已经加上了这个功能了，不管是出于以后修改方便，还是其他什么原因，反正我是决定要转过来了。
这篇文章说的是：访客留言之后资料输入框会被隐藏起来, 如同登录了一般. 访客可以选择修改相关资料再进行评论. 给予访客很好的用户体验。一个相当实用的提高访客评论用户体验功能。
在comments.php文件里你自己的输入评论昵称，邮件，网址的那段代码处用以下代码覆盖，然后适当修改css文件就OK了，效果你可以评论一下就知道了。

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
&#60;!-- 有资料的访客 --&#62;
&#60;?php if &#40; $comment_author != &#34;&#34; &#41; : ?&#62;
    &#60;script type=&#34;text/javascript&#34;&#62;function setStyleDisplay(id, status){document.getElementById(id).style.display = status;}&#60;/script&#62;
    &#60;div class=&#34;form_row small&#34;&#62;
        &#60;?php printf&#40;__&#40;'Welcome back &#60;strong&#62;%s&#60;/strong&#62;.'&#41;, $comment_author&#41; ?&#62;
        &#60;span id=&#34;show_author_info&#34;&#62;&#60;a href=&#34;javascript:setStyleDisplay('author_info','');setStyleDisplay('show_author_info','none');setStyleDisplay('hide_author_info','');&#34;&#62;&#60;?php _e&#40;'Change &#38;raquo;'&#41;; ?&#62;&#60;/a&#62;&#60;/span&#62;
 [...]]]></description>
			<content:encoded><![CDATA[<p>好吧，我承认，今天是第二次从<a href="http://immmmm.com" target="_blank">immmmm</a>那直接复制粘贴文章过来了，可是没办法，实在是太喜欢这个功能了，在好几个wp博客上发现过这个功能，正好想找的时候被我遇到了，而且我也已经加上了这个功能了，不管是出于以后修改方便，还是其他什么原因，反正我是决定要转过来了。</p>
<p>这篇文章说的是：访客留言之后资料输入框会被隐藏起来, 如同登录了一般. 访客可以选择修改相关资料再进行评论. 给予访客很好的用户体验。一个相当实用的提高访客评论用户体验功能。</p>
<p>在comments.php文件里你自己的输入评论昵称，邮件，网址的那段代码处用以下代码覆盖，然后适当修改css文件就OK了，效果你可以评论一下就知道了。</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
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">&lt;!-- 有资料的访客 --&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: #000088;">$comment_author</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: #000000; font-weight: bold;">?&gt;</span>
    &lt;script type=&quot;text/javascript&quot;&gt;function setStyleDisplay(id, status){document.getElementById(id).style.display = status;}&lt;/script&gt;
    &lt;div class=&quot;form_row small&quot;&gt;
        <span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #990000;">printf</span><span style="color: #009900;">&#40;</span>__<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Welcome back &lt;strong&gt;%s&lt;/strong&gt;.'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$comment_author</span><span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
        &lt;span id=&quot;show_author_info&quot;&gt;&lt;a href=&quot;javascript:setStyleDisplay('author_info','');setStyleDisplay('show_author_info','none');setStyleDisplay('hide_author_info','');&quot;&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> _e<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Change &amp;raquo;'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/a&gt;&lt;/span&gt;
        &lt;span id=&quot;hide_author_info&quot;&gt;&lt;a href=&quot;javascript:setStyleDisplay('author_info','none');setStyleDisplay('show_author_info','');setStyleDisplay('hide_author_info','none');&quot;&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> _e<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Close &amp;raquo;'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/a&gt;&lt;/span&gt;
    &lt;/div&gt;
<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">endif</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
&nbsp;
&lt;!-- 资料输入框 --&gt;
&lt;div id=&quot;author_info&quot;&gt;
    &lt;input type=&quot;text&quot; name=&quot;author&quot; id=&quot;author&quot; value=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$comment_author</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot; tabindex=&quot;1&quot; /&gt;
    &lt;label for=&quot;author&quot; class=&quot;small&quot;&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> _e<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Name'</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;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$req</span><span style="color: #009900;">&#41;</span> _e<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'(required)'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/label&gt;
&nbsp;
    &lt;input type=&quot;text&quot; name=&quot;email&quot; id=&quot;email&quot; value=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$comment_author_email</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot; tabindex=&quot;2&quot; /&gt;
    &lt;label for=&quot;email&quot; class=&quot;small&quot;&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> _e<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'E-Mail (will not be published)'</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;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$req</span><span style="color: #009900;">&#41;</span> _e<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'(required)'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/label&gt;
&nbsp;
    &lt;input type=&quot;text&quot; name=&quot;url&quot; id=&quot;url&quot; value=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$comment_author_url</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot; tabindex=&quot;3&quot; /&gt;
    &lt;label for=&quot;url&quot; class=&quot;small&quot;&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> _e<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Website'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/label&gt;
&lt;/div&gt;
&nbsp;
&lt;!-- 有资料的访客 --&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: #000088;">$comment_author</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: #000000; font-weight: bold;">?&gt;</span>
    &lt;script type=&quot;text/javascript&quot;&gt;setStyleDisplay('hide_author_info','none');setStyleDisplay('author_info','none');&lt;/script&gt;
<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">endif</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<p>原文地址：http://immmmm.com/using-jquery-to-improve-experience.html</p>
]]></content:encoded>
			<wfw:commentRss>http://www.happyet.org/247.html/feed</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>给wordpress添加Ctrl+Enter快捷发表评论功能的两种方法</title>
		<link>http://www.happyet.org/244.html</link>
		<comments>http://www.happyet.org/244.html#comments</comments>
		<pubDate>Tue, 07 Jul 2009 05:09:50 +0000</pubDate>
		<dc:creator>LMS</dc:creator>
				<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[Ctrl+Enter]]></category>
		<category><![CDATA[发表评论]]></category>

		<guid isPermaLink="false">http://www.happyet.com.cn/archives/244</guid>
		<description><![CDATA[经常逛论坛的人一般都习惯评论完后直接按ctrl+enter提交评论，使用QQ聊天时也是这样，打完字随手按下快捷键搞定，其实通过加入js代码，在wordpress评论时也可以实现这个功能。（注意代码中的全角都要改为半角）
方法一、在wordpress的comments.php里&#60;/form&#62;&#60;/div&#62;&#60;?php endif; ?&#62;后插入如下js代码也可以实现这个功能：

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
&#60;script type=&#34;text/javascript&#34;&#62;
document.getElementById&#40;&#34;comment&#34;&#41;.onkeydown = function &#40;moz_ev&#41;
&#123;
var ev = null;
if &#40;window.event&#41;&#123;
ev = window.event;
&#125;else&#123;
ev = moz_ev;
&#125;
if &#40;ev != null &#38;&#38; ev.ctrlKey &#38;&#38; ev.keyCode == 13&#41;
&#123;
document.getElementById&#40;&#34;submit&#34;&#41;.click&#40;&#41;;
&#125;
&#125;
&#60;/script&#62;

然后继续在comments.php文件中找到下面这句：

&#60;p&#62;&#60;input name=&#34;submit&#34; type=&#34;submit&#34; id=&#34;submit&#34; class=&#34;submitbutton&#34; tabindex=&#34;5&#34; value=&#34;Leave comment&#34; /&#62;

将value=”Leave comment”（不同的主题可能会有些差别，其实就是提交的那个按扭）的value值里加上一个(Ctrl+Enter)，改成value=”Leave comment (Ctrl+Enter)”
本文章转自：http://www.yueye.org/2009/use-ctrl-enter-to-submit-comments-for-wordpress.html
方法二、此法更为简洁，强烈推荐使用
在 comments.php 中找到以下代码：

&#60;textarea name=&#34;comment&#34; id=&#34;comment&#34; cols=&#34;105&#34; rows=&#34;10&#34;tabindex=&#34;4&#34;&#62;&#60;/textarea&#62;

修改为：

&#60;textarea name=&#34;comment&#34; id=&#34;comment&#34; cols=&#34;105&#34; rows=&#34;10&#34;tabindex=&#34;4&#34;
onkeydown=&#34;if(event.ctrlKey&#38;&#38;event.keyCode==13)
{document.getElementById('submit').click();return false};&#34;&#62;&#60;/textarea&#62;

此方法为木木同学发明，发布在万戈那的。
]]></description>
			<content:encoded><![CDATA[<p>经常逛论坛的人一般都习惯评论完后直接按ctrl+enter提交评论，使用QQ聊天时也是这样，打完字随手按下快捷键搞定，其实通过加入js代码，在wordpress评论时也可以实现这个功能。（注意代码中的全角都要改为半角）</p>
<p><strong>方法一、</strong>在wordpress的comments.php里&lt;/form&gt;&lt;/div&gt;&lt;?php endif; ?&gt;后插入如下js代码也可以实现这个功能：</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
</pre></td><td class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #339933;">&lt;</span>script type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text/javascript&quot;</span><span style="color: #339933;">&gt;</span>
document.<span style="color: #660066;">getElementById</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;comment&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">onkeydown</span> <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">function</span> <span style="color: #009900;">&#40;</span>moz_ev<span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
<span style="color: #003366; font-weight: bold;">var</span> ev <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">null</span><span style="color: #339933;">;</span>
<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>window.<span style="color: #660066;">event</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
ev <span style="color: #339933;">=</span> window.<span style="color: #660066;">event</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #000066; font-weight: bold;">else</span><span style="color: #009900;">&#123;</span>
ev <span style="color: #339933;">=</span> moz_ev<span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>ev <span style="color: #339933;">!=</span> <span style="color: #003366; font-weight: bold;">null</span> <span style="color: #339933;">&amp;&amp;</span> ev.<span style="color: #660066;">ctrlKey</span> <span style="color: #339933;">&amp;&amp;</span> ev.<span style="color: #660066;">keyCode</span> <span style="color: #339933;">==</span> <span style="color: #CC0000;">13</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
document.<span style="color: #660066;">getElementById</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;submit&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">click</span><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: #009900;">&#125;</span>
<span style="color: #339933;">&lt;/</span>script<span style="color: #339933;">&gt;</span></pre></td></tr></table></div>

<p>然后继续在comments.php文件中找到下面这句：</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #339933;">&lt;</span>p<span style="color: #339933;">&gt;&lt;</span>input name<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;submit&quot;</span> type<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;submit&quot;</span> id<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;submit&quot;</span> <span style="color: #000000; font-weight: bold;">class</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;submitbutton&quot;</span> tabindex<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;5&quot;</span> value<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;Leave comment&quot;</span> <span style="color: #339933;">/&gt;</span></pre></div></div>

<p>将value=”Leave comment”（不同的主题可能会有些差别，其实就是提交的那个按扭）的value值里加上一个(Ctrl+Enter)，改成value=”Leave comment (Ctrl+Enter)”</p>
<p>本文章转自：http://www.yueye.org/2009/use-ctrl-enter-to-submit-comments-for-wordpress.html</p>
<p><strong>方法二、</strong>此法更为简洁，强烈推荐使用</p>
<p>在 comments.php 中找到以下代码：</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #339933;">&lt;</span>textarea name<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;comment&quot;</span> id<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;comment&quot;</span> cols<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;105&quot;</span> rows<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;10&quot;</span>tabindex<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;4&quot;</span><span style="color: #339933;">&gt;&lt;/</span>textarea<span style="color: #339933;">&gt;</span></pre></div></div>

<p>修改为：</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #339933;">&lt;</span>textarea name<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;comment&quot;</span> id<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;comment&quot;</span> cols<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;105&quot;</span> rows<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;10&quot;</span>tabindex<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;4&quot;</span>
onkeydown<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;if(event.ctrlKey&amp;&amp;event.keyCode==13)
{document.getElementById('submit').click();return false};&quot;</span><span style="color: #339933;">&gt;&lt;/</span>textarea<span style="color: #339933;">&gt;</span></pre></div></div>

<p>此方法为<a href="http://immmmm.com" target="_blank">木木</a>同学发明，发布在<a href="http://www.life-studio.cn/use-ctrl-enter-to-submit-comments-for-wordpress.html" target="_blank">万戈</a>那的。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.happyet.org/244.html/feed</wfw:commentRss>
		<slash:comments>20</slash:comments>
		</item>
	</channel>
</rss>
