WordPress 插件
WP-Clap (版本 1.4)
介绍
并不是所有人在读完日志后都会留言,没有留言你不能知道有谁读了你的博客,日志也容易出现冷场现象。WP-Clap(拍手插件)会为你的日志增加一个拍手栏目,你的读者读完日志后可以随手点一下链接,以示路过,减少冷场现象。
WP-Clap会在日志中显示谁拍了手,包括头像、名字和拍手数,你可以自定义是否显示它们。除此之外,你还可以像在首页显示有多少次拍手,就像显示有多少条留言一样。
下载
WP-Clap 1.4 (下载)
要求的版本
WordPress 2.7 或更高.
我不清楚WP-Clap插件在WP 2.5或更低的版本是否能正常工作,但你可以试一下。
支持的语言
安装
- 1. 解压缩此插件到 '/wp-content/plugins/' 这个目录
- 2. 在WP后台的插件页面激活此插件
- 3. 在 '设置->WP-Clap' 页面中自定义此插件的设定
- 4. 在设定页的'显示'选项中选择你想显示拍手的地方。选择后不用再看下面的文字了。
- 5. (如果你没选上述选项或想手动添加代码) 在 'single.php' (或者其他你想要开放拍手的地方,比如 page.php) 文件中增加下面这行:
<?php if(function_exists('wp_clap')) { wp_clap(); } ?>
- 6. 你可以在 'index.php' 使用下面的函数来显示有多少次拍手,就如同显示有多少条评论一样:
<?php if(function_exists('get_wp_claps')) { get_wp_claps(zero, one, more, mode, link, echo, post_id); } ?>
get_wp_claps()的参数:
| 名称 | 类型 | 说明 | 默认值 | 版本 |
|---|---|---|---|---|
| zero | string | 无拍手时显示的文本。 | 'No Claps' | 1.0+ |
| one | string | 只有1次拍手时显示的文本。 | 'One Clap' | 1.0+ |
| more | string | 多于1次拍手时显示的文本,'%' 会被替换成实际拍手数。 | '% Claps' | 1.0+ |
| mode | integer | 显示拍手数的类型。
0 = 总拍手数, 1 = 拍手人数, 2 = 平均拍手数. |
0 | 1.0+ |
| link | integer | 0 = 不用链接, 1 = 链接到日志的拍手区域. | 0 | 1.0+ |
| echo | integer | 0 = 打印, 1 = 返回值. | 1 | 1.0+ |
| post_id | integer | 对应的日志。一般不用改它。 | 0 | 1.0+ |
例子:
对于 get_wp_claps() 这函数, 一般来说不用设定 $link, $echo and $post_id 的值。下面是一些例子:
<?php get_wp_claps('No Claps', 'One Clap', '% Claps'); // 显示总拍手数 ?>
<?php get_wp_claps('0 Clapper', '1 Clapper', '% Clappers', 1); // 拍手人数 ?>
<?php get_wp_claps('No Claps', 'One Clap', '% Claps', 2); // 平均拍手数 ?>
<?php get_wp_claps('0 Claps', '1 Clap', '% Claps', 0, 0); // 不带链接的总拍手数 ?>
常见问题
- 怎样在日志中显示拍手?
有两个方法:- 1. 在WP-Clap后台的设定页面的'显示'选项中,选择你想要显示拍手的地方。
- 2. 在你想要显示的地方加入下面这行:
<?php if(function_exists('wp_clap')) { wp_clap(); } ?>
比如,在 'single.php' 文件中,你可以把上面这行加到下面这行的上面:
<?php comments_template(); ?>
- 怎样在首页显示有几次拍手?
有两个方法:- 1. 在WP-Clap后台的设定页面的'显示'选项中,选择'自动将拍手数显示在日志和摘要中'。拍手次数会显示在右上角,访客同样可以在此拍手。
- 2. 使用函数 get_wp_claps() 来实现。 请在[安装]的说明中查看此函数的相关参数。
- 没有Widget吗?
抱歉,目前WP-Clap并不支持Widget。也许我们会在下一个版本中增加此功能。 - 拍手区域在我博客中的布局是乱的? 我们不能保证WP-Clap的默认样式能适合每一个主题。你可以在后台的[样式]设定中选择使用自定义样式,然后在你的主题的style.css文件中添加你的自定义样式(这需要你有一定的css基础)。
截图

