Quantcast
Viewing latest article 10
Browse Latest Browse All 10

WordPress插件: WP Smilies

English user please navigates to http://wordpress.org/extend/plugins/wp-smilies/  for instruction.

Latest Update: 2009-01-04

1. 如果不想点击表情后,将页面移动到评论框,请在line21,’{$value}’\”部分的$value}’后面插入;return false,修改后的代码为:’{$value}’;return false\”。谢谢冰古的建议。

2. 如果不想让插件通过commentform Hook来自动添加表情图标在评论框附近,请在line10,add_action(‘comment_form’,'wp_smilies’,-1);这句代码前面加上//,使之成为评论既可以。

———-

WP Smilies是一个非常小巧简单的插件,它仅提供了生成调用wordpress内置表情的图标按钮的功能。该插件直接解析php输出内置表情按钮,并非通过加载js文件等。这个原来只是自己在用模板的一个函数而已,索性将它剥离出来做成了这个插件。

1. 使用方法

在使用上也非常简单,在文末处下载该插件。将wp-smilies文件夹上传到plugin目录下。在后台插件页中激活,wordpress smilies即可以了。表情图标会自动添加到评论框附近。具体位置是由评论模板上的comment form的Hook接口位置而定。

2. 函数调用

如果您的评论模板上没有放置comment form Hook接口的话。嗯,先批评下,模板不规范。很容易出现和插件的兼容性问题。

您也可以使用函数调用的方法来生成表情图标按钮。将下列代码放置到评论模板中想要放置表情的位置:

<?php wp_smilies();?>

3. 关于CSS

插件生成的代码被嵌套在类名为wp_smilies的DIV块内。请自行在模板style.css中添加对wp_smilies类的css定义,以实现其它效果或编排边距等。

插件生成代码通过W3C XHTML 1.0 Transitional验证。

4. DEMO

本站评论框下部表情即是。这些都是wordpress内置表情。全部位于wp-includes\images\smilies\文件夹下。如果有兴趣,您可以自行找些表情图片将内置的替换了。

4. 下载

WP官方网站下载地址:http://wordpress.org/extend/plugins/wp-smilies/

记得有账号的网友帮我RATE一下啊。

———————————

补充资料,有兴趣延伸阅读下

如何判断评论模板内是否已放置comment form Hook?

用文本编辑器打开模板目录下的comments.php文件,查找下列代码:

<?php do_action(‘comment_form’, $post->ID); ?>

注意,该代码的位置就是表情图标生成的地方。

一个规范的wordpress模板应当在其页头(header.php),页脚(footer.php)上都有wp_head()和wp_footer()代码,以备插件调用用。


评论49:

49.2011.10.13.5:18.pmtoptpe: 我真不知道把它放在哪里呢?要么是在框最下面,要么是在帖子下面,搞不定啊

48.2011.10.09.2:39.pmvdgou: 这个插件之前用过…

47.2011.07.19.10:37.amWP表情插件 | wordpress站点: [...] 2. 如果不想让插件通过commentform Hook来自动添加表情图标在评论框附近,请在line10,add_action(‘comment_form’,’wp_smilies’,-1);这句代码前面加上//,使之成为评论既可以。 [...]

46.2011.07.18.3:40.pmWP表情插件 | wordpress: [...] 2. 如果不想让插件通过commentform Hook来自动添加表情图标在评论框附近,请在line10,add_action(‘comment_form’,’wp_smilies’,-1);这句代码前面加上//,使之成为评论既可以。 [...]

45.2011.06.01.7:59.pmNianQing: 这个插件之前用过...

44.2011.05.21.9:09.amWP表情插件-WP Smilies - 老哥's博客: [...] 2. 如果不想让插件通过commentform Hook来自动添加表情图标在评论框附近,请在line10,add_action(‘comment_form’,’wp_smilies’,-1);这句代码前面加上//,使之成为评论既可以。 [...]

43.2011.02.01.5:18.pm去叉叉 » Blog Archive » WordPress插件: WP Smilies: [...] 1. 使用方法 [...]

42.2010.06.07.11:41.am随缘: Image may be NSFW.
Clik here to view.
:grin:
这个真不错,谢了

41.2010.04.12.5:39.amcikiyor » Wordpress Smiley Eklentisi: [...] Smilies eklentisi ThinkAgain tarafından [...]

40.2009.03.26.6:15.pmRokeer: 表情插件很不错,不过感觉有点老了……

39.2009.02.17.6:39.pmRuShu.Net » Wordpress插件: WP Smilies: [...] 2. 如果不想让插件通过commentform Hook来自动添加表情图标在评论框附近,请在line10,add_action(’comment_form’,’wp_smilies’,-1);这句代码前面加上//,使之成为评论既可以。  [...]

38.2009.02.11.2:11.pmAsher: 感谢!我喜欢不用修改主题文件的插件 Image may be NSFW.
Clik here to view.
:)

