本文整理汇总了PHP中emailer::assign_vars方法的典型用法代码示例。如果您正苦于以下问题:PHP emailer::assign_vars方法的具体用法?PHP emailer::assign_vars怎么用?PHP emailer::assign_vars使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类emailer
的用法示例。
在下文中一共展示了emailer::assign_vars方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: home
function home()
{
global $user;
$sql = 'SELECT *
FROM _email
WHERE email_active = ??
LIMIT ??';
if (!($email = _fieldrow(sql_filter($sql, 1, 1)))) {
$this->e('No queue emails.');
}
set_time_limit(0);
if (!$email['email_start']) {
$sql = 'UPDATE _email SET email_start = ?
WHERE email_id = ?';
_sql(sql_filter($sql, time(), $email['email_id']));
}
$sql = 'SELECT user_id, user_username, user_email
FROM _members
WHERE user_type = ?
AND user_id <> ?
ORDER BY user_username
LIMIT ??, ??';
$members = _rowset(sql_filter($sql, 1, 1, $email['email_last'], 100));
$i = 0;
foreach ($members as $row) {
if (!preg_match('/^[a-z0-9\\.\\-_\\+]+@[a-z0-9\\-_]+\\.([a-z0-9\\-_]+\\.)*?[a-z]+$/is', $row['user_email'])) {
continue;
}
if (!$i) {
include XFS . 'core/emailer.php';
$emailer = new emailer();
}
$emailer->use_template('mass');
$emailer->format('plain');
$emailer->from('TWC Kaulitz <twc_princess@twckaulitz.com>');
$emailer->set_subject(entity_decode($email['email_subject']));
$emailer->email_address($row['user_email']);
$emailer->assign_vars(array('USERNAME' => $row['user_username'], 'MESSAGE' => entity_decode($email['email_message'])));
$emailer->send();
$emailer->reset();
sleep(2);
$i++;
}
if ($i) {
$email['email_last'] += $i;
$sql = 'UPDATE _email SET email_last = ?
WHERE email_id = ?';
_sql(sql_filter($sql, $email['email_last'], $email['email_id']));
} else {
$sql = 'UPDATE _email SET email_active = ?, email_end = ?
WHERE email_id = ?';
_sql(sql_filter($sql, 0, time(), $email['email_id']));
$this->e('Finished processing [' . $email['email_id'] . '] emails.');
}
$this->e('Processed ' . $i . ' emails.');
return;
}
示例2: _home
public function _home() {
global $config, $user, $cache;
if (!_button()) {
return false;
}
$username1 = request_var('username1', '');
$username2 = request_var('username2', '');
if (empty($username1) || empty($username2)) {
fatal_error();
}
$username_base1 = get_username_base($username1);
$username_base2 = get_username_base($username2);
$sql = 'SELECT *
FROM _members
WHERE username_base = ?';
if (!$userdata = sql_fieldrow(sql_filter($sql, $username_base1))) {
_pre('El usuario no existe.', true);
}
$sql = 'SELECT *
FROM _members
WHERE username_base = ?';
if ($void = sql_fieldrow(sql_filter($sql, $username_base2))) {
_pre('El usuario ya existe.', true);
}
//
$sql = 'UPDATE _members SET username = ?, username_base = ?
WHERE user_id = ?';
sql_query(sql_filter($sql, $username2, $username_base2, $userdata['user_id']));
$emailer = new emailer();
$emailer->from('info');
$emailer->use_template('username_change', $config['default_lang']);
$emailer->email_address($userdata['user_email']);
$emailer->assign_vars(array(
'USERNAME' => $userdata['username'],
'NEW_USERNAME' => $username2,
'U_USERNAME' => s_link('m', $username_base2))
);
$emailer->send();
$emailer->reset();
redirect(s_link('m', $username_base2));
return;
}
示例3: notification
function notification($sender_id, $recipient_id, $recipient_email, $email_subject, $email_text, $use_bcc = false, $pm_subject = '', $recipient_username = '', $recipient_lang = '', $emty_email_template = false)
{
global $db, $config, $user, $lang;
require IP_ROOT_PATH . 'includes/emailer.' . PHP_EXT;
$recipient_lang = empty($recipient_lang) ? $config['default_lang'] : $recipient_lang;
// Let's do some checking to make sure that mass mail functions are working in win32 versions of php.
if (preg_match('/[c-z]:\\\\.*/i', getenv('PATH')) && !$config['smtp_delivery']) {
// We are running on windows, force delivery to use our smtp functions since php's are broken by default
$config['smtp_delivery'] = 1;
$config['smtp_host'] = @ini_get('SMTP');
}
$emailer = new emailer();
$emailer->headers('X-AntiAbuse: Board servername - ' . trim($config['server_name']));
$emailer->headers('X-AntiAbuse: User_id - ' . $user->data['user_id']);
$emailer->headers('X-AntiAbuse: Username - ' . $user->data['username']);
$emailer->headers('X-AntiAbuse: User IP - ' . $user->ip);
if ($use_bcc) {
$emailer->to($config['board_email']);
$emailer->bcc($recipient_email);
} else {
$emailer->to($recipient_email);
}
$emailer->set_subject($email_subject);
if ($emty_email_template) {
$emailer->use_template('admin_send_email', $recipient_lang);
$emailer->assign_vars(array('SITENAME' => $config['sitename'], 'BOARD_EMAIL' => $config['board_email'], 'MESSAGE' => $email_text));
} else {
$server_url = create_server_url();
$privmsg_url = $server_url . CMS_PAGE_PRIVMSG;
$recipient_username = empty($recipient_username) ? $lang['User'] : $recipient_username;
$email_sig = create_signature($config['board_email_sig']);
$emailer->use_template('privmsg_notify', $recipient_lang);
$emailer->assign_vars(array('USERNAME' => $recipient_username, 'SITENAME' => $config['sitename'], 'EMAIL_SIG' => $email_sig, 'FROM' => $user->data['username'], 'DATE' => create_date($config['default_dateformat'], time(), $config['board_timezone']), 'SUBJECT' => $pm_subject, 'PRIV_MSG_TEXT' => $email_text, 'FROM_USERNAME' => $user->data['username'], 'U_INBOX' => $privmsg_url . '?folder=inbox'));
}
$emailer->send();
$emailer->reset();
return true;
}
示例4: home
function home()
{
$sql = 'SELECT *
FROM _members
WHERE user_type = ?
AND user_birthday LIKE ?
AND user_birthday_last < ?
ORDER BY user_username
LIMIT ??';
$birthday = _rowset(sql_filter($sql, 1, '%' . date('md'), date('Y'), 10));
if (!$birthday) {
$this->e('None.');
}
$process = w();
foreach ($birthday as $i => $row) {
if (!$i) {
@set_time_limit(0);
require XFS . 'core/emailer.php';
$emailer = new emailer();
}
$emailer->format('plain');
$emailer->from('TWC Kaulitz <twc_princess@twckaulitz.com>');
$emailer->use_template('user_birthday');
$emailer->email_address($row['user_email']);
$emailer->assign_vars(array('USERNAME' => $row['user_username']));
$emailer->send();
$emailer->reset();
$process[$row['user_id']] = $row['user_username'];
}
if (count($process)) {
$sql = 'UPDATE _members SET user_birthday_last = ?
WHERE user_id IN (??)';
_sql(sql_filter($sql, date('Y'), _implode(',', array_keys($process))));
}
return $this->e('Done @ ' . implode(',', array_values($process)));
}
示例5: trim
message_die(GENERAL_ERROR, 'Could not update private message new/read status for user', '', __LINE__, __FILE__, $sql);
}
if ($to_userdata['user_notify_pm'] && !empty($to_userdata['user_email']) && $to_userdata['user_active']) {
$script_name = preg_replace('/^\\/?(.*?)\\/?$/', "\\1", trim($board_config['script_path']));
$script_name = $script_name != '' ? $script_name . '/privmsg.' . $phpEx : 'privmsg.' . $phpEx;
$server_name = trim($board_config['server_name']);
$server_protocol = $board_config['cookie_secure'] ? 'https://' : 'http://';
$server_port = $board_config['server_port'] != 80 ? ':' . trim($board_config['server_port']) . '/' : '/';
include $phpbb_root_path . 'includes/emailer.' . $phpEx;
$emailer = new emailer($board_config['smtp_delivery']);
$emailer->from($board_config['board_email']);
$emailer->replyto($board_config['board_email']);
$emailer->use_template('privmsg_notify', $to_userdata['user_lang']);
$emailer->email_address($to_userdata['user_email']);
$emailer->set_subject($lang['Notification_subject']);
$emailer->assign_vars(array('USERNAME' => stripslashes($to_username), 'SENDER_USERNAME' => htmlspecialchars($userdata['username']), 'PM_SUBJECT' => $privmsg_subject, 'PM_MESSAGE' => $message_text, 'SITENAME' => $board_config['sitename'], 'EMAIL_SIG' => !empty($board_config['board_email_sig']) ? str_replace('<br />', "\n", "-- \n" . $board_config['board_email_sig']) : '', 'U_INBOX' => $server_protocol . $server_name . $server_port . $script_name . '?folder=inbox'));
$emailer->send();
$emailer->reset();
}
}
/*
$template->assign_vars(array(
'META' => '<meta http-equiv="refresh" content="3;url=' . append_sid("privmsg.$phpEx?folder=inbox") . '">')
);
$msg = $lang['Message_sent'] . '<br /><br />' . sprintf($lang['Click_return_inbox'], '<a href="' . append_sid("privmsg.$phpEx?folder=inbox") . '">', '</a> ') . '<br /><br />' . sprintf($lang['Click_return_index'], '<a href="' . append_sid("index.$phpEx") . '">', '</a>');
message_die(GENERAL_MESSAGE, $msg);
*/
//-- mod : Instant Post Redirect ------------------------------------------------------------
//-- add
示例6: user_notification
function user_notification($mode, &$post_data, &$topic_title, &$forum_id, &$topic_id, &$post_id, &$notify_user)
{
global $board_config, $lang, $db, $phpbb_root_path, $phpEx;
global $userdata, $user_ip;
$current_time = time();
if ($mode != 'delete') {
if ($mode == 'reply') {
$sql = "SELECT ban_userid \r\n\t\t\t\tFROM " . BANLIST_TABLE;
if (!($result = $db->sql_query($sql, false, true))) {
$db->clear_cache('posts_');
message_die(GENERAL_ERROR, 'Could not obtain banlist', '', __LINE__, __FILE__, $sql);
}
$user_id_sql = '';
while ($row = $db->sql_fetchrow($result)) {
if (isset($row['ban_userid']) && !empty($row['ban_userid'])) {
$user_id_sql .= ', ' . $row['ban_userid'];
}
}
$sql = "SELECT u.user_id, u.user_email, u.user_lang \r\n\t\t\t\tFROM " . TOPICS_WATCH_TABLE . " tw, " . USERS_TABLE . " u \r\n\t\t\t\tWHERE tw.topic_id = {$topic_id} \r\n\t\t\t\t\tAND tw.user_id NOT IN (" . $userdata['user_id'] . ", " . ANONYMOUS . $user_id_sql . ") \r\n\t\t\t\t\tAND tw.notify_status = " . TOPIC_WATCH_UN_NOTIFIED . " \r\n\t\t\t\t\tAND u.user_id = tw.user_id";
if (!($result = $db->sql_query($sql))) {
$db->clear_cache('posts_');
message_die(GENERAL_ERROR, 'Could not obtain list of topic watchers', '', __LINE__, __FILE__, $sql);
}
$update_watched_sql = '';
$bcc_list_ary = array();
if ($row = $db->sql_fetchrow($result)) {
// Sixty second limit
@set_time_limit(60);
do {
if ($row['user_email'] != '') {
$bcc_list_ary[$row['user_lang']][] = $row['user_email'];
}
$update_watched_sql .= $update_watched_sql != '' ? ', ' . $row['user_id'] : $row['user_id'];
} while ($row = $db->sql_fetchrow($result));
//
// Let's do some checking to make sure that mass mail functions
// are working in win32 versions of php.
//
if (preg_match('/[c-z]:\\\\.*/i', getenv('PATH')) && !$board_config['smtp_delivery']) {
$ini_val = @phpversion() >= '4.0.0' ? 'ini_get' : 'get_cfg_var';
// We are running on windows, force delivery to use our smtp functions
// since php's are broken by default
$board_config['smtp_delivery'] = 1;
$board_config['smtp_host'] = @$ini_val('SMTP');
}
if (sizeof($bcc_list_ary)) {
include $phpbb_root_path . 'includes/emailer.' . $phpEx;
$emailer = new emailer($board_config['smtp_delivery']);
$script_name = preg_replace('/^\\/?(.*?)\\/?$/', '\\1', trim($board_config['script_path']));
$script_name = $script_name != '' ? $script_name . '/viewtopic.' . $phpEx : 'viewtopic.' . $phpEx;
$server_name = trim($board_config['server_name']);
$server_protocol = $board_config['cookie_secure'] ? 'https://' : 'http://';
$server_port = $board_config['server_port'] != 80 ? ':' . trim($board_config['server_port']) . '/' : '/';
$orig_word = array();
$replacement_word = array();
obtain_word_list($orig_word, $replacement_word);
$emailer->from($board_config['board_email']);
$emailer->replyto($board_config['board_email']);
$topic_title = count($orig_word) ? preg_replace($orig_word, $replacement_word, unprepare_message($topic_title)) : unprepare_message($topic_title);
@reset($bcc_list_ary);
while (list($user_lang, $bcc_list) = each($bcc_list_ary)) {
$emailer->use_template('topic_notify', $user_lang);
for ($i = 0; $i < count($bcc_list); $i++) {
$emailer->bcc($bcc_list[$i]);
}
// The Topic_reply_notification lang string below will be used
// if for some reason the mail template subject cannot be read
// ... note it will not necessarily be in the posters own language!
$emailer->set_subject($lang['Topic_reply_notification']);
// This is a nasty kludge to remove the username var ... till (if?)
// translators update their templates
$emailer->msg = preg_replace('#[ ]?{USERNAME}#', '', $emailer->msg);
$emailer->assign_vars(array('EMAIL_SIG' => !empty($board_config['board_email_sig']) ? str_replace('<br />', "\n", "-- \n" . $board_config['board_email_sig']) : '', 'SITENAME' => $board_config['sitename'], 'TOPIC_TITLE' => $topic_title, 'U_TOPIC' => $server_protocol . $server_name . $server_port . $script_name . '?' . POST_POST_URL . "={$post_id}#{$post_id}", 'U_STOP_WATCHING_TOPIC' => $server_protocol . $server_name . $server_port . $script_name . '?' . POST_TOPIC_URL . "={$topic_id}&unwatch=topic"));
$emailer->send();
$emailer->reset();
}
}
}
$db->sql_freeresult($result);
if ($update_watched_sql != '') {
$sql = "UPDATE " . TOPICS_WATCH_TABLE . "\r\n\t\t\t\t\tSET notify_status = " . TOPIC_WATCH_NOTIFIED . "\r\n\t\t\t\t\tWHERE topic_id = {$topic_id}\r\n\t\t\t\t\t\tAND user_id IN ({$update_watched_sql})";
$db->sql_query($sql);
}
}
$sql = "SELECT topic_id \r\n\t\t\tFROM " . TOPICS_WATCH_TABLE . "\r\n\t\t\tWHERE topic_id = {$topic_id}\r\n\t\t\t\tAND user_id = " . $userdata['user_id'];
if (!($result = $db->sql_query($sql))) {
$db->clear_cache('posts_');
message_die(GENERAL_ERROR, 'Could not obtain topic watch information', '', __LINE__, __FILE__, $sql);
}
$row = $db->sql_fetchrow($result);
if (!$notify_user && !empty($row['topic_id'])) {
$sql = "DELETE FROM " . TOPICS_WATCH_TABLE . "\r\n\t\t\t\tWHERE topic_id = {$topic_id}\r\n\t\t\t\t\tAND user_id = " . $userdata['user_id'];
if (!$db->sql_query($sql)) {
$db->clear_cache('posts_');
message_die(GENERAL_ERROR, 'Could not delete topic watch information', '', __LINE__, __FILE__, $sql);
}
} else {
if ($notify_user && empty($row['topic_id'])) {
$sql = "INSERT INTO " . TOPICS_WATCH_TABLE . " (user_id, topic_id, notify_status)\r\n\t\t\t\tVALUES (" . $userdata['user_id'] . ", {$topic_id}, 0)";
if (!$db->sql_query($sql)) {
//.........这里部分代码省略.........
示例7: strlen
$key_len = 54 - strlen($server_url);
$key_len = $key_len > 6 ? $key_len : 6;
$user_actkey = substr($user_actkey, 0, $key_len);
$user_password = gen_rand_string(false);
$sql = "UPDATE " . USERS_TABLE . " \n\t\t\t\tSET user_newpasswd = '" . md5($user_password) . "', user_actkey = '{$user_actkey}' \n\t\t\t\tWHERE user_id = " . $row['user_id'];
if (!$db->sql_query($sql)) {
message_die(GENERAL_ERROR, 'Could not update new password information', '', __LINE__, __FILE__, $sql);
}
include $phpbb_root_path . 'includes/emailer.' . $phpEx;
$emailer = new emailer($board_config['smtp_delivery']);
$emailer->from($board_config['board_email']);
$emailer->replyto($board_config['board_email']);
$emailer->use_template('user_activate_passwd', $row['user_lang']);
$emailer->email_address($row['user_email']);
$emailer->set_subject($lang['New_password_activation']);
$emailer->assign_vars(array('SITENAME' => $board_config['sitename'], 'USERNAME' => $username, 'PASSWORD' => $user_password, 'EMAIL_SIG' => !empty($board_config['board_email_sig']) ? str_replace('<br />', "\n", "-- \n" . $board_config['board_email_sig']) : '', 'U_ACTIVATE' => $server_url . '?mode=activate&' . POST_USERS_URL . '=' . $user_id . '&act_key=' . $user_actkey));
$emailer->send();
$emailer->reset();
$template->assign_vars(array('META' => '<meta http-equiv="refresh" content="15;url=' . append_sid("index.{$phpEx}") . '">'));
$message = $lang['Password_updated'] . '<br /><br />' . sprintf($lang['Click_return_index'], '<a href="' . append_sid("index.{$phpEx}") . '">', '</a>');
message_die(GENERAL_MESSAGE, $message);
} else {
message_die(GENERAL_MESSAGE, $lang['No_email_match']);
}
} else {
message_die(GENERAL_ERROR, 'Could not obtain user information for sendpassword', '', __LINE__, __FILE__, $sql);
}
} else {
$username = '';
$email = '';
}
示例8: a
$error_msg = "You have not entered a (valid) email address";
}
if (!$error) {
include $phpbb_root_path . 'includes/emailer.' . $phpEx;
$emailer = new emailer($board_config['smtp_delivery']);
$email_headers = 'X-AntiAbuse: Board servername - ' . $server_name . "\n";
$email_headers .= 'X-AntiAbuse: User_id - ' . $userdata['user_id'] . "\n";
$email_headers .= 'X-AntiAbuse: Username - ' . $userdata['username'] . "\n";
$email_headers .= 'X-AntiAbuse: User IP - ' . decode_ip($user_ip) . "\r\n";
$emailer->from($userdata['username'] . " <" . $userdata['user_email'] . ">");
$emailer->replyto($userdata['username'] . " <" . $userdata['user_email'] . ">");
$emailer->use_template('tellafriend_email', $userdata['user_lang']);
$emailer->email_address($friendname . '<' . $friendemail . '>');
$emailer->set_subject(trim(stripslashes($topic)));
$emailer->extra_headers($email_headers);
$emailer->assign_vars(array('SITENAME' => $board_config['sitename'], 'BOARD_EMAIL' => $board_config['board_email'], 'FROM_USERNAME' => $userdata['username'], 'TO_USERNAME' => $friendname, 'MESSAGE' => $message));
$emailer->send();
$emailer->reset();
$template->assign_vars(array('META' => '<meta http-equiv="refresh" content="3;url=' . append_sid($_POST['link']) . '">'));
$message = $lang['Email_sent'] . '<br /><br />' . sprintf($lang['Click_return_index'], '<a href="' . append_sid("index.{$phpEx}") . '">', '</a>');
message_die(GENERAL_MESSAGE, $message);
}
if ($error) {
$template->set_filenames(array('reg_header' => 'error_body.tpl'));
$template->assign_vars(array('ERROR_MESSAGE' => $error_msg));
$template->assign_var_from_handle('ERROR_BOX', 'reg_header');
}
}
include $phpbb_root_path . 'includes/page_header.' . $phpEx;
$template->set_filenames(array("body" => "tellafriend_body.tpl"));
$template->pparse("body");
示例9: main
function main($action)
{
global $db, $config, $template, $images, $user, $lang;
global $pafiledb_config, $debug;
$file_id = request_var('file_id', 0);
if (empty($file_id)) {
message_die(GENERAL_MESSAGE, $lang['File_not_exist']);
}
$sql = 'SELECT file_catid, file_name
FROM ' . PA_FILES_TABLE . "\n\t\t\tWHERE file_id = {$file_id}";
$result = $db->sql_query($sql);
if (!($file_data = $db->sql_fetchrow($result))) {
message_die(GENERAL_MESSAGE, $lang['File_not_exist']);
}
$db->sql_freeresult($result);
if (!$this->auth[$file_data['file_catid']]['auth_email']) {
if (!$user->data['session_logged_in']) {
redirect(append_sid(CMS_PAGE_LOGIN . '?redirect=dload.' . PHP_EXT . '&action=email&file_id=' . $file_id, true));
}
$message = sprintf($lang['Sorry_auth_email'], $this->auth[$file_data['file_catid']]['auth_email_type']);
message_die(GENERAL_MESSAGE, $message);
}
if (isset($_POST['submit'])) {
// session id check
$sid = request_post_var('sid', '');
if (empty($sid) || $sid != $user->data['session_id']) {
message_die(GENERAL_ERROR, 'INVALID_SESSION');
}
$error = false;
$femail = request_var('femail', '');
if (!empty($femail) && preg_match('/^[a-z0-9\\.\\-_\\+]+@[a-z0-9\\-_]+\\.([a-z0-9\\-_]+\\.)*?[a-z]+$/is', $femail)) {
$user_email = $femail;
} else {
$error = true;
$error_msg = !empty($error_msg) ? $error_msg . '<br />' . $lang['Email_invalid'] : $lang['Email_invalid'];
}
$username = request_var('fname', '', true);
$sender_name = request_var('sname', '', true);
//if (!$user->data['session_logged_in'] || ($user->data['session_logged_in'] && ($sender_name != $user->data['username'])))
if (!$user->data['session_logged_in']) {
// Mighty Gorgon: is this really needed?
/*
include(IP_ROOT_PATH . 'includes/functions_validate.' . PHP_EXT);
$result = validate_username($sender_name);
if ($result['error'])
{
$error = true;
$error_msg .= (!empty($error_msg)) ? '<br />' . $result['error_msg'] : $result['error_msg'];
}
*/
} else {
$sender_name = $user->data['username'];
}
if (!$user->data['session_logged_in']) {
$semail = request_var('semail', '');
if (!empty($semail) && preg_match('/^[a-z0-9\\.\\-_\\+]+@[a-z0-9\\-_]+\\.([a-z0-9\\-_]+\\.)*?[a-z]+$/is', $femail)) {
$sender_email = $semail;
} else {
$error = true;
$error_msg = !empty($error_msg) ? $error_msg . '<br />' . $lang['Email_invalid'] : $lang['Email_invalid'];
}
} else {
$sender_email = $user->data['user_email'];
}
$subject = request_var('subject', '', true);
$subject = htmlspecialchars_decode($subject, ENT_COMPAT);
if (empty($subject)) {
$error = true;
$error_msg = !empty($error_msg) ? $error_msg . '<br />' . $lang['Empty_subject_email'] : $lang['Empty_subject_email'];
}
$message = request_var('message', '', true);
// We need to check if HTML emails are enabled so we can correctly escape content and linebreaks
$message = !empty($config['html_email']) ? nl2br($message) : htmlspecialchars_decode($message, ENT_COMPAT);
if (empty($message)) {
$error = true;
$error_msg = !empty($error_msg) ? $error_msg . '<br />' . $lang['Empty_message_email'] : $lang['Empty_message_email'];
}
if (!$error) {
include IP_ROOT_PATH . 'includes/emailer.' . PHP_EXT;
$emailer = new emailer();
$emailer->headers('X-AntiAbuse: Board servername - ' . trim($config['server_name']));
$emailer->headers('X-AntiAbuse: User_id - ' . $user->data['user_id']);
$emailer->headers('X-AntiAbuse: Username - ' . $user->data['username']);
$emailer->headers('X-AntiAbuse: User IP - ' . $user_ip);
$emailer->use_template('profile_send_email', $user_lang);
$emailer->to($user_email);
$emailer->from($sender_email);
$emailer->replyto($sender_email);
$emailer->set_subject($subject);
$emailer->assign_vars(array('SITENAME' => $config['sitename'], 'BOARD_EMAIL' => $config['board_email'], 'FROM_USERNAME' => $sender_name, 'TO_USERNAME' => $username, 'MESSAGE' => $message));
$emailer->send();
$emailer->reset();
$message = $lang['Econf'] . '<br /><br />' . sprintf($lang['Click_return'], '<a href="' . append_sid('dload.' . PHP_EXT . '?action=file&file_id=' . $file_id) . '">', '</a>') . '<br /><br />' . sprintf($lang['Click_return_forum'], '<a href="' . append_sid(CMS_PAGE_HOME) . '">', '</a>');
message_die(GENERAL_MESSAGE, $message);
}
if ($error) {
message_die(GENERAL_MESSAGE, $error_msg);
}
}
$this->generate_category_nav($file_data['file_catid']);
//.........这里部分代码省略.........
示例10: emailer
$group_sql = "SELECT group_name \n\t\t\t\t\t\t\tFROM " . GROUPS_TABLE . " \n\t\t\t\t\t\t\tWHERE group_id = {$group_id}";
if (!($result = $db->sql_query($group_sql))) {
message_die(GENERAL_ERROR, 'Could not get group information', '', __LINE__, __FILE__, $group_sql);
}
$group_name_row = $db->sql_fetchrow($result);
$group_name = $group_name_row['group_name'];
include $phpbb_root_path . 'includes/emailer.' . $phpEx;
$emailer = new emailer($board_config['smtp_delivery']);
$emailer->from($board_config['board_email']);
$emailer->replyto($board_config['board_email']);
for ($i = 0; $i < count($bcc_list); $i++) {
$emailer->bcc($bcc_list[$i]);
}
$emailer->use_template('group_approved');
$emailer->set_subject($lang['Group_approved']);
$emailer->assign_vars(array('SITENAME' => $board_config['sitename'], 'GROUP_NAME' => $group_name, 'EMAIL_SIG' => !empty($board_config['board_email_sig']) ? str_replace('<br />', "\n", "-- \n" . $board_config['board_email_sig']) : '', 'U_GROUPCP' => $server_url . '?' . POST_GROUPS_URL . "={$group_id}"));
$emailer->send();
$emailer->reset();
}
}
}
}
//
// END approve or deny
//
} else {
message_die(GENERAL_MESSAGE, $lang['No_groups_exist']);
}
//
// Get group details
//
示例11: emailer
if (!empty($warning_data['user_email'])) {
$server_url = create_server_url();
$viewtopic_server_url = $server_url . CMS_PAGE_VIEWTOPIC;
$from_email = $user->data['user_email'] && $user->data['user_allow_viewemail'] ? $user->data['user_email'] : $config['board_email'];
include_once IP_ROOT_PATH . 'includes/emailer.' . PHP_EXT;
$emailer = new emailer();
$emailer->headers('X-AntiAbuse: Board servername - ' . trim($config['server_name']));
$emailer->headers('X-AntiAbuse: User_id - ' . $user->data['user_id']);
$emailer->headers('X-AntiAbuse: Username - ' . $user->data['username']);
$emailer->headers('X-AntiAbuse: User IP - ' . $user_ip);
$emailer->use_template($e_temp, $warning_data['user_lang']);
$emailer->to($warning_data['user_email']);
$emailer->from($from_email);
$emailer->replyto($from_email);
//$emailer->set_subject($e_subj);
$email_sig = create_signature($config['board_email_sig']);
$emailer->assign_vars(array('SITENAME' => $config['sitename'], 'WARNINGS' => $warning_data['user_warnings'], 'TOTAL_WARN' => $config['max_user_bancard'], 'POST_URL' => $viewtopic_server_url . '?' . $forum_id_append . $topic_id_append . POST_POST_URL . '=' . $post_id . '#p' . $post_id, 'EMAIL_SIG' => $email_sig, 'WARNER' => $user->data['username'], 'BLOCK_TIME' => $block_time, 'WARNED_POSTER' => $warning_data['username']));
$emailer->send();
$emailer->reset();
} else {
$message .= '<br /><br />' . $lang['user_no_email'];
}
} elseif ($already_banned) {
$message = $lang['user_already_banned'];
} else {
$message = 'Error in card.' . PHP_EXT;
}
$cache->destroy_datafiles(array('_ranks'), MAIN_CACHE_FOLDER, 'data', false);
$db->clear_cache('ban_', USERS_CACHE_FOLDER);
$message .= !empty($post_id) && $post_id > 0 ? '<br /><br />' . sprintf($lang['Click_return_viewtopic'], '<a href="' . append_sid(CMS_PAGE_VIEWTOPIC . '?' . $forum_id_append . $topic_id_append . POST_POST_URL . '=' . $post_id . '#p' . $post_id) . '">', '</a>') : '<br /><br />' . sprintf($lang['Click_return_profile'], '<a href="' . append_sid(CMS_PAGE_PROFILE . '?mode=viewprofile&' . POST_USERS_URL . '=' . $poster_id) . '">', '</a>') . '<br /><br />' . sprintf($lang['Click_return_index'], '<a href="' . append_sid(CMS_PAGE_FORUM) . '">', '</a>');
message_die(GENERAL_MESSAGE, $message);
示例12: emailer
if (!($result = $db->sql_query($sql))) {
message_die(GENERAL_ERROR, 'Could not rename users group', '', __LINE__, __FILE__, $sql);
}
}
// send mails if requested
if ($active_changed) {
//
// The users account has been deactivated, send them an email with a new activation key
//
$emailer = new emailer($board_config['smtp_delivery']);
$email_headers = "From: " . $board_config['board_email'] . "\nReturn-Path: " . $board_config['board_email'] . "\n";
$emailer->use_template('user_activate', stripslashes($view_userdata['user_lang']));
$emailer->email_address($user_email);
$emailer->set_subject($lang['Reactivate']);
$emailer->extra_headers($email_headers);
$emailer->assign_vars(array('SITENAME' => $board_config['sitename'], 'USERNAME' => preg_replace($unhtml_specialchars_match, $unhtml_specialchars_replace, substr(str_replace("\\'", "'", $username), 0, 25)), 'EMAIL_SIG' => !empty($board_config['board_email_sig']) ? str_replace('<br />', "\n", "-- \n" . $board_config['board_email_sig']) : '', 'U_ACTIVATE' => $server_url . '?mode=activate&' . POST_USERS_URL . '=' . $user_id . '&act_key=' . $user_actkey));
$emailer->send();
$emailer->reset();
}
}
}
//
// send update message
if (!$user_active) {
if ($userdata['session_logged_in'] && !is_admin($userdata)) {
session_end($userdata['session_id'], $userdata['user_id']);
}
if ($create_user) {
if ($board_config['require_activation'] == USER_ACTIVATION_SELF) {
$message = $lang['Account_inactive'] . '<br /><br />' . sprintf($lang['Click_return_index'], '<a href="' . append_sid("index.{$phpEx}") . '">', '</a>');
} else {
示例13: home
//.........这里部分代码省略.........
$name_compose = '';
if (isset($row['address_name']) && !empty($row['address_name'])) {
$row['address_name'] = preg_replace('/\s\s+/', ' ', $row['address_name']);
$name_compose = ucwords(strtolower(trim($row['address_name'])));
if (isset($row['address_last']) && !empty($row['address_last'])) {
$row['address_last'] = preg_replace('/\s\s+/', ' ', $row['address_last']);
$name_compose .= ' ' . ucwords(strtolower(trim($row['address_last'])));
}
if (!empty($name_compose)) {
$name_gretting = '';
if (isset($row['address_gender']) && !empty($row['address_gender'])) {
switch ($row['address_gender']) {
case 'Femenino':
$name_by = 'a';
break;
case 'Masculino':
$name_by = 'o';
break;
default:
$name_gretting = $core->config['email_gretting'];
break;
}
} else {
if (strpos($name_compose, 'Sra.') !== false || strpos($name_compose, 'Srta.') !== false) {
$name_by = 'a';
} else if (strpos($name_compose, 'Sr.') !== false) {
$name_by = 'o';
} else {
$name_gretting = $core->config['email_gretting'];
}
}
if (empty($email['email_gretting'])) {
$name_gretting = $core->config['email_gretting'];
}
if (!empty($name_gretting)) {
$name_compose = $name_gretting . ' ' . $name_compose;
} elseif (!empty($name_by)) {
if (strpos($email['email_gretting'], '*') !== false) {
$name_compose = str_replace('*', $name_by, $email['email_gretting']) . ' ' . $name_compose;
}
}
if (!empty($name_compose)) {
$name_compose .= ', ';
}
}
}
$email_message = entity_decode($email['email_message']);
if (strpos($email_message, '<system_image>') !== false) {
$enc_email_id = encode($email['email_id']);
$enc_address_id = encode($row['address_id']);
$system_image_link = _link('i' . $enc_email_id . '-' . $enc_address_id . '.jpg', false, false);
$email_message = str_replace('<system_image>', $system_image_link, $email_message);
}
$emailer->assign_vars(array(
'USERNAME' => $name_compose,
'MESSAGE' => $email_message)
);
$emailer->send();
$emailer->reset();
$sql = 'UPDATE ?? SET address_sent = ?
WHERE address_id = ?';
sql_query(sql_filter($sql, $email['email_data'], time(), $row['address_id']));
$i++;
$sql = 'UPDATE _email SET email_last = email_last + 1
WHERE email_id = ?';
sql_query(sql_filter($sql, $email['email_id']));
$sent_to[] = $row['address_account'];
sleep(1);
}
$sql = 'SELECT COUNT(address_id) AS total
FROM ??
WHERE address_sent = 0
ORDER BY address_id';
if (!sql_field(sql_filter($sql, $email['email_data']), 'total', 0)) {
$sql = 'UPDATE _email SET email_active = 0, email_end = ?
WHERE email_id = ?';
sql_query(sql_filter($sql, time(), $email['email_id']));
return $this->e('Finished sending ' . $i . ' emails.');
}
return $this->e('Processed ' . $i . ' emails.');
}
示例14: user_notification
function user_notification($mode, &$post_data, &$topic_title, &$forum_id, &$topic_id, &$post_id, &$notify_user)
{
global $config, $lang, $userdata, $user_ip;
$current_time = time();
if ($mode == 'delete')
{
$delete_sql = (!$post_data['first_post'] && !$post_data['last_post']) ? sql_filter(' AND user_id = ? ', $userdata['user_id']) : '';
$sql = 'DELETE FROM _forum_topics_fav WHERE topic_id = ?' . $delete_sql;
sql_query(sql_filter($sql, $topic_id));
}
else
{
if ($mode == 'reply')
{
$sql = 'SELECT ban_userid
FROM _banlist';
$result = sql_rowset($sql);
$user_id_sql = '';
foreach ($result as $row) {
if (isset($row['ban_userid']) && !empty($row['ban_userid'])) {
$user_id_sql .= ', ' . $row['ban_userid'];
}
}
$update_watched_sql = '';
$bcc_list_ary = w();
$usr_list_ary = w();
$sql = 'SELECT DISTINCT u.user_id, u.user_email, u.user_lang
FROM _forum_topics_fav tw
INNER JOIN _members u ON tw.user_id = u.user_id
INNER JOIN _members_group ug ON tw.user_id = ug.user_id
LEFT OUTER JOIN _auth_access aa ON ug.group_id = aa.group_id, _forums f
WHERE tw.topic_id = ?
AND tw.user_id NOT IN (??, ??, ??)
AND tw.notify_status = ?
AND f.forum_id = ?
AND u.user_active = 1
AND (
(aa.forum_id = ? AND aa.auth_read = 1)
OR f.auth_read <= ?
OR (u.user_level = ? AND f.auth_read = ?)
OR u.user_level = ?
)';
if ($result = sql_rowset(sql_filter($sql, $topic_id, $userdata['user_id'], GUEST, $user_id_sql, TOPIC_WATCH_UN_NOTIFIED, $forum_id, $forum_id, AUTH_REG, USER_MOD, AUTH_MOD, USER_ADMIN))) {
@set_time_limit(60);
foreach ($result as $row) {
if ($row['user_email'] != '') {
$bcc_list_ary[$row['user_lang']][] = $row['user_email'];
}
$update_watched_sql .= ($update_watched_sql != '') ? ', ' . $row['user_id'] : $row['user_id'];
}
if (sizeof($bcc_list_ary)) {
$emailer = new emailer();
$server_name = trim($config['server_name']);
$server_protocol = ($config['cookie_secure']) ? 'https://' : 'http://';
$post_url = $server_protocol . $server_name . s_link('post', $post_id) . "#$post_id";
$emailer->from($config['board_email']);
$emailer->replyto($config['board_email']);
$topic_title = unprepare_message($topic_title);
@reset($bcc_list_ary);
while (list($user_lang, $bcc_list) = each($bcc_list_ary))
{
$emailer->use_template('topic_notify', $user_lang);
for ($i = 0; $i < count($bcc_list); $i++)
{
$emailer->bcc($bcc_list[$i]);
}
// The Topic_reply_notification lang string below will be used
// if for some reason the mail template subject cannot be read
// ... note it will not necessarily be in the posters own language!
$emailer->set_subject($lang['Topic_reply_notification']);
// This is a nasty kludge to remove the username var ... till (if?)
// translators update their templates
$emailer->msg = preg_replace('#[ ]?{USERNAME}#', '', $emailer->msg);
$emailer->assign_vars(array(
'EMAIL_SIG' => '',
'SITENAME' => $config['sitename'],
'TOPIC_TITLE' => $topic_title,
'U_TOPIC' => $post_url,
'U_STOP_WATCHING_TOPIC' => $server_protocol . $server_name . $script_name . '&' . POST_TOPIC_URL . "=$topic_id&unwatch=topic")
);
//.........这里部分代码省略.........
示例15: emailer
$emailer = new emailer();
$emailer->from($config['board_email']);
$emailer->replyto($config['board_email']);
for ($i = 0; $i < count($bcc_list); $i++)
{
$emailer->bcc($bcc_list[$i]);
}
$emailer->use_template('group_approved');
$emailer->set_subject($lang['Group_approved']);
$emailer->assign_vars(array(
'SITENAME' => $config['sitename'],
'GROUP_NAME' => $group_name,
'U_GROUPCP' => $server_url . '?' . POST_GROUPS_URL . "=$group_id")
);
$emailer->send();
$emailer->reset();
}
}
}
}
//
// END approve or deny
//
}
else
{
trigger_error('No_groups_exist');