拍手区域

拍手次数
该插件已提交到WordPress插件目录。别忘记在本日志下面拍拍手以示支持~
PS.欢迎Follow我的twitter。

拍拍手





顶一下……
不知道和inove能不能合得来,那个拍手的图标如果能再优化一下就更好了...
美化的事自己来嘛。
拍手居然可以刷~~(lll ーдー)
give me five~
刷拍手=w=
This looks like a fun plugin but you may want to consider another name such as WP-Applause. The word "clap" has another meaning in English that isn't so pleasant as "applause". A minute or two spent in Wikipedia will demonstrate what I mean :)
I have considered that, but in some japanese blogs, a widget named "Clap" is used like this plugin. So I finally decided to use this name. :)
I'll be trying it on my WPMU blog soon but I may edit the name :)
Wish you success~ :)
还好没用slap>..< 不过同意老外的说法,clap比较多的意思还是拍击。而中文的意思拍手为喝彩,所以applause更符合大意。。。不过日文的拍手意味鼓掌
PS:其实太咬文嚼字了,都一个意思=w=
Hi, I like the idea of WP-Clap very much! Just an idea: automatically inserting clap into posts is easier for a lot of users (in stead of manual editing of files). Take a look at Cli.gs and Tweet how I realized that if you like. If you want a Dutch translation, just send me the .po(t) file. Kind Regards.
Thank you, that's a good idea, I will add it to the next version. The .po file is in the 'languages' directory of WP-Clap, and you can use the default file 'wp-clap.po' to translate it. :)
看来似乎应该设置防止刷拍手的东西=w=
这个插件系2.84里面有错误啊,只要没有拍手过的文章,就会报错了!希望出新版本修正这个问题!
请问是怎样的错误?我这里没有发现问题。
Warning: Division by zero in /wp-content/plugins/wp-clap/wp-clap.php on line 73
没有拍过的文章就会出现这样的错误·!
收到,此错误会在下一版本中修正。
临时解决办法:在wp-clap.php的73行之前再加入下面这行:
if ($clappers == 0) { $clappers = 1; }
我这也没问题。。
虽然找不到好位置放就是了……
If you sent me an e-mail I will reply with the Dutch translations.
Works great, thank you
Oh, this is nice! I don't have to rely on CGI WebClap so much anymore :D
Hey u thnx. Keep up the great work!
园长很强大~
挺有创意的小东东,我喜欢
请问,您是通过什么来判断重复拍手的?
Cookie?IP?
我担心会出现有人恶意不停地重复拍手~
只要点一次就会在对应人头下+1拍手数,并没有做过多限定。你可以只显示“拍手人数”,这样就相当于只允许拍手一次了。代价是未留言过的人都被归入“匿名”而只算作一次。
@Ariagle: 谢谢您的解答!
我发现在编辑文章的时候有个自定义域wp_claps,好像修改器一样啊=。=
是的,像postview等插件的数据统计都是在这里的。
希望博主在下一个版本中,可以在后台添加对日志拍手数的一栏。比方说一个表格
postid posttitle clapcount
并可以给予排序查看。
这个只是建议,如果博主工作繁忙,可以直接无视此评论:P
对,我已经有这计划了,只是一直没加入=W=
hi,
please help me, i picked the option of auto insertion but I have the clap block/button on pages too, how can I make it show only on posts.
I am sorry to say that it can not be showed only on posts in this version(1.1). I will add a new option which make it only show on posts or pages in the next version.
请告知一下,新版本1.2里面Container的书写规则。
我想将其放入一个Class为under的DIV底部,我输入了div.class,好像没有达到预期效果,请解答一下
打错了,我输入了div.under没有达到预期效果
不用设定class,直接写容器名称。如div、span或h1、h2、h3...
我明白了,这个容易的意思是title的容器哈。
我还以为是可以让插件自动将拍手的div自动嵌入某个指定容器来着。
晕,今天怎么老发错字-_-!
我明白了,这个容器的意思是title的容器哈。
我还以为是可以让插件自动将拍手的div自动嵌入某个指定容器来着。
是的。
In my WordPress installation (2.8.4), I logged in as a subscriber and I found I am able to edit the WP-Clap settings. It should Not be so. Only the Admin should be able to do so.
Only WP_Clap was there in the Settings (as a subscriber). Nothing else. This is Not safe because any subscriber can change WP_Clap settings.
You need to remove this anomaly from WP_Clap and we are waiting for an upgrade.
I have fixed it, please upgrade to version 1.3. :)
[...] Zur WP-Clap-Plugin-Seite geht es übrigens hier…. [...]
老实说,如果没有醒目巨大的拍手标志,俺是基本不会记得按拍手的。
This is such an awesome plugin. I'm using it on my site. :D
Great plugin! I'm already using this on my site but, I have a question with the design. I changed the clap image to a different one that is 180x174 and, it made the text go down. I want to make it so that the text (inputted through notice textbox in the WP Clap Options page) be side by side with the image, how do I do that?
I hope you can help me with this since I have wanted so badly to add a webclap-thingy on my blog ever since I saw it on those japanese blogsites.
Thank you and more power!
Open the file "wp-clap-style.css" in this plugin's folder,

