├── 404.php ├── README.md ├── ajax-comment ├── app.js └── do.php ├── favicon.ico ├── functions.js ├── functions.php ├── index.php ├── prettify.min.js ├── screenshot.png └── style.css /404.php: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 | 5 | 6 |
18 |
|
28 |
17 | | 18 | |
---|---|
21 | | 22 | |
25 | | 26 | |
提交失败:评论必须包含中文(Chinese),请再次尝试!
'); 221 | //die(); // 直接挡掉,无提示 222 | return( $incoming_comment ); 223 | } 224 | add_filter('preprocess_comment', 'scp_comment_post'); 225 | // 评论@回复 226 | function idevs_comment_add_at( $comment_text, $comment = '') { 227 | if( $comment->comment_parent > 0) { 228 | $comment_text = '@'.get_comment_author( $comment->comment_parent ) . ' ' . $comment_text; 229 | } 230 | 231 | return $comment_text; 232 | } 233 | add_filter( 'comment_text' , 'idevs_comment_add_at', 20, 2); 234 | // 评论邮件延迟 235 | add_action('comment_post', 'comment_mail_schedule'); 236 | function comment_mail_schedule($comment_id){ 237 | wp_schedule_single_event( time()+60, 'comment_mail_event',array($comment_id)); 238 | } 239 | add_action('comment_mail_event','comment_mail_notify'); 240 | // 评论邮件通知 241 | function comment_mail_notify($comment_id) { 242 | $comment = get_comment($comment_id); 243 | $parent_id = $comment->comment_parent ? $comment->comment_parent : ''; 244 | $spam_confirmed = $comment->comment_approved; 245 | if (($parent_id != '') && ($spam_confirmed != 'spam') && (!get_comment_meta($parent_id,'_deny_email',true)) && (get_option('admin_email') != get_comment($parent_id)->comment_author_email)) { 246 | $wp_email = 'no-reply@' . preg_replace('#^www\.#', '', strtolower($_SERVER['SERVER_NAME'])); //可以修改为你自己的邮箱地址 247 | $to = trim(get_comment($parent_id)->comment_author_email); 248 | $subject = '你在 [' . get_option("blogname") . '] 的留言有了新回复'; 249 | $message = '
253 |
254 |
258 |
255 | ' . get_option("blogname") . '
256 |
257 |
259 |
265 | ' . trim(get_comment($parent_id)->comment_author) . ',您在文章 《' . get_the_title($comment->comment_post_ID) . '》 中的评论: 260 |' . trim(get_comment($parent_id)->comment_content) . ' 261 |'. $comment->comment_author .' 给您的回复如下: 262 |' . trim($comment->comment_content) . ' 263 | 立即回复 264 | |
266 |
269 | 本邮件由 ' . get_option("blogname") . ' 后台自动发送,请勿直接回复!
270 | |
271 |