本文整理汇总了PHP中nv_check_valid_email函数的典型用法代码示例。如果您正苦于以下问题:PHP nv_check_valid_email函数的具体用法?PHP nv_check_valid_email怎么用?PHP nv_check_valid_email使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了nv_check_valid_email函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: nv_check_email_reg
function nv_check_email_reg($email)
{
global $db, $lang_module;
$error = nv_check_valid_email($email);
if ($error != "") {
return preg_replace("/\\&(l|r)dquo\\;/", "", strip_tags($error));
}
$sql = "SELECT `content` FROM `" . NV_USERS_GLOBALTABLE . "_config` WHERE `config`='deny_email'";
$result = $db->sql_query($sql);
list($deny_email) = $db->sql_fetchrow($result);
$db->sql_freeresult();
if (!empty($deny_email) and preg_match("/" . $deny_email . "/i", $email)) {
return sprintf($lang_module['email_deny_name'], $email);
}
list($left, $right) = explode("@", $email);
$left = preg_replace("/[\\.]+/", "", $left);
$pattern = str_split($left);
$pattern = implode(".?", $pattern);
$pattern = "^" . $pattern . "@" . $right . "\$";
$sql = "SELECT `userid` FROM `" . NV_USERS_GLOBALTABLE . "` WHERE `email` RLIKE " . $db->dbescape($pattern);
if ($db->sql_numrows($db->sql_query($sql)) != 0) {
return sprintf($lang_module['email_registered_name'], $email);
}
$sql = "SELECT `userid` FROM `" . NV_USERS_GLOBALTABLE . "_reg` WHERE `email`RLIKE " . $db->dbescape($pattern);
if ($db->sql_numrows($db->sql_query($sql)) != 0) {
return sprintf($lang_module['email_registered_name'], $email);
}
$sql = "SELECT `userid` FROM `" . NV_USERS_GLOBALTABLE . "_openid` WHERE `email` RLIKE " . $db->dbescape($pattern);
if ($db->sql_numrows($db->sql_query($sql)) != 0) {
return sprintf($lang_module['email_registered_name'], $email);
}
return "";
}
示例2: nv_check_email_change
/**
* nv_check_email_change()
*
* @param mixed $email
* @return
*/
function nv_check_email_change($email)
{
global $db, $lang_module, $user_info;
$error = nv_check_valid_email($email);
if ($error != "") {
return $error;
}
$sql = "SELECT `content` FROM `" . NV_USERS_GLOBALTABLE . "_config` WHERE `config`='deny_email'";
$result = $db->sql_query($sql);
list($deny_email) = $db->sql_fetchrow($result);
$db->sql_freeresult();
if (!empty($deny_email) and preg_match("/" . $deny_email . "/i", $email)) {
return sprintf($lang_module['email_deny_name'], '<strong>' . $email . '</strong>');
}
$sql = "SELECT `userid` FROM `" . NV_USERS_GLOBALTABLE . "` WHERE `userid`!=" . $user_info['userid'] . " AND `email`=" . $db->dbescape($email);
if ($db->sql_numrows($db->sql_query($sql)) != 0) {
return sprintf($lang_module['email_registered_name'], '<strong>' . $email . '</strong>');
}
$sql = "SELECT `userid` FROM `" . NV_USERS_GLOBALTABLE . "_reg` WHERE `email`=" . $db->dbescape($email);
if ($db->sql_numrows($db->sql_query($sql)) != 0) {
return sprintf($lang_module['email_registered_name'], '<strong>' . $email . '</strong>');
}
$sql = "SELECT `userid` FROM `" . NV_USERS_GLOBALTABLE . "_openid` WHERE `userid`!=" . $user_info['userid'] . " AND `email`=" . $db->dbescape($email);
if ($db->sql_numrows($db->sql_query($sql)) != 0) {
return sprintf($lang_module['email_registered_name'], '<strong>' . $email . '</strong>');
}
return "";
}
示例3: nv_SendMail2User
/**
* nv_SendMail2User()
*
* @param mixed $cid
* @param mixed $fcontent
* @param mixed $ftitle
* @param mixed $femail
* @param mixed $full_name
* @return void
*/
function nv_SendMail2User($cid, $fcontent, $ftitle, $femail, $full_name)
{
global $db, $module_data;
$email_list = array();
$sql = "SELECT `email`, `admins` FROM `" . NV_PREFIXLANG . "_" . $module_data . "_rows` WHERE `id` =" . $cid;
$result = $db->sql_query($sql);
list($email, $admins) = $db->sql_fetchrow($result);
if (!empty($email)) {
$email_list[] = $email;
}
if (!empty($admins)) {
$admins = array_map("trim", explode(";", $admins));
$a_l = array();
foreach ($admins as $adm) {
if (preg_match("/^([0-9]+)\\/([0-1]{1})\\/([0-1]{1})\\/([0-1]{1})\$/i", $adm)) {
$adm2 = array_map("trim", explode("/", $adm));
if ($adm2[3] == 1) {
$a_l[] = intval($adm2[0]);
}
}
}
if (!empty($a_l)) {
$a_l = implode(",", $a_l);
$sql = "SELECT t2.email as admin_email FROM `" . NV_AUTHORS_GLOBALTABLE . "` AS t1 INNER JOIN `" . NV_USERS_GLOBALTABLE . "` AS t2 ON t1.admin_id = t2.userid WHERE t1.lev!=0 AND t1.is_suspend=0 AND t1.admin_id IN (" . $a_l . ")";
$result = $db->sql_query($sql);
while ($row = $db->sql_fetchrow($result)) {
if (nv_check_valid_email($row['admin_email']) == "") {
$email_list[] = $row['admin_email'];
}
}
}
}
$email_list = array_unique($email_list);
if (!empty($email_list)) {
$from = array($full_name, $femail);
foreach ($email_list as $to) {
@nv_sendmail($from, $to, $ftitle, $fcontent);
}
}
}
示例4: nv_check_email_reg
/**
* nv_check_email_reg()
* Ham kiem tra email kha dung
*
* @param mixed $email
* @return
*/
function nv_check_email_reg($email)
{
global $db, $db_config, $lang_module;
$error = nv_check_valid_email($email);
if ($error != '') {
return preg_replace('/\\&(l|r)dquo\\;/', '', strip_tags($error));
}
$sql = "SELECT content FROM " . NV_USERS_GLOBALTABLE . "_config WHERE config='deny_email'";
$result = $db->query($sql);
$deny_email = $result->fetchColumn();
$result->closeCursor();
if (!empty($deny_email) and preg_match('/' . $deny_email . '/i', $email)) {
return sprintf($lang_module['email_deny_name'], $email);
}
list($left, $right) = explode('@', $email);
$left = preg_replace('/[\\.]+/', '', $left);
$pattern = str_split($left);
$pattern = implode('.?', $pattern);
$pattern = '^' . $pattern . '@' . $right . '$';
$stmt = $db->prepare('SELECT userid FROM ' . NV_USERS_GLOBALTABLE . ' WHERE email RLIKE :pattern');
$stmt->bindParam(':pattern', $pattern, PDO::PARAM_STR);
$stmt->execute();
if ($stmt->fetchColumn()) {
return sprintf($lang_module['email_registered_name'], $email);
}
$stmt = $db->prepare('SELECT userid FROM ' . NV_USERS_GLOBALTABLE . '_reg WHERE email RLIKE :pattern');
$stmt->bindParam(':pattern', $pattern, PDO::PARAM_STR);
$stmt->execute();
if ($stmt->fetchColumn()) {
return sprintf($lang_module['email_registered_name'], $email);
}
$stmt = $db->prepare('SELECT userid FROM ' . NV_USERS_GLOBALTABLE . '_openid WHERE email RLIKE :pattern');
$stmt->bindParam(':pattern', $pattern, PDO::PARAM_STR);
$stmt->execute();
if ($stmt->fetchColumn()) {
return sprintf($lang_module['email_registered_name'], $email);
}
return '';
}
示例5: nv_SendMail2User
/**
* nv_SendMail2User()
*
* @param mixed $cid
* @param mixed $fcontent
* @param mixed $ftitle
* @param mixed $femail
* @param mixed $full_name
* @return void
*/
function nv_SendMail2User($cid, $fcontent, $ftitle, $femail, $full_name)
{
global $db, $module_data, $db_config;
$email_list = array();
$sql = 'SELECT email, admins FROM ' . NV_PREFIXLANG . '_' . $module_data . '_department WHERE id =' . $cid;
$result = $db->query($sql);
list($email, $admins) = $result->fetch(3);
if (!empty($email)) {
$email_list[] = $email;
}
if (!empty($admins)) {
$admins = array_map('trim', explode(';', $admins));
$a_l = array();
foreach ($admins as $adm) {
if (preg_match('/^([0-9]+)\\/([0-1]{1})\\/([0-1]{1})\\/([0-1]{1})$/i', $adm)) {
$adm2 = array_map('trim', explode('/', $adm));
if ($adm2[3] == 1) {
$a_l[] = intval($adm2[0]);
}
}
}
if (!empty($a_l)) {
$a_l = implode(',', $a_l);
$sql = 'SELECT t2.email as admin_email FROM ' . NV_AUTHORS_GLOBALTABLE . ' t1 INNER JOIN ' . NV_USERS_GLOBALTABLE . ' t2 ON t1.admin_id = t2.userid WHERE t1.lev!=0 AND t1.is_suspend=0 AND t1.admin_id IN (' . $a_l . ')';
$result = $db->query($sql);
while ($row = $result->fetch()) {
if (nv_check_valid_email($row['admin_email']) == '') {
$email_list[] = $row['admin_email'];
}
}
}
}
if (!empty($email_list)) {
$from = array($full_name, $femail);
$email_list = array_unique($email_list);
@nv_sendmail($from, $email_list, $ftitle, $fcontent);
}
}
示例6: array
} else {
$data = array();
$data['checkss'] = md5($client_info['session_id'] . $global_config['sitekey']);
$data['userField'] = nv_substr($nv_Request->get_title('userField', 'post', '', 1), 0, 100);
$data['answer'] = nv_substr($nv_Request->get_title('answer', 'post', '', 1), 0, 255);
$data['send'] = $nv_Request->get_bool('send', 'post', false);
$data['nv_seccode'] = $nv_Request->get_title('nv_seccode', 'post', '');
$data['nv_redirect'] = $nv_Request->get_title('nv_redirect', 'get, post', '');
$checkss = $nv_Request->get_title('checkss', 'post', '');
$seccode = $nv_Request->get_string('lostpass_seccode', 'session', '');
$step = 1;
$error = $question = '';
if ($checkss == $data['checkss']) {
if (!empty($seccode) and md5($data['nv_seccode']) == $seccode or nv_capcha_txt($data['nv_seccode'])) {
if (!empty($data['userField'])) {
$check_email = nv_check_valid_email($data['userField']);
if (empty($check_email)) {
$sql = 'SELECT * FROM ' . NV_USERS_GLOBALTABLE . ' WHERE email= :userField AND active=1';
$userField = $data['userField'];
} else {
$sql = 'SELECT * FROM ' . NV_USERS_GLOBALTABLE . ' WHERE md5username=:userField AND active=1';
$userField = nv_md5safe($data['userField']);
}
$stmt = $db->prepare($sql);
$stmt->bindParam(':userField', $userField, PDO::PARAM_STR);
$stmt->execute();
$row = $stmt->fetch();
if (!empty($row)) {
$step = 2;
if (empty($seccode)) {
$nv_Request->set_Session('lostpass_seccode', md5($data['nv_seccode']));
示例7: array_filter
}
if (!empty($array_department[$fpart]['admins'])) {
$admins = array_filter(array_map('trim', explode(';', $array_department[$fpart]['admins'])));
$a_l = array();
foreach ($admins as $adm) {
unset($adm2);
if (preg_match('/^([0-9]+)\\/[0-1]{1}\\/[0-1]{1}\\/1$/', $adm, $adm2)) {
$a_l[] = $adm2[1];
}
}
if (!empty($a_l)) {
$a_l = implode(',', $a_l);
$sql = 'SELECT t2.email as admin_email FROM ' . NV_AUTHORS_GLOBALTABLE . ' t1 INNER JOIN ' . NV_USERS_GLOBALTABLE . ' t2 ON t1.admin_id = t2.userid WHERE t1.lev!=0 AND t1.is_suspend=0 AND t2.active=1 AND t1.admin_id IN (' . $a_l . ')';
$result = $db_slave->query($sql);
while ($row = $result->fetch()) {
if (nv_check_valid_email($row['admin_email']) == '') {
$email_list[] = $row['admin_email'];
}
}
}
}
if (!empty($email_list)) {
$from = array($fname, $femail);
$email_list = array_unique($email_list);
@nv_sendmail($from, $email_list, $ftitle, $fcon_mail);
}
// Gửi bản sao đến hộp thư người gửi
if ($fsendcopy) {
$from = array($global_config['site_name'], $global_config['site_email']);
$fcon_mail = contact_sendcontact($row_id, $fcat, $ftitle, $fname, $femail, $fphone, $fcon, $fpart, false);
@nv_sendmail($from, $femail, $ftitle, $fcon_mail);
示例8: openidLogin_Res1
/**
* openidLogin_Res1()
* Function thuc hien khi OpenID duoc nhan dien
*
* @param mixed $attribs
* @return
*/
function openidLogin_Res1($attribs)
{
global $page_title, $key_words, $mod_title, $db, $crypt, $nv_Request, $lang_module, $lang_global, $module_name, $module_info, $global_config, $gfx_chk, $nv_redirect, $op, $db_config;
$email = (isset($attribs['contact/email']) and nv_check_valid_email($attribs['contact/email']) == '') ? $attribs['contact/email'] : '';
if (empty($email)) {
$nv_Request->unset_request('openid_attribs', 'session');
openidLogin_Res0($lang_module['logged_in_failed']);
die;
}
$opid = $crypt->hash($attribs['id']);
$current_mode = isset($attribs['current_mode']) ? $attribs['current_mode'] : 1;
$stmt = $db->prepare('SELECT a.userid AS uid, a.email AS uemail, b.active AS uactive FROM ' . NV_USERS_GLOBALTABLE . '_openid a, ' . NV_USERS_GLOBALTABLE . ' b
WHERE a.opid= :opid
AND a.email= :email
AND a.userid=b.userid');
$stmt->bindParam(':opid', $opid, PDO::PARAM_STR);
$stmt->bindParam(':email', $email, PDO::PARAM_STR);
$stmt->execute();
list($user_id, $op_email, $user_active) = $stmt->fetch(3);
if ($user_id) {
$nv_Request->unset_request('openid_attribs', 'session');
if ($op_email != $email) {
openidLogin_Res0($lang_module['not_logged_in']);
die;
}
if (!$user_active) {
openidLogin_Res0($lang_module['login_no_active']);
die;
}
if (defined('NV_IS_USER_FORUM') and file_exists(NV_ROOTDIR . '/' . DIR_FORUM . '/nukeviet/set_user_login.php')) {
require_once NV_ROOTDIR . '/' . DIR_FORUM . '/nukeviet/set_user_login.php';
if (defined('NV_IS_USER_LOGIN_FORUM_OK')) {
$nv_redirect = !empty($nv_redirect) ? nv_base64_decode($nv_redirect) : NV_BASE_SITEURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&' . NV_NAME_VARIABLE . '=' . $module_name;
} else {
$nv_redirect = NV_BASE_SITEURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&' . NV_NAME_VARIABLE . '=' . $module_name;
}
} else {
$query = 'SELECT * FROM ' . NV_USERS_GLOBALTABLE . ' WHERE userid=' . $user_id;
$row = $db->query($query)->fetch();
if (!empty($row)) {
validUserLog($row, 1, $opid, $current_mode);
$nv_redirect = !empty($nv_redirect) ? nv_base64_decode($nv_redirect) : NV_BASE_SITEURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&' . NV_NAME_VARIABLE . '=' . $module_name;
} else {
$nv_redirect = NV_BASE_SITEURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&' . NV_NAME_VARIABLE . '=' . $module_name;
}
}
Header('Location: ' . nv_url_rewrite($nv_redirect, true));
die;
}
$stmt = $db->prepare('SELECT * FROM ' . NV_USERS_GLOBALTABLE . ' WHERE email= :email');
$stmt->bindParam(':email', $email, PDO::PARAM_STR);
$stmt->execute();
$nv_row = $stmt->fetch();
if (!empty($nv_row)) {
$login_allowed = false;
if (empty($nv_row['password'])) {
$nv_Request->unset_request('openid_attribs', 'session');
$login_allowed = true;
}
if ($nv_Request->isset_request('openid_account_confirm', 'post')) {
$password = $nv_Request->get_string('password', 'post', '');
$nv_seccode = $nv_Request->get_title('nv_seccode', 'post', '');
$nv_seccode = !$gfx_chk ? 1 : (nv_capcha_txt($nv_seccode) ? 1 : 0);
$nv_Request->unset_request('openid_attribs', 'session');
if (defined('NV_IS_USER_FORUM') and file_exists(NV_ROOTDIR . '/' . DIR_FORUM . '/nukeviet/login.php')) {
$nv_username = $nv_row['username'];
$nv_password = $password;
require_once NV_ROOTDIR . '/' . DIR_FORUM . '/nukeviet/login.php';
if (empty($error)) {
$login_allowed = true;
} else {
openidLogin_Res0($lang_module['openid_confirm_failed']);
die;
}
} else {
if ($crypt->validate_password($password, $nv_row['password']) and $nv_seccode) {
$login_allowed = true;
} else {
openidLogin_Res0($lang_module['openid_confirm_failed']);
die;
}
}
}
if ($login_allowed) {
$stmt = $db->prepare('INSERT INTO ' . NV_USERS_GLOBALTABLE . '_openid VALUES (' . intval($nv_row['userid']) . ', :server, :opid, :email )');
$stmt->bindParam(':server', $attribs['server'], PDO::PARAM_STR);
$stmt->bindParam(':opid', $opid, PDO::PARAM_STR);
$stmt->bindParam(':email', $email, PDO::PARAM_STR);
$stmt->execute();
if (intval($nv_row['active']) != 1) {
openidLogin_Res0($lang_module['login_no_active']);
} else {
validUserLog($nv_row, 1, $opid, $current_mode);
//.........这里部分代码省略.........
示例9: die
* @Copyright (C) 2014 PHAN TAN DUNG. All rights reserved
* @License GNU/GPL version 2 or any later version
* @Createdate Dec 11, 2013, 09:50:11 PM
*/
if (!defined('NV_IS_MOD_BLOG')) {
die('Stop!!!');
}
// Dang ky nhan ban tin
if ($nv_Request->isset_request('newsletters', 'post')) {
$array['email'] = nv_substr($nv_Request->get_title('newsletters', 'post', '', 1), 0, 255);
$array['checksess'] = nv_substr($nv_Request->get_title('checksess', 'post', '', 1), 0, 255);
if (empty($array['email']) or empty($array['checksess']) or $array['checksess'] != md5($global_config['sitekey'] . $client_info['session_id'])) {
die('Error Access!!!');
}
// Kiem tra email hop le
$checkEmail = nv_check_valid_email($array['email']);
if ($checkEmail != '') {
die($checkEmail);
}
// Kiem tra email da dang ky
$sql = "SELECT * FROM " . $BL->table_prefix . "_newsletters WHERE email=" . $db->quote($array['email']);
$result = $db->query($sql);
if ($result->rowCount()) {
$row = $result->fetch();
if ($row['status'] == 0) {
die(sprintf($BL->lang('newsletterIsBan'), $array['email']));
} elseif ($row['status'] == 1) {
die(sprintf($BL->lang('newsletterIsActive'), $array['email']));
} else {
if (!$db->query("DELETE FROM " . $BL->table_prefix . "_newsletters WHERE email=" . $db->quote($array['email']))) {
die('Unknow Error!!!');
示例10: nv_substr
$_user['answer'] = nv_substr($nv_Request->get_title('answer', 'post', '', 1), 0, 255);
$_user['first_name'] = nv_substr($nv_Request->get_title('first_name', 'post', '', 1), 0, 255);
$_user['last_name'] = nv_substr($nv_Request->get_title('last_name', 'post', '', 1), 0, 255);
$_user['gender'] = nv_substr($nv_Request->get_title('gender', 'post', '', 1), 0, 1);
$_user['photo'] = nv_substr($nv_Request->get_title('photo', 'post', '', 1), 0, 255);
$_user['view_mail'] = $nv_Request->get_int('view_mail', 'post', 0);
$_user['sig'] = $nv_Request->get_textarea('sig', '', NV_ALLOWED_HTML_TAGS);
$_user['birthday'] = $nv_Request->get_title('birthday', 'post');
$_user['in_groups'] = $nv_Request->get_typed_array('group', 'post', 'int');
$_user['delpic'] = $nv_Request->get_int('delpic', 'post', 0);
$custom_fields = $nv_Request->get_array('custom_fields', 'post');
if ($_user['username'] != $row['username'] and ($error_username = nv_check_valid_login($_user['username'], NV_UNICKMAX, NV_UNICKMIN)) != '') {
$error = $error_username;
} elseif ("'" . $_user['username'] . "'" != $db->quote($_user['username'])) {
$error = sprintf($lang_module['account_deny_name'], '<strong>' . $_user['username'] . '</strong>');
} elseif (($error_xemail = nv_check_valid_email($_user['email'])) != '') {
$error = $error_xemail;
} elseif ($db->query('SELECT userid FROM ' . NV_USERS_GLOBALTABLE . ' WHERE userid!=' . $userid . ' AND md5username=' . $db->quote(nv_md5safe($_user['username'])))->fetchColumn()) {
$error = $lang_module['edit_error_username_exist'];
} elseif ($db->query('SELECT userid FROM ' . NV_USERS_GLOBALTABLE . ' WHERE userid!=' . $userid . ' AND email=' . $db->quote($_user['email']))->fetchColumn()) {
$error = $lang_module['edit_error_email_exist'];
} elseif ($db->query('SELECT userid FROM ' . NV_USERS_GLOBALTABLE . '_reg WHERE email=' . $db->quote($_user['email']))->fetchColumn()) {
$error = $lang_module['edit_error_email_exist'];
} elseif ($db->query('SELECT userid FROM ' . NV_USERS_GLOBALTABLE . '_openid WHERE userid!=' . $userid . ' AND email=' . $db->quote($_user['email']))->fetchColumn()) {
$error = $lang_module['edit_error_email_exist'];
} elseif (!empty($_user['password1']) and ($check_pass = nv_check_valid_pass($_user['password1'], NV_UPASSMAX, NV_UPASSMIN)) != '') {
$error = $check_pass;
} elseif (!empty($_user['password1']) and $_user['password1'] != $_user['password2']) {
$error = $lang_module['edit_error_password'];
} elseif (empty($_user['question'])) {
$error = $lang_module['edit_error_question'];
示例11: array
$array['linkdirect'] = array();
}
if (!empty($array['linkdirect'])) {
$array['linkdirect'] = array_unique($array['linkdirect']);
}
$stmt = $db->prepare('SELECT COUNT(*) FROM ' . NV_PREFIXLANG . '_' . $module_data . ' WHERE title= :title ');
$stmt->bindParam(':title', $array['title'], PDO::PARAM_STR);
$stmt->execute();
$is_exists = $stmt->fetchColumn();
if (empty($array['title'])) {
$is_error = true;
$error = $lang_module['file_error_title'];
} elseif ($is_exists) {
$is_error = true;
$error = $lang_module['file_title_exists'];
} elseif (!empty($array['author_email']) and ($check_valid_email = nv_check_valid_email($array['author_email'])) != '') {
$is_error = true;
$error = $check_valid_email;
} elseif (!empty($array['author_url']) and !nv_is_url($array['author_url'])) {
$is_error = true;
$error = $lang_module['file_error_author_url'];
} elseif (empty($array['fileupload']) and empty($array['linkdirect']) and empty($array['fileupload2'])) {
$is_error = true;
$error = $lang_module['file_error_fileupload'];
} else {
$alias = change_alias($array['title']);
$array['introtext'] = nv_nl2br($array['introtext'], '<br />');
if ($row['user_id']) {
$array['user_name'] = $row['user_name'];
}
if (!empty($array['fileupload2'])) {
示例12: intval
$xtpl->assign('GLANG', $lang_global);
$is_read = intval($row['is_read']);
if (!$is_read) {
$db->query('UPDATE ' . NV_PREFIXLANG . '_' . $module_data . '_send SET is_read=1 WHERE id=' . $id);
$is_read = 1;
}
$admin_name = $admin_info['full_name'];
if (empty($admin_name)) {
$admin_name = $admin_info['username'];
}
$mess_content = $error = '';
if ($nv_Request->get_int('save', 'post') == '1') {
$mess_content = $nv_Request->get_editor('mess_content', '', NV_ALLOWED_HTML_TAGS);
if (strip_tags($mess_content) != '') {
$from = $db->query('SELECT email FROM ' . NV_PREFIXLANG . '_' . $module_data . '_department WHERE id=' . $row['cid'])->fetchColumn();
if (nv_check_valid_email($from) != '') {
$from = $admin_info['email'];
}
$from = array($admin_name, $from);
$subject = 'Re: ' . $row['title'];
if (nv_sendmail($from, $row['sender_email'], $subject, $mess_content)) {
$sth = $db->prepare('INSERT INTO ' . NV_PREFIXLANG . '_' . $module_data . '_reply (id, reply_content, reply_time, reply_aid) VALUES (' . $id . ', :reply_content, ' . NV_CURRENTTIME . ', ' . $admin_info['admin_id'] . ')');
$sth->bindParam(':reply_content', $mess_content, PDO::PARAM_STR, strlen($mess_content));
$sth->execute();
$db->query('UPDATE ' . NV_PREFIXLANG . '_' . $module_data . '_send SET is_reply=1 WHERE id=' . $id);
Header('Location: ' . NV_BASE_ADMINURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&' . NV_NAME_VARIABLE . '=' . $module_name . '&' . NV_OP_VARIABLE . '=view&id=' . $id);
die;
} else {
$error = $lang_global['error_sendmail_admin'];
}
}
示例13: array
$array_config_global['site_keywords'] = array();
if (!empty($site_keywords)) {
foreach ($site_keywords as $keywords) {
if (!empty($keywords) and !is_numeric($keywords)) {
$array_config_global['site_keywords'][] = $keywords;
}
}
}
$array_config_global['site_keywords'] = !empty($array_config_global['site_keywords']) ? implode(", ", $array_config_global['site_keywords']) : "";
}
$array_config_global['site_email'] = filter_text_input('site_email', 'post', '', 1, 255);
if (nv_check_valid_email($array_config_global['site_email']) != '') {
$array_config_global['site_email'] = $global_config['site_email'];
}
$array_config_global['error_send_email'] = filter_text_input('error_send_email', 'post', '', 1, 255);
if (nv_check_valid_email($array_config_global['error_send_email']) != '') {
$array_config_global['error_send_email'] = $global_config['error_send_email'];
}
$array_config_global['site_phone'] = filter_text_input('site_phone', 'post', '', 1, 255);
$array_config_global['site_lang'] = filter_text_input('site_lang', 'post', '', 1, 255);
if (!in_array($array_config_global['site_lang'], $allow_sitelangs)) {
$array_config_global['site_lang'] = 'vi';
}
$array_config_global['site_timezone'] = filter_text_input('site_timezone', 'post', '', 1, 255);
$array_config_global['date_pattern'] = filter_text_input('date_pattern', 'post', '', 1, 255);
$array_config_global['time_pattern'] = filter_text_input('time_pattern', 'post', '', 1, 255);
$array_config_global['my_domains'] = filter_text_input('my_domains', 'post', '', 1, 255);
$my_domains = array(NV_SERVER_NAME);
if (!empty($array_config_global['my_domains'])) {
$array_config_global['my_domains'] = array_map("trim", explode(",", $array_config_global['my_domains']));
foreach ($array_config_global['my_domains'] as $dm) {
示例14: elseif
} elseif ($row_f['field_type'] == 'date') {
if (preg_match('/^([0-9]{1,2})\\/([0-9]{1,2})\\/([0-9]{4})$/', $value, $m)) {
$value = mktime(0, 0, 0, $m[2], $m[1], $m[3]);
if ($row_f['min_length'] > 0 and ($value < $row_f['min_length'] or $value > $row_f['max_length'])) {
die(json_encode(array('status' => 'error', 'input' => 'custom_fields[' . $row_f['field'] . ']', 'mess' => sprintf($lang_module['field_min_max_value'], $row_f['title'], date('d/m/Y', $row_f['min_length']), date('d/m/Y', $row_f['max_length'])))));
}
} else {
die(json_encode(array('status' => 'error', 'input' => 'custom_fields[' . $row_f['field'] . ']', 'mess' => sprintf($lang_module['field_match_type_error'], $row_f['title']))));
}
} elseif ($row_f['field_type'] == 'textbox') {
if ($row_f['match_type'] == 'alphanumeric') {
if (!preg_match('/^[a-zA-Z0-9\\_]+$/', $value)) {
die(json_encode(array('status' => 'error', 'input' => 'custom_fields[' . $row_f['field'] . ']', 'mess' => sprintf($lang_module['field_match_type_error'], $row_f['title']))));
}
} elseif ($row_f['match_type'] == 'email') {
if (($error = nv_check_valid_email($value)) != '') {
die(json_encode(array('status' => 'error', 'input' => 'custom_fields[' . $row_f['field'] . ']', 'mess' => $error)));
}
} elseif ($row_f['match_type'] == 'url') {
if (!nv_is_url($value)) {
die(json_encode(array('status' => 'error', 'input' => 'custom_fields[' . $row_f['field'] . ']', 'mess' => sprintf($lang_module['field_match_type_error'], $row_f['title']))));
}
} elseif ($row_f['match_type'] == 'regex') {
if (!preg_match('/' . $row_f['match_regex'] . '/', $value)) {
die(json_encode(array('status' => 'error', 'input' => 'custom_fields[' . $row_f['field'] . ']', 'mess' => sprintf($lang_module['field_match_type_error'], $row_f['title']))));
}
} elseif ($row_f['match_type'] == 'callback') {
if (function_exists($row_f['func_callback'])) {
if (!call_user_func($row_f['func_callback'], $value)) {
die(json_encode(array('status' => 'error', 'input' => 'custom_fields[' . $row_f['field'] . ']', 'mess' => sprintf($lang_module['field_match_type_error'], $row_f['title']))));
}
示例15: elseif
if (defined('NV_IS_USER')) {
$userid = $user_info['userid'];
$name = $user_info['username'];
$email = $user_info['email'];
} elseif (defined('NV_IS_ADMIN')) {
$userid = $admin_info['userid'];
$name = $admin_info['username'];
$email = $admin_info['email'];
$status = 1;
} else {
$userid = 0;
$name = filter_text_input('name', 'post', '', 1);
$email = filter_text_input('email', 'post', '');
}
$contents = "";
if ($setting['comment_' . $type] and $id > 0 and $checkss == md5($id . session_id() . $global_config['sitekey']) and $name != "" and nv_check_valid_email($email) == "" and $code != "" and $content != "") {
$timeout = $nv_Request->get_int($module_name . '_' . $op . '_' . $id, 'cookie', 0);
if (!nv_capcha_txt($code)) {
$contents = "ERR_" . $lang_global['securitycodeincorrect'];
} elseif ($timeout == 0 or NV_CURRENTTIME - $timeout > $difftimeout) {
$query = $db->sql_query("SELECT " . $scatid . " allowed_comm FROM `" . NV_PREFIXLANG . "_" . $module_data . "_" . $type . "` WHERE `" . $wid . "` = " . $id);
$row = $db->sql_fetchrow($query);
if (isset($row['allowed_comm']) and ($row['allowed_comm'] == 1 or $row['allowed_comm'] == 2 and defined('NV_IS_USER'))) {
$row['catid'] = 0;
$content = nv_nl2br($content, '<br />');
$sql = "INSERT INTO `" . NV_PREFIXLANG . "_" . $module_data . "_comment_" . $type . "` (`cid`, `level`, `cmcount`, `id`, `content`, `like`, `user_like`, `user_dislike`, `dislike`, `post_time`, `userid`, `post_name`, `post_email`, `post_ip`, `status`) VALUES (NULL, " . $db->dbescape($level) . ", 0, " . $id . "," . $db->dbescape($content) . ", 0, '', '', 0, UNIX_TIMESTAMP(), " . $userid . ", " . $db->dbescape($name) . ", " . $db->dbescape($email) . ", " . $db->dbescape(NV_CLIENT_IP) . ", " . $status . ")";
$result = $db->sql_query($sql);
if ($result) {
$query = "UPDATE `" . NV_PREFIXLANG . "_" . $module_data . "_comment_" . $type . "` SET `cmcount`=`cmcount`+1 WHERE `level`=" . $db->dbescape($plevel);
$db->sql_query($query);
$page = 0;