37.2009.02.07.11:58.pmShowfom: 不想错不错

36.2009.02.07.3:05.pmWP Smilies | 给评论加上表情 | Huiの世界: [...] 1. 使用方法 [...]

35.2009.01.14.2:44.pm里外里博客: 呵呵, 挺方便的插件, 快回家了,过来看看了

34.2009.01.10.5:28.pm二手科学家: 好久没来了,预祝山之岚新春快乐!这个没人比我早了吧!

33.2009.01.10.12:54.pm山之岚: @alex htmlspecialchars_decode是php内置函数,请用php探针检查下的php是否禁止了该函数?

32.2009.01.08.6:37.pmalex: 不好意思,发错了,我的出问题的插件是hot-friends

31.2009.01.08.6:34.pmalex: 为何我会无法更新配置呢?出现Fatal error: Call to undefined function: htmlspecialchars_decode() in *:\*********\wordpress\wp-content\plugins\hot-friends\hot_friends_functions.php on line 43

30.2009.01.07.3:36.pmshamas: Image may be NSFW.
Clik here to view.
:wink:
都是好插件啊

29.2009.01.07.2:14.pm山之岚: @I-MAN Hi, I-MAN, Thank you for the plugin. I have downloaded it. Image may be NSFW.
Clik here to view.
:razz:

28.2009.01.07.12:57.pm浮黑: 岚兄的东东都是实用为本,真不错!

27.2009.01.06.10:59.pmKar Win: 学习一下了 Image may be NSFW.
Clik here to view.
:mrgreen:

26.2009.01.06.9:22.pmI-MAN: One Last Favour, i found a plugin which was maded for WP2.2. its Very Small plugin like wp smiles, called Comment Quicktags. http://wrestlingfans.co.cc/wp-content/plugins/comment_quicktags.zip its uses buttons insted that code that appears before this comment form. in this website. it could be good for your site too. i was hoping since alot changed may be you can update it and release at as Comment Qicktags Reloaded. Thanks

25.2009.01.06.4:37.pmI-MAN: ok thanks, but that error disappeared completely, so if you still want to check the file i edited, function.php. i can send. i did not edited css. i was just checking the way i inserted the code. Thanks alot for you help.

24.2009.01.06.10:18.am山之岚: @I-MAN OK, You customized a hook (si_ captcha for captcha) and inserted it before comment box, and placed commentform hook after submit button for comment replay notification. I think the way you did is right! The problem is if it worked well until you revised style code? (p.s, are you sure it were css style code? Cause usually css code doesnot affect the php execution) Thus you had better to check the code revised. Because the error occasionally occurs, probably you may check the php file. Sometimes redundant space in php file may cause 'can not modify header information'. I suggest you to modify php file by using editor instead of directly coding via wordpress wp-admin. Anyway, it would by helpful to send me your source file. You can find my email in AboutMe page.

23.2009.01.05.7:33.pmI-MAN: oh it was not about the same hook, i wanted captcha to show before comment box, and wanted comment replay notification to show after submit button. i had to move the comment form hook in the comment.php file to down. but the both plugins were brought down with it. so i maded another hook up the comment box and placed the si captcha in it. my question was did i do any coding wrong or unsecure like adding that function to function.php. did i do it right. Thanks.

22.2009.01.05.10:44.am山之岚: @I-MAN In my opinion, if you want to specify the execution sequence of plugins which use the same hook to invoke, you dont need to customize a new hook because it may cause other trouble. Just find the hook in their source code, like in wp_smilies is add_action('comment_form','wp_smilies',-1);. Notice that -1 is the execution order of plugin, usually the number is positive. In this case, negative number indicates that wp_smilies will execute first at all. By changing the numbers, you can specify the execution order of plugins. For example: add_action('comment_form','plugin a',2); add_action('comment_form','plugin b',3); then plugin a will execute earlier than plugin b. About "can not modify hearder information" error, one possible reason for this error is the php file was not save in ANSI format, or you can choose save in UTF_8 without BOM format.

21.2009.01.05.7:38.amI-MAN: hey i have a question, i hope you can help me with it, i am not realy a coder. i have two plugins conflicting with each other SI Captcha Comment Reply Notification they both use comment form hook, which cause the both to be in the same position, thus the whloe style become bad. so i found a page: http://extralogical.net/2007/06/wphooks/ and i added this code to my style function.php function si_captcha() { do_action('si_captcha'); } and added this code to my comments.php and change the add function stuff in the Plugin to si captcha --------------------- it all worked fine untill i got an error when i try to submit changes to the style template in wp admin area. i think it is caused by the code i added. some times appear. the error was something like this: Warning: Cannot modify header information - headers already sent by (output started at ...... i hope you can tell me what i did wrong. i can show you my function.php: Thanks

