<?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; JavaScript</title>
	<atom:link href="http://itrss.net/post/tag/javascript/feed/" rel="self" type="application/rss+xml" />
	<link>http://itrss.net</link>
	<description>快速、新鲜、有趣的互联网资讯 - Internet information Digest!</description>
	<lastBuildDate>Sat, 23 Jan 2010 05:43:01 +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>WordPress Theme 评论表情(smilies)功能增强页面</title>
		<link>http://itrss.net/post/wordpress-theme-comment-expressions-smilies-enhanced-pages/</link>
		<comments>http://itrss.net/post/wordpress-theme-comment-expressions-smilies-enhanced-pages/#comments</comments>
		<pubDate>Mon, 25 Aug 2008 12:40:44 +0000</pubDate>
		<dc:creator>酷米</dc:creator>
				<category><![CDATA[视频部落]]></category>
		<category><![CDATA[alexking]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[js]]></category>
		<category><![CDATA[smiley]]></category>
		<category><![CDATA[smilies]]></category>
		<category><![CDATA[theme]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[wp-grin]]></category>
		<category><![CDATA[主题]]></category>
		<category><![CDATA[插件]]></category>
		<category><![CDATA[表情]]></category>

		<guid isPermaLink="false">http://itrss.net/post/wordpress-theme-comment-expressions-smilies-enhanced-pages/</guid>
		<description><![CDATA[使用WordPress的很多用户都知道，alexking为WordPress写了一个表情插件wp-grin，能让你在撰写日志和评论的时候以所见即所得的方式添加WordPress自带的表情符。但是在奇趣资讯所使用的LightBreaker主题中wp-grin一只都不能被调用成功，索性我就放弃了wp-grin，自己用JavaScript写了一个smiley.php页面，在评论的textarea上面调用。
直接在主题(theme)中嵌入页面与安装wp-grin插件相比，有一些优点：

使用简单的一个JavaScript函数，基本不会影响页面速度。 
出错少，不会出现像插件调用的兼容性问题。 
减少插件的使用，会提高WordPress的速度。 

当然在使用该功能页面上，也会稍微麻烦点。使用方法请大家看下面：

将smiley.php页面下载并放到你所使用主题(theme)的目录下。 
打开comments.php页面，根据comments.php页面相关内容，修改smiley.php页面(可根据smiley.php页面内相关行的注释说明进行。
查找comments.php中：
&#60;form action=&#34;&#60;?php echo get_option(&#8217;siteurl&#8217;); ?&#62;/wp-comments-post.php&#34;
和
&#60;textarea name=&#34;

记录下两行后面各自的name=&#8220;值&#8221;的值，再查找smiley.php中：
var txtarea = document.comments_form.comment;
和
caretPos.comment = caretPos.comment.charAt(caretPos.text.length &#8211; 1) ==

将其相对应的红色、蓝色部分修改。

查找comments.php中： 

&#60;textarea name=&#34;

将
&#60;?php include (TEMPLATEPATH . &#8216;/smiley.php&#8217;); ?&#62;

该行代码添加到先前代码之前。这样就修改好了你的主题(theme)。


smiley.rar&#160; 下载 
smiley.zip&#160; 下载 

文章评论：2008-08-27, freesky 评论道: 不错哈，原创的！ :lol:2008-08-27, 酷米 评论道: :grin: 呵呵，没事儿写个东西。2008-08-29, WordPress Theme 表情功能增强页面模板 - WordPress中文站 评论道: [...] 酷米的办法是制作了一个单独的带有表情功能的评论模板。实际上，这是将这个插件的代码直接嵌入到主题模板的内部，这样做比通过插件来实现更有效率。这样做的效率更高一些，不过使用过程也稍微复杂一些。详细的办法请参考酷米的文章：WordPress Theme 评论表情(smilies)功能增强页面。 [...]2008-09-18, Wanghui 评论道: 1  我的模板中 &#60;form action="/wp-comments-post.php" [...]]]></description>
			<content:encoded><![CDATA[<p>使用WordPress的很多用户都知道，<a href="http://alexking.org/projects/wordpress" target="_blank">alexking</a>为WordPress写了一个表情插件<em><a href="http://alexking.org/projects/wordpress/plugins/wp-grins.zip" target="_blank">wp-grin</a></em>，能让你在撰写日志和评论的时候以所见即所得的方式添加WordPress自带的表情符。但是在奇趣资讯所使用的LightBreaker主题中<em><a href="http://alexking.org/projects/wordpress/plugins/wp-grins.zip" target="_blank">wp-grin</a></em>一只都不能被调用成功，索性我就放弃了<em><a href="http://alexking.org/projects/wordpress/plugins/wp-grins.zip" target="_blank">wp-grin</a></em>，自己用JavaScript写了一个smiley.php页面，在评论的textarea上面调用。</p>
<p>直接在主题(theme)中嵌入页面与安装<em><a href="http://alexking.org/projects/wordpress/plugins/wp-grins.zip" target="_blank">wp-grin</a></em>插件相比，有一些优点：</p>
<ol>
<li>使用简单的一个JavaScript函数，基本不会影响页面速度。 </li>
<li>出错少，不会出现像插件调用的兼容性问题。 </li>
<li>减少插件的使用，会提高WordPress的速度。 </li>
</ol>
<p>当然在使用该功能页面上，也会稍微麻烦点。使用方法请大家看下面：</p>
<ol>
<li><font color="#554400">将smiley.php页面下载并放到你所使用主题(theme)的目录下。</font> </li>
<li>打开comments.php页面，根据comments.php页面相关内容，修改smiley.php页面(可根据smiley.php页面内相关行的注释说明进行。
<p><font color="#554400">查找comments.php中：</font></p>
<blockquote><p><font color="#554400">&lt;form action=&quot;&lt;?php echo get_option(&#8217;siteurl&#8217;); ?&gt;/wp-comments-post.php&quot;</font></p>
<p><font color="#554400">和</font></p>
<p>&lt;textarea name=<font color="#554400">&quot;</font></p>
</blockquote>
<p>记录下两行后面各自的name=&#8220;值&#8221;的值，再查找smiley.php中：</p>
<blockquote><p>var txtarea = document.<font color="#ff0080">comments_form</font>.<font color="#0000ff">comment</font>;</p>
<p>和</p>
<p>caretPos.<font color="#0000ff">comment</font> = caretPos.<font color="#0000ff">comment</font>.charAt(caretPos.text.length &#8211; 1) ==</p>
</blockquote>
<p>将其相对应的红色、蓝色部分修改。</p>
</li>
<li>查找comments.php中： </li>
</ol>
<blockquote><p>&lt;textarea name=&quot;</p>
</blockquote>
<p>将</p>
<blockquote><p>&lt;?php include (TEMPLATEPATH . &#8216;/smiley.php&#8217;); ?&gt;</p>
</blockquote>
<p><font color="#776644">该行代码添加到先前代码之前。这样就修改好了你的主题(theme)。</font></p>
<ol></ol>
<ol>
<li><a href="http://blog.9-i.cn/wp-content/uploads/3/344/2008/08/smiley.rar" target="_blank">smiley.rar&#160; 下载</a> </li>
<li><a href="http://blog.9-i.cn/wp-content/uploads/3/344/2008/08/smiley.zip" target="_blank">smiley.zip&#160; 下载</a> </li>
</ol>
<hr /><h2>文章评论：</h2><ul><li><a href="http://itrss.net/post/wordpress-theme-comment-expressions-smilies-enhanced-pages/#comment-381">2008-08-27</a>, <a href='http://itrss.net/?r=http://www.freerainbow.cn' rel='external nofollow' class='url'>freesky</a> 评论道: 不错哈，原创的！ :lol:</li><li><a href="http://itrss.net/post/wordpress-theme-comment-expressions-smilies-enhanced-pages/#comment-383">2008-08-27</a>, <a href='http://itrss.net/?r=http://blog.9-i.cn' rel='external nofollow' class='url'>酷米</a> 评论道: :grin: 呵呵，没事儿写个东西。</li><li><a href="http://itrss.net/post/wordpress-theme-comment-expressions-smilies-enhanced-pages/#comment-384">2008-08-29</a>, <a href='http://itrss.net/?r=http://wpchina.org/wordpress-theme-comment-expressions-smilies-enhanced-pages-339/' rel='external nofollow' class='url'>WordPress Theme 表情功能增强页面模板 - WordPress中文站</a> 评论道: [...] 酷米的办法是制作了一个单独的带有表情功能的评论模板。实际上，这是将这个插件的代码直接嵌入到主题模板的内部，这样做比通过插件来实现更有效率。这样做的效率更高一些，不过使用过程也稍微复杂一些。详细的办法请参考酷米的文章：WordPress Theme 评论表情(smilies)功能增强页面。 [...]</li><li><a href="http://itrss.net/post/wordpress-theme-comment-expressions-smilies-enhanced-pages/#comment-410">2008-09-18</a>, Wanghui 评论道: 1  我的模板中 &lt;form action="/wp-comments-post.php" 之后没有name=
之后只有id=
在 &lt;textarea name=" 之后就是 comment。不需要修改
2  我的用了之后可以显示出来表情，但是鼠标无法将表情点到评论文字中，请问是怎么回事？</li><li><a href="http://itrss.net/post/wordpress-theme-comment-expressions-smilies-enhanced-pages/#comment-411">2008-09-19</a>, <a href='http://itrss.net/?r=http://blog.9-i.cn' rel='external nofollow' class='url'>酷米</a> 评论道: 你自己添加一个name属性就是了，你添加之后看看能不能显示表情，如果还不行我在帮你看看。</li><li><a href="http://itrss.net/post/wordpress-theme-comment-expressions-smilies-enhanced-pages/#comment-412">2008-09-19</a>, wanghui 评论道: 已经解决，谢谢。</li><li><a href="http://itrss.net/post/wordpress-theme-comment-expressions-smilies-enhanced-pages/#comment-413">2008-09-20</a>, <a href='http://itrss.net/?r=http://blog.9-i.cn' rel='external nofollow' class='url'>酷米</a> 评论道: :grin: 不用谢！</li><li><a href="http://itrss.net/post/wordpress-theme-comment-expressions-smilies-enhanced-pages/#comment-446">2008-10-15</a>, <a href='http://itrss.net/?r=http://z' rel='external nofollow' class='url'>zzz</a> 评论道: 红色、蓝色部分修改成什么？</li><li><a href="http://itrss.net/post/wordpress-theme-comment-expressions-smilies-enhanced-pages/#comment-447">2008-10-15</a>, <a href='http://itrss.net/?r=http://blog.9-i.cn' rel='external nofollow' class='url'>酷米</a> 评论道: ＜form action=”/wp-comments-post.php” 这个标签 之后的name值对应红色
＜textarea name=”这个标签 之后name值对应蓝色


 :grin:</li><li><a href="http://itrss.net/post/wordpress-theme-comment-expressions-smilies-enhanced-pages/#comment-448">2008-10-15</a>, <a href='http://itrss.net/?r=http://zz' rel='external nofollow' class='url'>zzz</a> 评论道: o...ty
怎样删除这个
功能
    * 注册
    * 登录
    * 文章 RSS &lt;--- 删除这个?
    * 评论 RSS &lt;---删除这个?
    * WordPress.org &lt;----删除这个?</li><li><a href="http://itrss.net/post/wordpress-theme-comment-expressions-smilies-enhanced-pages/#comment-449">2008-10-15</a>, <a href='http://itrss.net/?r=http://blog.9-i.cn' rel='external nofollow' class='url'>酷米</a> 评论道: 你是通过widget加入到侧边栏的还是 模板默认的？ 如果模板支持Widget 你可以直接在 主题 - Widget里面设置你希望显示在侧边栏的项。
 :smile:</li><li><a href="http://itrss.net/post/wordpress-theme-comment-expressions-smilies-enhanced-pages/#comment-450">2008-10-15</a>, <a href='http://itrss.net/?r=http://zz' rel='external nofollow' class='url'>zzz</a> 评论道: Meta
标题：功能

              移出罢了

保存修改


 :?:  :?:  :?:  :?: 

什么办法？？？ * WordPress.org 你怎样弄没有的&gt;&gt;&gt;?*</li><li><a href="http://itrss.net/post/wordpress-theme-comment-expressions-smilies-enhanced-pages/#comment-451">2008-10-15</a>, <a href='http://itrss.net/?r=http://blog.9-i.cn' rel='external nofollow' class='url'>酷米</a> 评论道: 你检查一下你的 连接 里面有没有 WordPress.org   有的话你把它删除

你的blog地址呢？能否看看？ :smile:</li><li><a href="http://itrss.net/post/wordpress-theme-comment-expressions-smilies-enhanced-pages/#comment-462">2008-10-22</a>, aa 评论道: :eek:  我的为什么还不能显示？</li><li><a href="http://itrss.net/post/wordpress-theme-comment-expressions-smilies-enhanced-pages/#comment-463">2008-10-22</a>, <a href='http://itrss.net/?r=http://blog.9-i.cn' rel='external nofollow' class='url'>酷米</a> 评论道: 请问你现在是什么情况？</li><li><a href="http://itrss.net/post/wordpress-theme-comment-expressions-smilies-enhanced-pages/#comment-464">2008-10-23</a>, <a href='http://itrss.net/?r=http://blog.junghae.cn' rel='external nofollow' class='url'>Junghae</a> 评论道: Warning: Division by zero in /home/junghae/public_html/blog/wp-content/themes/MusicExplorer/comments.php on line 70

Warning: include(/home/junghae/public_html/blog/wp-content/themes/MusicExplorerphp’) [function.include]: failed to open stream: No such file or directory in /home/junghae/public_html/blog/wp-content/themes/MusicExplorer/comments.php on line 70

Warning: include() [function.include]: Failed opening '/home/junghae/public_html/blog/wp-content/themes/MusicExplorerphp’' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/junghae/public_html/blog/wp-content/themes/MusicExplorer/comments.php on line 70

帮我看下,我这个是什么情况</li><li><a href="http://itrss.net/post/wordpress-theme-comment-expressions-smilies-enhanced-pages/#comment-465">2008-10-23</a>, <a href='http://itrss.net/?r=http://blog.junghae.cn' rel='external nofollow' class='url'>Junghae</a> 评论道: 发现了,我是直接复制你的调用函数的:
符号错了,应该是这样,呵呵: :lol:</li><li><a href="http://itrss.net/post/wordpress-theme-comment-expressions-smilies-enhanced-pages/#comment-466">2008-10-24</a>, <a href='http://itrss.net/?r=http://blog.9-i.cn' rel='external nofollow' class='url'>酷米</a> 评论道: :grin: 解决了就好。呵呵</li><li><a href="http://itrss.net/post/wordpress-theme-comment-expressions-smilies-enhanced-pages/#comment-472">2008-10-27</a>, <a href='http://itrss.net/?r=http://www.willice.com' rel='external nofollow' class='url'>冰水</a> 评论道: 插件太多影响速度，酷米这个方法不错，转了~呵呵</li><li><a href="http://itrss.net/post/wordpress-theme-comment-expressions-smilies-enhanced-pages/#comment-473">2008-10-27</a>, <a href='http://itrss.net/?r=http://www.willice.com/2008/10/wordpress-theme-expression-comments.html' rel='external nofollow' class='url'>冰水博客 &raquo; Blog Archive &raquo; WordPress Theme 评论表情(smilies)功能增强页面</a> 评论道: [...] 来源：http://itrss.net/post/wordpress-theme-comment-expressions-smilies-enhanced-pages/  addthis_url = 'http%3A%2F%2Fwww.willice.com%2F2008%2F10%2Fwordpress-theme-expression-comments.html'; addthis_title = 'WordPress+Theme+%E8%AF%84%E8%AE%BA%E8%A1%A8%E6%83%85%28smilies%29%E5%8A%9F%E8%83%BD%E5%A2%9E%E5%BC%BA%E9%A1%B5%E9%9D%A2'; addthis_pub = ''; [...]</li><li><a href="http://itrss.net/post/wordpress-theme-comment-expressions-smilies-enhanced-pages/#comment-474">2008-10-27</a>, <a href='http://itrss.net/?r=http://blog.9-i.cn' rel='external nofollow' class='url'>酷米</a> 评论道: :lol: 谢谢冰水支持！</li><li><a href="http://itrss.net/post/wordpress-theme-comment-expressions-smilies-enhanced-pages/#comment-515">2009-02-06</a>, <a href='http://itrss.net/?r=http://blog.xilibi.com' rel='external nofollow' class='url'>Eric.X</a> 评论道: 能够显示表情，但是点击后不能添加到留言框里，麻烦看一下</li><li><a href="http://itrss.net/post/wordpress-theme-comment-expressions-smilies-enhanced-pages/#comment-516">2009-03-02</a>, <a href='http://itrss.net/?r=http://blog.9-i.cn' rel='external nofollow' class='url'>酷米</a> 评论道: 你可以注意一下我 演示代码中 红色和蓝色的部分。和你使用的主题评论页面的input 和 textarea 标签中的 id和name是否对应修改成功 :razz:</li></ul><hr /><h2>相关文章</h2><ul>
<!-- Generated by Simple Tags 1.7.4.4 - http://wordpress.org/extend/plugins/simple-tags -->
	<h4>相关文章</h4>
	<ul class="st-related-posts">
	<li><a href="http://itrss.net/post/information-specific-to-combine-theme-itrssnet-v2-release/" title="奇趣资讯专用主题-ITRSS.Net v2 发布 (2008-09-26)">奇趣资讯专用主题-ITRSS.Net v2 发布</a> (4)</li>
	<li><a href="http://itrss.net/post/i-use-the-plug-in-wordpress/" title="我使用的wordpress插件 (2008-02-05)">我使用的wordpress插件</a> (3)</li>
	<li><a href="http://itrss.net/post/the-olympic-games-slogan-nearly-20/" title="历届奥运会主题口号（近20年） (2008-04-10)">历届奥运会主题口号（近20年）</a> (2)</li>
	<li><a href="http://itrss.net/post/authorware-spread-function-download/" title="Authorware扩展函数下载 (2008-04-25)">Authorware扩展函数下载</a> (0)</li>
</ul>

</ul><hr /><small>本站遵循&nbsp;:&nbsp;<a rel="license" href="http://creativecommons.org/licenses/by-nc-nd/2.5/cn/" target="_blank"><img alt="Creative Commons License" src="http://i.creativecommons.org/l/by-nc-nd/2.5/cn/80x15.png" /></a> Copyright &copy; 2008 By&nbsp;: <a href="http://itrss.net" target="_blank">奇趣资讯</a> 作者:<a href="http://blog.9-i.cn" target="_blank">KooMi&nbsp;(酷米)</a> | <a href="http://koore.yo2.cn" target="_blank">Koore</a> | <a href="http://feed.feedsky.com/itrss" target="_blank">Feed订阅</a> <br>数字指纹: e241ea0ea5385ea3d05af58bec9a1679 (38.107.191.104) </small>
	Tags: <a href="http://itrss.net/post/tag/alexking/" title="alexking" rel="tag nofollow">alexking</a>, <a href="http://itrss.net/post/tag/javascript/" title="JavaScript" rel="tag nofollow">JavaScript</a>, <a href="http://itrss.net/post/tag/js/" title="js" rel="tag nofollow">js</a>, <a href="http://itrss.net/post/tag/smiley/" title="smiley" rel="tag nofollow">smiley</a>, <a href="http://itrss.net/post/tag/smilies/" title="smilies" rel="tag nofollow">smilies</a>, <a href="http://itrss.net/post/tag/theme/" title="theme" rel="tag nofollow">theme</a>, <a href="http://itrss.net/post/tag/wordpress/" title="Wordpress" rel="tag nofollow">Wordpress</a>, <a href="http://itrss.net/post/tag/wp-grin/" title="wp-grin" rel="tag nofollow">wp-grin</a>, <a href="http://itrss.net/post/tag/%e4%b8%bb%e9%a2%98/" title="主题" rel="tag nofollow">主题</a>, <a href="http://itrss.net/post/tag/%e6%8f%92%e4%bb%b6/" title="插件" rel="tag nofollow">插件</a>, <a href="http://itrss.net/post/tag/%e8%a1%a8%e6%83%85/" title="表情" rel="tag nofollow">表情</a><br />

	<h4>相关文章</h4>
	<ul class="st-related-posts">
	<li><a href="http://itrss.net/post/information-specific-to-combine-theme-itrssnet-v2-release/" title="奇趣资讯专用主题-ITRSS.Net v2 发布 (2008-09-26)">奇趣资讯专用主题-ITRSS.Net v2 发布</a> (4)</li>
	<li><a href="http://itrss.net/post/i-use-the-plug-in-wordpress/" title="我使用的wordpress插件 (2008-02-05)">我使用的wordpress插件</a> (3)</li>
	<li><a href="http://itrss.net/post/the-olympic-games-slogan-nearly-20/" title="历届奥运会主题口号（近20年） (2008-04-10)">历届奥运会主题口号（近20年）</a> (2)</li>
	<li><a href="http://itrss.net/post/authorware-spread-function-download/" title="Authorware扩展函数下载 (2008-04-25)">Authorware扩展函数下载</a> (0)</li>
</ul>

]]></content:encoded>
			<wfw:commentRss>http://itrss.net/post/wordpress-theme-comment-expressions-smilies-enhanced-pages/feed/</wfw:commentRss>
		<slash:comments>23</slash:comments>
		</item>
	</channel>
</rss>