and find the string : ".wp_clap_img"(no quotes),
delete the following line : "display:block;",
and add a new line : "float:left;".
If it does not work or you have any othor questions or I do not answer correctly, send me an email:
I've sent you an email, Ariagle since It still didn't work. XD
最近用上了,感謝感謝XDDD
有一個小小意見想提,當鼠標在拍手人頭像那裡停留時會顯示他的名字,可否在名字後面加上拍手次數?
本來是想將次數直接重疊到頭像右下角的,但無奈span支援東西太少~~~
你可以直接到后台编辑wp-clap.php文件,找到create_clap函数,里面有相关的HTML。在1.3版本中,有关拍手头像的HTML大约是在247到283行,$clap['claps']表示各人的拍手次数,将它加在你想要的地方就行了。
不过这样改的话,下次插件升级的时候就又复原了,还得再自己改一次…
可否無恥的求在下次升級的時候加入這個顯示……就一了百了了XDDD
好吧我会尝试在下一个版本中加入自定义HTML模板功能,以适应各种制定需求。但是我不能确定什么时候会有空更新,所以在此之前你还是手动改插件吧 XD
Good good study and day day up!
Hi! Great work!
Only one problem: how can I reset the values of one of my posts?
In order to test it I clapped my own article, and now that I know it works I'd like to cancel my clapping. :P
I‘m sorry to say that there is no way to cancel your clapping now... If you certainly want to do that, login your phpmyadmin, search 'wp_clap' for meta_key and your post's id for post_id in the wp_postmeta table, the clapping data is in the meta_key. You can modify it but it may be difficult to read.
Nice, but since it takes some time to fill this form, don't you think that users can type in a one liner?
体验下去
Warning: Invalid argument supplied for foreach() in /home/www/cwcity/hosting/v/p/vpulpify/htdocs/blog/wp-content/plugins/wp-clap/wp-clap.php on line 247
请问这个是怎么回事OTL
也许是中途你的日志的自定义域的数据格式出了些问题。在插件更新之前请先尝试清空出错日志的wp_clap字段并重新安装插件。
[...] WP-Clap:拍手插件,我喜欢(喂) [...]
[...] WP-Clap:拍手插件,我喜欢(喂) [...]
伪春菜插件和这个拍手插件,在wp 3.0的子站中好象都没办法设置。
拍手插件,在子站中设定过之后直接转到主站去,并且无法在分站显示。
(伪春菜可以在分站显示,但是却无法独立设定,也是设定好之后会转到主站插件的设置页面)
请问这个有什么办法吗……;;w;;
WP 3.0的多站点设置我还没有测试过,回头我会去检查一下。