20.2009.01.04.9:19.pmI-MAN: @山之岚 thanks that worked well.

19.2009.01.04.8:19.pmDreamix: 我的博客也有可爱的表情,呵呵~

18.2009.01.04.7:04.pmCxLiuPing: Image may be NSFW.
Clik here to view.
:grin:
不错不错

17.2009.01.04.6:54.pmNetPuter: 原来这玩意儿是Thinkagain大哥开发的.. 最近有用表情的兴趣.. Image may be NSFW.
Clik here to view.
:mrgreen:

16.2009.01.04.6:17.pm山之岚: @Charles 好啊好啊。谢谢哦。

15.2009.01.04.6:17.pm山之岚: @老时 老时的头像果然很sexy啊。 Image may be NSFW.
Clik here to view.
:mrgreen:

14.2009.01.04.4:25.pmCharles: 老哥你太猛了,不错的插件啊。我去帮你rate,嘿嘿

13.2009.01.04.3:40.pm琪琪老爸: @老时 你这个图标就很健康了.

12.2009.01.04.1:40.pm花果山寨: 很少用到表情~

11.2009.01.04.12:32.pmlenciel: 一直用它...

10.2009.01.04.11:05.am老时: 插插更健康啊。

9.2009.01.04.10:45.am山之岚: @老N 这个目前没有这打算啦,现在表情插件已经很多了。可以在网上或官方库上搜一搜。 Image may be NSFW.
Clik here to view.
:razz:

8.2009.01.04.10:43.am山之岚: @I-MAN It is possible to do this, but unfortunately you have to manually modify the source code. Please open the wp-smilies.php by source code editor (like notepad++), find line 10: add_action('comment_form','wp_smilies',-1);, and then delete this line or simply insert // at the begin of line to change this line to comment. After that plugin will not invoke the commentform hook.

7.2009.01.04.4:11.amI-MAN: is there any way for it to only use by placing it manually even if the ID); ?> exists

6.2009.01.03.11:46.pm老N: 好东西当然要顶,能再开发几套替换表情么?

5.2009.01.03.11:43.pm山之岚: @i.robot 新年快乐哦。 @Yacca 其实在官方库里申请了好几个插件了,都没有放置上去,慢慢来吧。总是会给自己找到些理由,比如说最常用的,没时间。 Image may be NSFW.
Clik here to view.
:mrgreen:

4.2009.01.03.11:42.pm山之岚: @冰古 想要将表情添加到评论内容中间,这个问题还是挺麻烦的。呵呵。还要获取当前位置等等,估计没有一大堆代码是搞不定的,目前暂时没有这个打算。或者说还搞不定。 Image may be NSFW.
Clik here to view.
:???:
至于点击后是否移动,倒是觉得点击后移动到评论框是否会方便用户输入呢,所以就没有用这个return false啦。

3.2009.01.03.10:25.pmYacca: 华丽丽的飘过,新年快乐 ta兄~~~~~ 又出插件了...不过我不是表情fans,纯支持了^^

2.2009.01.03.8:58.pmi.robot: 呵呵, 挺方便的插件, 我帮你顶了一下 Image may be NSFW.
Clik here to view.
:mrgreen:
新年快乐:)

1.2009.01.03.8:38.pm冰古: 点击后不要移动页面吧,onclick值里添加个return false; 表情不能添加到内容的中间,只能添加到内容的末尾。


推荐阅读

2008.08.25.11:06.pmWordpress插件: Mail To Commenter v1.3.2 (387)

2008.08.15.3:30.pmWordpress插件: Hot Friends v1.4.1 (223)

2007.12.09.12:12.pmWordpress插件:whole_feed_output v0.1 (2)

2007.11.21.10:55.pmWordpress2.3 Plugin: wp_list_posts v0.1 (47)

2007.11.15.8:07.pmWordpress Plugin:wp_welcomMsg v0.21 (19)

2007.10.31.10:12.pmWordpress插件:wp_addbookmarks 0.21 (56)

2007.10.26.2:51.pmWordpress2.3插件:tags2metakeywords 0.31 (4)

2007.06.02.6:00.pm文件下载管理插件WS DOWNLOADMANAGER 1.0中文语言文件 (19)


Copyright © 2013 | Think Again | 原文链接

Image may be NSFW.
Clik here to view.

Viewing latest article 10
Browse Latest Browse All 10

Trending Articles