<?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>冰水博客-关注电子商务,互联网,Web开发IT博客 &#187; wp-grin</title>
	<atom:link href="http://www.willice.com/tag/wp-grin/feed" rel="self" type="application/rss+xml" />
	<link>http://www.willice.com</link>
	<description>just go my way！</description>
	<lastBuildDate>Sun, 11 Jan 2009 10:25:30 +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://www.willice.com/2008/10/wordpress-theme-expression-comments.html</link>
		<comments>http://www.willice.com/2008/10/wordpress-theme-expression-comments.html#comments</comments>
		<pubDate>Mon, 27 Oct 2008 09:06:55 +0000</pubDate>
		<dc:creator>冰水</dc:creator>
				<category><![CDATA[技术水贴]]></category>
		<category><![CDATA[wordpress]]></category>
		<category><![CDATA[wp-grin]]></category>
		<category><![CDATA[插件]]></category>
		<category><![CDATA[表情]]></category>

		<guid isPermaLink="false">http://www.willice.com/?p=101</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=&#8221;&#60;?php echo get_option(’siteurl’); ?&#62;/wp-comments-post.php&#8221;
 
和
 
&#60;textarea name=&#8220;
 
记录下两行后面各自的name=“值”的值，再查找smiley.php中：
 
var txtarea = document.comments_form.comment;
 
和
 
caretPos.comment = caretPos.comment.charAt(caretPos.text.length &#8211; 1) ==
 
将其相对应的红色、蓝色部分修改。
 

查找comments.php中：

 
&#60;textarea name=&#8221;
 
将
 
&#60;?php include (TEMPLATEPATH . ‘/smiley.php’); ?&#62;
 
该行代码添加到先前代码之前。这样就修改好了你的主题(theme)。
 

smiley.rar  下载
smiley.zip  下载

原文：http://blog.9-i.cn/log/631988.html
]]></description>
		<wfw:commentRss>http://www.willice.com/2008/10/wordpress-theme-expression-comments.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
