Allow people who have commets approved to submit a non-Chinese comment. No miscarriage of justice any more. 允许"曾在本站发表过评论且通过了审核"的用户发表纯英文评论 , 妈妈再也不用担心我的误判. 灵感来自于wordpress默认讨论选项中的"评论者先前
Allow people who have commets approved to submit a non-Chinese comment.
No miscarriage of justice any more.
允许"曾在本站发表过评论且通过了审核"的用户发表纯英文评论, 妈妈再也不用担心我的误判.
灵感来自于wordpress默认讨论选项中的"评论者先前须有评论通过了审核"这一项, 我在wp-includes/comments.php中找到了相关动作, 此动作在get_option('comment_whitelist')后触发, 我觉得可以用在纯英文评论上
以上是废话, 以下代码扔到functions.php
新秀B2C商城系统是一款简洁易用PHP商城系统。可免费下载使用,可用于商业用途,没有时效限制,除版权标识外,所有代码都允许修改。后台功能简介:1、商城设置:基本信息,配送方式,配送范围,支付方式,财务管理;2、商品管理:商品列表,添加商品,商品分类,商品品牌,商品属性;3、订单管理:订单列表,缺货登记;4、用户互动:用户管理,留言管理,评论管理,网站公告,在线客服,用户协议;5、文章管理:文章列表
0
/**
* allow old users to submit english comments
* coder: xiaohudie
* 2013-05-20
*/
function butterfly_en($comment) {
$pattern = '/[一-龥]/u';
$cau=$comment['comment_author'] ;
$cem=$comment['comment_author_email'] ;
global $wpdb;
$ok_to_comment = $wpdb->get_var("SELECT comment_approved FROM $wpdb->comments WHERE comment_author = '$cau' AND comment_author_email = '$cem' and comment_approved = '1' LIMIT 1");
if( is_user_logged_in() || 1 == $ok_to_comment ){ return $comment; }
elseif ( !preg_match_all($pattern, $ccontent, $match) ) {
exit('sorry, please type some Chinese words like 小蝴蝶最漂亮 in your comment to pass the spam-check.');
}
}
add_filter('preprocess_comment', 'butterfly_en'); 大家可以尽情测试, 测试方法(前提你之前在小蝴蝶评论过):
你可以成功的提交一条纯英文评论了, 不会英文的同学可以复制这一句: smallbutterfly is very beautiful
然后你可以改一下你的昵称, 然后再发一条纯英文评论试试
allow_english_comment is coded by http://xiaohudie.net. Any posts here is one hundred percent original, so please keep my link so as not to hurt this pretty girl
每个人都需要一台速度更快、更稳定的 PC。随着时间的推移,垃圾文件、旧注册表数据和不必要的后台进程会占用资源并降低性能。幸运的是,许多工具可以让 Windows 保持平稳运行。
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号