国产片侵犯亲女视频播放_亚洲精品二区_在线免费国产视频_欧美精品一区二区三区在线_少妇久久久_在线观看av不卡

服務器之家:專注于服務器技術及軟件下載分享
分類導航

DEDECMS|帝國CMS|Discuz|PHPCMS|Wordpress|ZBLOG|ECSHOP|蘋果CMS|極致CMS|CMS系統|

服務器之家 - 建站程序 - Wordpress - WordPress 有人回復時郵件通知的實現方法 SAE 移植版

WordPress 有人回復時郵件通知的實現方法 SAE 移植版

2019-09-28 14:18WordPress建站網 Wordpress

常見的 Wordress 郵件通知功能,使用起來非常的簡單

1,先配置一下您的SMTP賬戶的用戶名和密碼。 
2,將下面的內容粘貼到當前主題的 functions.php 中即可,注意別破壞了原來的結構就行。(或者直接建一個文件,將代碼拷貝進去,然后在 functions.php 中引用該文件即可。) 

復制代碼

代碼如下:


<?php 
/** 
* Email Me With The Replay For SAE 

* Usage:將此段代碼粘貼到當前主題的 functions.php 文件中即可。 
* 或者將此文件放進主題目錄,在 functions.php 中包含此文件 

* 基于 comment_mail_notify v1.0 by willin kan. http://kan.willin.org/?p=1295(已失效) 
* changelist 
* 2012-03-29 
* version 0.1 

* 2012-04-29 
* version 0.2 
* edit $subject to this code 
* $subject = '您的評論 ' . mb_substr(strip_tags(get_comment($parent_id)->comment_content), 0, 10, 'utf-8') . ' 有了回應 - ' . get_option("blogname"); 


* @author IT不倒翁, willin kan 
* @copyright (C) 2011,2012 Just Use It! 
* @link yungbo.com 
* @version 0.2 
*/ 
function comment_mail_notify($comment_id) { 
//換行標志 
$lineBreak = "\n"; 
//縮進標志 
$tabBreak = "\t"; 
$admin_notify = '1'; // are you willing to receive the email? 1 is yes. 
$admin_email = get_bloginfo('admin_email'); // you can change $admin_email to your e-mail optionaly. 
$comment = get_comment($comment_id); 
$comment_author_email = trim($comment->comment_author_email); 
$parent_id = $comment->comment_parent ? $comment->comment_parent : ''; 
global $wpdb; 
if ($wpdb->query("Describe {$wpdb->comments} comment_mail_notify") == '') 
$wpdb->query("ALTER TABLE {$wpdb->comments} ADD COLUMN comment_mail_notify TINYINT NOT NULL DEFAULT 0;"); 
if (($comment_author_email != $admin_email && isset($_POST['comment_mail_notify'])) || ($comment_author_email == $admin_email && $admin_notify == '1')) 
$wpdb->query("UPDATE {$wpdb->comments} SET comment_mail_notify='1' WHERE comment_ID='$comment_id'"); 
$notify = $parent_id ? get_comment($parent_id)->comment_mail_notify : '0'; 
$spam_confirmed = $comment->comment_approved; 
if ($parent_id != '' && $spam_confirmed != 'spam' && $notify == '1') { 
$wp_email = 'no-reply@' . preg_replace('#^www\.#', '', strtolower($_SERVER['SERVER_NAME'])); // e-mail 
$to = trim(get_comment($parent_id)->comment_author_email); 
$subject = '您的評論 ' . mb_substr(strip_tags(get_comment($parent_id)->comment_content), 0, 10, 'utf-8') . ' 有了回應 - ' . get_option("blogname"); 
//郵件主體內容 
//估計新浪考慮到安全問題,全部用 htmlspecialchars() 過濾了,所以不要使用 html 標記 
$message = '您好,' . trim(get_comment($parent_id)->comment_author) . $lineBreak; 
$message .= '您曾在 ' . get_option("blogname") . ' 留言:' . $lineBreak; 
$message .= $tabBreak . trim(get_comment($parent_id)->comment_content) . $lineBreak; 
$message .= trim($comment->comment_author) . ' 回復了您:' . $lineBreak; 
$message .= $tabBreak . trim($comment->comment_content) . $lineBreak; 
$message .= '您可以點擊 ' . get_comment_link($parent_id) . ' 查看具體情況' . $lineBreak; 
$message .= $lineBreak; 
$message .= '(系統郵件,請不要直接回復)' . $lineBreak; 
$message .= get_option('blogname') . $lineBreak; 
$message .= home_url() . $lineBreak; 
/*SAE 配置位置*/ 
$saeTo = $to; 
$saeSubject = $subject; 
$saeMessage = $message; 
$saeSMTPUser = '';//SMTP郵箱 
$saeSMTPPass = '';//SMTP密碼 
$mail = new SaeMail(); 
$result = $mail->quickSend($saeTo, $saeSubject, $saeMessage, $saeSMTPUser, $saeSMTPPass); 
// if ($result === false) 
// var_dump($mail->errno(), $mail->errmsg()); 


add_action('comment_post', 'comment_mail_notify'); 
/* Auto checked */ 
function add_checkbox() { 
echo '<input type="checkbox" name="comment_mail_notify" id="comment_mail_notify" value="comment_mail_notify" checked="checked" /><label for="comment_mail_notify">有人回復我時郵件通知我</label>'; 

add_action('comment_form', 'add_checkbox'); 


代碼最近更新日期,2012-04-29

延伸 · 閱讀

精彩推薦
Weibo Article 1 Weibo Article 2 Weibo Article 3 Weibo Article 4 Weibo Article 5 Weibo Article 6 Weibo Article 7 Weibo Article 8 Weibo Article 9 Weibo Article 10 Weibo Article 11 Weibo Article 12 Weibo Article 13 Weibo Article 14 Weibo Article 15 Weibo Article 16 Weibo Article 17 Weibo Article 18 Weibo Article 19 Weibo Article 20 Weibo Article 21 Weibo Article 22 Weibo Article 23 Weibo Article 24 Weibo Article 25 Weibo Article 26 Weibo Article 27 Weibo Article 28 Weibo Article 29 Weibo Article 30 Weibo Article 31 Weibo Article 32 Weibo Article 33 Weibo Article 34 Weibo Article 35 Weibo Article 36 Weibo Article 37 Weibo Article 38 Weibo Article 39 Weibo Article 40
主站蜘蛛池模板: 天堂va久久久噜噜噜久久va | 在线欧美日韩 | 国内外成人在线视频 | 日韩福利二区 | 激情毛片 | 亚洲日本乱码在线观看 | 亚洲文字幕 | 亚洲国产成人精品女人久久久 | 97精品国产97久久久久久免费 | 亚洲国产一区二区三区日本久久久 | 99亚洲精品 | 日韩免费 | 天天操天天拍 | 亚洲精品视频在线播放 | 日韩在线精品视频 | 国内精品三级 | 懂色av一区二区三区免费观看 | 91精品啪aⅴ在线观看国产 | www免费网站在线观看 | 日韩精品免费一区二区三区 | 91在线亚洲 | 中文字幕视频在线观看 | 日本理论在线 | 国产成人小视频 | 精品影院 | 亚洲一区二区三 | 午夜欧美一区二区三区在线播放 | 成人av视屏 | 91精品国产高清久久久久久久久 | 精品综合久久 | 影音先锋网址 | 91在线视频观看 | 午夜av影院 | 丁香伊人 | 欧美在线| 久久视频精品 | 欧美日韩三级在线 | av不卡在线播放 | 精品国产一区二区三区日日嗨 | 日本久久久 | 欧美激情综合网 |