本文整理汇总了PHP中nv_substr函数的典型用法代码示例。如果您正苦于以下问题:PHP nv_substr函数的具体用法?PHP nv_substr怎么用?PHP nv_substr使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了nv_substr函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: nv_info_die
$sql = "SELECT id, parentid, title, alias, keywords, description, weight FROM " . $BL->table_prefix . "_categories WHERE id=" . $id;
$result = $db->query($sql);
if ($result->rowCount() != 1) {
nv_info_die($BL->glang('error_404_title'), $BL->glang('error_404_title'), $BL->glang('error_404_content'));
}
$row = $result->fetch();
$data = $row;
} else {
$data = array("parentid" => $nv_Request->get_int("parentid", "post,get", 0), "title" => "", "alias" => "", "keywords" => "", "description" => "");
}
if ($nv_Request->isset_request("submit", "post")) {
$data['parentid'] = $nv_Request->get_int("parentid", "post", 0);
$data['title'] = nv_substr($nv_Request->get_title('title', 'post', '', 1), 0, 255);
$data['alias'] = nv_substr($nv_Request->get_title('alias', 'post', '', 1), 0, 255);
$data['keywords'] = nv_substr($nv_Request->get_title('keywords', 'post', '', 1), 0, 255);
$data['description'] = nv_substr($nv_Request->get_title('description', 'post', '', 1), 0, 255);
$data['alias'] = $data['alias'] ? strtolower(change_alias($data['alias'])) : strtolower(change_alias($data['title']));
$data['keywords'] = $data['keywords'] ? implode(", ", array_filter(array_unique(array_map("trim", explode(",", $data['keywords']))))) : "";
if (empty($data['title'])) {
$error = $BL->lang('categoriesErrorTitle');
} elseif (empty($data['keywords'])) {
$error = $BL->lang('errorKeywords');
} elseif (empty($data['description'])) {
$error = $BL->lang('errorSescription');
} elseif ($BL->checkExistsAlias($data['alias'], "cat", $id)) {
$error = $BL->lang('errorAliasExists');
} else {
// Xac dinh thu tu moi
$new_weight = 1;
if (!$id or $id and $data['parentid'] != $row['parentid']) {
$sql = "SELECT MAX(weight) AS new_weight FROM " . $BL->table_prefix . "_categories WHERE parentid=" . $data['parentid'];
示例2: die
* @License GNU/GPL version 2 or any later version
* @Createdate Dec 11, 2013, 09:50:11 PM
*/
if (!defined('NV_BLOG_ADMIN')) {
die('Stop!!!');
}
$page_title = $BL->lang('cfgComment');
$set_active_op = 'config-master';
$array_commentFacebookColorscheme = array('light' => 'Light', 'dark' => 'Dark');
$array = array();
// Lay thong tin submit
if ($nv_Request->isset_request('submit', 'post')) {
$array['commentType'] = nv_substr($nv_Request->get_title('commentType', 'post', 'random', 1), 0, 255);
$array['commentPerPage'] = $nv_Request->get_int('commentPerPage', 'post', 8);
$array['commentDisqusShortname'] = nv_substr($nv_Request->get_title('commentDisqusShortname', 'post', '', 1), 0, 255);
$array['commentFacebookColorscheme'] = nv_substr($nv_Request->get_title('commentFacebookColorscheme', 'post', 'light', 1), 0, 255);
// Kiem tra xac nhan
if (!in_array($array['commentType'], $BL->commentType)) {
$array['commentType'] = $BL->commentType[0];
}
if ($array['commentPerPage'] > 50 or $array['commentPerPage'] < 1) {
$array['commentPerPage'] = 8;
}
if (!isset($array_commentFacebookColorscheme[$array['commentFacebookColorscheme']])) {
$array['commentFacebookColorscheme'] = 'light';
}
foreach ($array as $config_name => $config_value) {
$sql = "REPLACE INTO " . $BL->table_prefix . "_config VALUES (" . $db->quote($config_name) . "," . $db->quote($config_value) . ")";
$db->query($sql);
}
nv_del_moduleCache($module_name);
示例3: nv_step_5
}
}
}
$title = $lang_module['config_database'];
$contents = nv_step_5($db_config, $nextstep);
} elseif ($step == 6) {
$nextstep = 0;
$error = '';
define('NV_USERS_GLOBALTABLE', $db_config['prefix'] . '_users');
// Bat dau phien lam viec cua MySQL
$db = new NukeViet\Core\Database($db_config);
if (!empty($db->error)) {
$error = !empty($db->error['user_message']) ? $db->error['user_message'] : $db->error['message'];
}
$array_data['site_name'] = $nv_Request->get_title('site_name', 'post', $array_data['site_name'], 1);
$array_data['nv_login'] = nv_substr($nv_Request->get_title('nv_login', 'post', $array_data['nv_login'], 1), 0, NV_UNICKMAX);
$array_data['nv_email'] = $nv_Request->get_title('nv_email', 'post', $array_data['nv_email']);
$array_data['nv_password'] = $nv_Request->get_title('nv_password', 'post', $array_data['nv_password']);
$array_data['re_password'] = $nv_Request->get_title('re_password', 'post', $array_data['re_password']);
$array_data['lang_multi'] = (int) $nv_Request->get_bool('lang_multi', 'post', $array_data['lang_multi']);
$check_login = nv_check_valid_login($array_data['nv_login'], NV_UNICKMAX, NV_UNICKMIN);
$check_pass = nv_check_valid_pass($array_data['nv_password'], NV_UPASSMAX, NV_UPASSMIN);
$check_email = nv_check_valid_email($array_data['nv_email']);
$array_data['question'] = $nv_Request->get_title('question', 'post', $array_data['question'], 1);
$array_data['answer_question'] = $nv_Request->get_title('answer_question', 'post', $array_data['answer_question'], 1);
$global_config['site_email'] = $array_data['nv_email'];
if ($nv_Request->isset_request('nv_login,nv_password', 'post')) {
if (empty($array_data['site_name'])) {
$error = $lang_module['err_sitename'];
} elseif (!empty($check_login)) {
$error = $check_login;
示例4: nv_substr
}
$custom_fields = $nv_Request->get_array('custom_fields', 'post');
if ($checkss == $array_register['checkss']) {
$array_register['first_name'] = nv_substr($nv_Request->get_title('first_name', 'post', '', 1), 0, 255);
$array_register['last_name'] = nv_substr($nv_Request->get_title('last_name', 'post', '', 1), 0, 255);
$array_register['username'] = $nv_Request->get_title('username', 'post', '', 1);
$array_register['password'] = $nv_Request->get_title('password', 'post', '');
$array_register['re_password'] = $nv_Request->get_title('re_password', 'post', '');
$array_register['email'] = nv_strtolower(nv_substr($nv_Request->get_title('email', 'post', '', 1), 0, 100));
$array_register['question'] = $nv_Request->get_int('question', 'post', 0);
if (!isset($data_questions[$array_register['question']])) {
$array_register['question'] = 0;
}
$data_questions[$array_register['question']]['selected'] = ' selected="selected"';
$array_register['your_question'] = $nv_Request->get_title('your_question', 'post', '', 1);
$array_register['answer'] = nv_substr($nv_Request->get_title('answer', 'post', '', 1), 0, 255);
$array_register['agreecheck'] = $nv_Request->get_int('agreecheck', 'post', 0);
$nv_seccode = $nv_Request->get_title('nv_seccode', 'post', '');
$check_seccode = !$gfx_chk ? true : (nv_capcha_txt($nv_seccode) ? true : false);
$complete = '';
if (!$check_seccode) {
die(reg_result(array('status' => 'error', 'input' => 'nv_seccode', 'mess' => $lang_global['securitycodeincorrect'])));
}
if (($check_login = nv_check_username_reg($array_register['username'])) != '') {
die(reg_result(array('status' => 'error', 'input' => 'username', 'mess' => $check_login)));
}
if (($check_email = nv_check_email_reg($array_register['email'])) != '') {
die(reg_result(array('status' => 'error', 'input' => 'email', 'mess' => $check_email)));
}
if (($check_pass = nv_check_valid_pass($array_register['password'], NV_UPASSMAX, NV_UPASSMIN)) != '') {
die(reg_result(array('status' => 'error', 'input' => 'password', 'mess' => $check_pass)));
示例5: elseif
if (in_array($theme, $theme_site_array)) {
$array_theme[] = $theme;
$theme_list[] = $theme;
} elseif (in_array($theme, $theme_mobile_array)) {
$array_theme[] = $theme;
$theme_mobile_list[] = $theme;
}
}
$groups_list = nv_groups_list();
if ($nv_Request->get_int('save', 'post') == '1') {
$custom_title = $nv_Request->get_title('custom_title', 'post', 1);
$admin_title = $nv_Request->get_title('admin_title', 'post', 1);
$theme = $nv_Request->get_title('theme', 'post', '', 1);
$mobile = $nv_Request->get_title('mobile', 'post', '', 1);
$description = $nv_Request->get_title('description', 'post', '', 1);
$description = nv_substr($description, 0, 255);
$keywords = $nv_Request->get_title('keywords', 'post', '', 1);
$act = $nv_Request->get_int('act', 'post', 0);
$rss = $nv_Request->get_int('rss', 'post', 0);
if (!empty($theme) and !in_array($theme, $theme_list)) {
$theme = '';
}
if (!empty($mobile) and !in_array($mobile, $theme_mobile_list)) {
$mobile = '';
}
if (!empty($keywords)) {
$keywords = explode(',', $keywords);
$keywords = array_map('trim', $keywords);
$keywords = implode(', ', $keywords);
}
if ($mod != $global_config['site_home_module']) {
示例6: array
}
$BL->callFrameWorks('shadowbox');
$page_title = $BL->lang('cfgStructureData');
$array = array();
$_array_locales = nv_object2array(simplexml_load_file(NV_ROOTDIR . '/modules/' . $module_file . '/locales/locales.xml')->xpath('locale'));
$array_locales = array();
foreach ($_array_locales as $locale) {
$array_locales[$locale['codes']['code']['standard']['representation']] = $locale['englishName'];
}
unset($_array_locales, $locale);
// Lay thong tin submit
if ($nv_Request->isset_request('submit', 'post')) {
$array['sysGoogleAuthor'] = nv_substr($nv_Request->get_title('sysGoogleAuthor', 'post', '', 0), 0, 30);
$array['sysFbAppID'] = nv_substr($nv_Request->get_title('sysFbAppID', 'post', '', 0), 0, 30);
$array['sysFbAdminID'] = nv_substr($nv_Request->get_title('sysFbAdminID', 'post', '', 0), 0, 30);
$array['sysLocale'] = nv_substr($nv_Request->get_title('sysLocale', 'post', '', 0), 0, 255);
$array['sysDefaultImage'] = $nv_Request->get_string('sysDefaultImage', 'post', '');
if (!preg_match("/^([0-9]+)\$/", $array['sysGoogleAuthor'])) {
$array['sysGoogleAuthor'] = '';
}
if (!preg_match("/^([0-9]+)\$/", $array['sysFbAppID'])) {
$array['sysFbAppID'] = '';
}
if (!preg_match("/^([0-9]+)\$/", $array['sysFbAdminID'])) {
$array['sysFbAdminID'] = '';
}
if (!empty($array['sysDefaultImage'])) {
if (preg_match("/^\\//i", $array['sysDefaultImage'])) {
$array['sysDefaultImage'] = substr($array['sysDefaultImage'], strlen(NV_BASE_SITEURL . NV_UPLOADS_DIR . "/" . $module_name));
if (!is_file(NV_UPLOADS_REAL_DIR . '/' . $module_name . $array['sysDefaultImage'])) {
$array['sysDefaultImage'] = '';
示例7: nv_substr
$access_passus = (isset($access_admin['access_passus'][$admin_info['level']]) and $access_admin['access_passus'][$admin_info['level']] == 1) ? true : false;
if ($nv_Request->isset_request('confirm', 'post')) {
$_user['username'] = $nv_Request->get_title('username', 'post', '', 1);
$_user['email'] = $nv_Request->get_title('email', 'post', '', 1);
if ($access_passus) {
$_user['password1'] = $nv_Request->get_title('password1', 'post', '', 0);
$_user['password2'] = $nv_Request->get_title('password2', 'post', '', 0);
} else {
$_user['password1'] = $_user['password2'] = '';
}
$_user['question'] = nv_substr($nv_Request->get_title('question', 'post', '', 1), 0, 255);
$_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()) {
示例8: die
*/
if (!defined('NV_ADMIN') or !defined('NV_MAINFILE') or !defined('NV_IS_MODADMIN')) {
die('Stop!!!');
}
$page_title = $lang_module['smtp_config'];
$smtp_encrypted_array = array();
$smtp_encrypted_array[0] = 'None';
$smtp_encrypted_array[1] = 'SSL';
$smtp_encrypted_array[2] = 'TSL';
$array_config = array();
$errormess = '';
$array_config['mailer_mode'] = nv_substr($nv_Request->get_title('mailer_mode', 'post', $global_config['mailer_mode'], 1), 0, 255);
$array_config['smtp_host'] = nv_substr($nv_Request->get_title('smtp_host', 'post', $global_config['smtp_host'], 1), 0, 255);
$array_config['smtp_port'] = nv_substr($nv_Request->get_title('smtp_port', 'post', $global_config['smtp_port'], 1), 0, 255);
$array_config['smtp_username'] = nv_substr($nv_Request->get_title('smtp_username', 'post', $global_config['smtp_username']), 0, 255);
$array_config['smtp_password'] = nv_substr($nv_Request->get_title('smtp_password', 'post', $global_config['smtp_password']), 0, 255);
if ($nv_Request->isset_request('mailer_mode', 'post')) {
$array_config['smtp_ssl'] = $nv_Request->get_int('smtp_ssl', 'post', 0);
} else {
$array_config['smtp_ssl'] = intval($global_config['smtp_ssl']);
}
if ($nv_Request->isset_request('mailer_mode', 'post')) {
$smtp_password = $array_config['smtp_password'];
$array_config['smtp_password'] = nv_base64_encode($crypt->aes_encrypt($smtp_password));
$sth = $db->prepare("UPDATE " . NV_CONFIG_GLOBALTABLE . " SET config_value = :config_value WHERE lang = 'sys' AND module = 'site' AND config_name = :config_name");
foreach ($array_config as $config_name => $config_value) {
$sth->bindParam(':config_name', $config_name, PDO::PARAM_STR, 30);
$sth->bindParam(':config_value', $config_value, PDO::PARAM_STR);
$sth->execute();
}
nv_del_moduleCache('settings');
示例9: COUNT
if (!empty($rowcontent['alias'])) {
$stmt = $db->prepare('SELECT COUNT(*) FROM ' . $db_config['prefix'] . '_' . $module_data . '_rows WHERE id !=' . $rowcontent['id'] . ' AND ' . NV_LANG_DATA . '_alias = :alias');
$stmt->bindParam(':alias', $rowcontent['alias'], PDO::PARAM_STR);
$stmt->execute();
if ($stmt->fetchColumn()) {
$rows_id = $rowcontent['id'];
if ($rows_id == 0) {
$rows_id = $db->query('SELECT MAX(id) FROM ' . $db_config['prefix'] . '_' . $module_data . '_rows')->fetchColumn();
$rows_id = intval($rows_id) + 1;
}
$rowcontent['alias'] = $rowcontent['alias'] . '-' . $rows_id;
}
}
$hometext = $nv_Request->get_string('hometext', 'post', '');
$rowcontent['hometext'] = defined('NV_EDITOR') ? nv_nl2br($hometext, '') : nv_nl2br(nv_htmlspecialchars(strip_tags($hometext)), '<br />');
$rowcontent['product_code'] = nv_substr($nv_Request->get_title('product_code', 'post', '', 1), 0, 255);
$rowcontent['product_number'] = $nv_Request->get_int('product_number', 'post', 0);
$rowcontent['product_price'] = $nv_Request->get_string('product_price', 'post', '');
$rowcontent['product_price'] = floatval(preg_replace('/[^0-9\\.]/', '', $rowcontent['product_price']));
$rowcontent['discount_id'] = $nv_Request->get_int('discount_id', 'post', 0);
$rowcontent['money_unit'] = $nv_Request->get_string('money_unit', 'post', '');
$rowcontent['product_weight'] = $nv_Request->get_string('product_weight', 'post', '');
$rowcontent['product_weight'] = floatval(preg_replace('/[^0-9\\.]/', '', $rowcontent['product_weight']));
$rowcontent['weight_unit'] = $nv_Request->get_string('weight_unit', 'post', '');
$rowcontent['product_unit'] = $nv_Request->get_int('product_unit', 'post', 0);
$rowcontent['homeimgfile'] = $nv_Request->get_title('homeimg', 'post', '');
$rowcontent['homeimgalt'] = $nv_Request->get_title('homeimgalt', 'post', '', 1);
$typeprice = $rowcontent['listcatid'] ? $global_array_shops_cat[$rowcontent['listcatid']]['typeprice'] : 0;
if ($typeprice == 2) {
$price_config = $nv_Request->get_array('price_config', 'post');
$sortArray = array();
示例10: die
/**
* @Project NUKEVIET 4.x
* @Author VINADES.,JSC (contact@vinades.vn)
* @Copyright (C) 2014 VINADES.,JSC. All rights reserved
* @License GNU/GPL version 2 or any later version
* @Createdate 2-2-2010 12:55
*/
if (!defined('NV_IS_FILE_SETTINGS')) {
die('Stop!!!');
}
$errormess = '';
if ($nv_Request->isset_request('submit', 'post')) {
$preg_replace = array('pattern' => '/[^a-zA-Z0-9\\_]/', 'replacement' => '');
$array_config_global = array();
$array_config_global['cookie_prefix'] = nv_substr($nv_Request->get_title('cookie_prefix', 'post', '', 0, $preg_replace), 0, 255);
$array_config_global['session_prefix'] = nv_substr($nv_Request->get_title('session_prefix', 'post', '', 0, $preg_replace), 0, 255);
$array_config_global['cookie_secure'] = (int) $nv_Request->get_bool('cookie_secure', 'post', 0);
$array_config_global['cookie_httponly'] = (int) $nv_Request->get_bool('cookie_httponly', 'post', 0);
$sth = $db->prepare("UPDATE " . NV_CONFIG_GLOBALTABLE . " SET config_value = :config_value WHERE lang = 'sys' AND module = 'global' AND config_name = :config_name");
foreach ($array_config_global as $config_name => $config_value) {
$sth->bindParam(':config_name', $config_name, PDO::PARAM_STR, 30);
$sth->bindParam(':config_value', $config_value, PDO::PARAM_STR);
$sth->execute();
}
$array_config_define = array();
$array_config_define['nv_live_cookie_time'] = 86400 * $nv_Request->get_int('nv_live_cookie_time', 'post', 1);
$array_config_define['nv_live_session_time'] = 60 * $nv_Request->get_int('nv_gfx_width', 'post', 0);
$sth = $db->prepare("UPDATE " . NV_CONFIG_GLOBALTABLE . " SET config_value = :config_value WHERE lang = 'sys' AND module = 'define' AND config_name = :config_name");
foreach ($array_config_define as $config_name => $config_value) {
$sth->bindParam(':config_name', $config_name, PDO::PARAM_STR, 30);
$sth->bindParam(':config_value', $config_value, PDO::PARAM_STR);
示例11: nv_info_die
$array = $sth->fetch();
if (empty($array)) {
nv_info_die($lang_global['error_404_title'], $lang_global['error_404_title'], $lang_global['error_404_content']);
}
$page_title = $lang_module['edit'];
$form_action = NV_BASE_ADMINURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&' . NV_NAME_VARIABLE . '=' . $module_name . '&' . NV_OP_VARIABLE . '=' . $op . '&client_id=' . $client_id;
} else {
$array = array('client_id' => '', 'client_title' => '', 'client_secret' => '', 'redirect_uri' => '');
$page_title = $lang_module['add'];
$form_action = NV_BASE_ADMINURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&' . NV_NAME_VARIABLE . '=' . $module_name . '&' . NV_OP_VARIABLE . '=' . $op;
}
if ($nv_Request->isset_request('submit', 'post')) {
$array['client_id'] = nv_substr($nv_Request->get_title('client_id', 'post', '', true), 0, 80);
$array['client_title'] = nv_substr($nv_Request->get_title('client_title', 'post', '', true), 0, 80);
$array['client_secret'] = nv_substr($nv_Request->get_title('client_secret', 'post', '', true), 0, 80);
$array['redirect_uri'] = nv_substr($nv_Request->get_title('redirect_uri', 'post', '', false), 0, 2000);
if (empty($array['client_id'])) {
$error = $lang_module['content_error_id'];
} elseif (empty($array['client_title'])) {
$error = $lang_module['content_error_title'];
} elseif (empty($array['client_secret'])) {
$error = $lang_module['content_error_secret'];
} else {
$sql = 'SELECT * FROM ' . $db_config['prefix'] . '_' . $module_data . '_clients WHERE client_id = :client_id' . ($client_id ? ' AND client_id != ' . $db->quote($client_id) : '');
$sth = $db->prepare($sql);
$sth->bindParam(':client_id', $array['client_id'], PDO::PARAM_STR);
$sth->execute();
$num = $sth->fetchColumn();
if (!empty($num)) {
$error = $lang_module['content_error_exists'];
} else {
示例12: isset
$fpart = isset($array_op[0]) ? $array_op[0] : '';
$fpart = $nv_Request->get_title('fpart', 'post,get', $fpart);
$ftitle = nv_substr($nv_Request->get_title('ftitle', 'post,get', '', 1), 0, 250);
$full = isset($array_op[1]) ? $array_op[1] : 1;
$base_url = NV_BASE_SITEURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&' . NV_NAME_VARIABLE . '=' . $module_name;
if (!empty($array_department)) {
$checkss = $nv_Request->get_title('checkss', 'post', '');
if ($checkss == md5($client_info['session_id'] . $global_config['sitekey'])) {
if (defined('NV_IS_USER')) {
$fname = !empty($user_info['full_name']) ? $user_info['full_name'] : $user_info['username'];
$femail = $user_info['email'];
} else {
$fname = nv_substr($nv_Request->get_title('fname', 'post', '', 1), 0, 100);
$femail = nv_substr($nv_Request->get_title('femail', 'post', '', 1), 0, 100);
}
$fphone = nv_substr($nv_Request->get_title('fphone', 'post', '', 1), 0, 100);
$fcon = $nv_Request->get_editor('fcon', '', NV_ALLOWED_HTML_TAGS);
$fcode = $nv_Request->get_title('fcode', 'post', '');
$check_valid_email = nv_check_valid_email($femail);
if (empty($fname)) {
$error = $lang_module['error_fullname'];
} elseif (!empty($check_valid_email)) {
$error = $check_valid_email;
} elseif (empty($ftitle)) {
$error = $lang_module['error_title'];
} elseif (empty($fcon)) {
$error = $lang_module['error_content'];
} elseif (!isset($array_department[$fpart])) {
$error = $lang_module['error_part'];
} elseif (!nv_capcha_txt($fcode)) {
$error = $lang_module['error_captcha'];
示例13: nv_clean60
/**
* nv_clean60()
*
* @param mixed $string
* @param integer $num
* @return
*/
function nv_clean60($string, $num = 60, $specialchars = false)
{
global $global_config;
$string = nv_unhtmlspecialchars($string);
$len = nv_strlen($string);
if ($num and $num < $len) {
if (ord(nv_substr($string, $num, 1)) == 32) {
$string = nv_substr($string, 0, $num) . '...';
} elseif (strpos($string, ' ') === false) {
$string = nv_substr($string, 0, $num);
} else {
$string = nv_clean60($string, $num - 1);
}
}
if ($specialchars) {
$string = nv_htmlspecialchars($string);
}
return $string;
}
示例14: die
$id = $nv_Request->get_int('id', 'post', 0);
$sql = 'SELECT id FROM ' . $table_name . ' WHERE id=' . $id;
$id = $db->query($sql)->fetchColumn();
if (empty($id)) {
die('NO_' . $id);
}
$new_status = $nv_Request->get_bool('new_status', 'post');
$new_status = (int) $new_status;
$sql = 'UPDATE ' . $table_name . ' SET status=' . $new_status . ' WHERE id=' . $id;
$db->query($sql);
nv_del_moduleCache($module_name);
die('OK_' . $pid);
}
if (!empty($savecat)) {
$preg_replace = array('pattern' => '/[^a-zA-Z0-9\\_]/', 'replacement' => '_');
$data['title'] = nv_substr($nv_Request->get_title('title', 'post', ''), 0, 50);
$data['alias'] = strtolower(change_alias($data['title']));
$stmt = $db->query('SELECT * FROM ' . $db_config['prefix'] . '_' . $module_data . '_template where alias=' . $db->quote($data['alias']))->fetchColumn();
if (empty($data['title'])) {
$error = $lang_module['template_error_name'];
} elseif (!empty($stmt)) {
$error = $lang_module['block_error_alias'];
} else {
if ($data['id'] == 0) {
$listfield = "";
$listvalue = "";
$sql = "INSERT INTO " . $table_name . " VALUES (NULL ,1, '" . $data['title'] . "','" . $data['alias'] . "')";
$templaid = $db->insert_id($sql);
if ($templaid != 0) {
$sql = "CREATE TABLE IF NOT EXISTS " . $db_config['prefix'] . "_" . $module_data . "_info_" . $templaid . "(\n\t\t\t shopid mediumint(8) unsigned NOT NULL DEFAULT '0',\n\t\t\t status tinyint(1) NOT NULL DEFAULT '1',\n\t\t\t PRIMARY KEY (shopid)\n\t\t\t) ENGINE=MyISAM ";
$db->query($sql);
示例15: nv_substr
$caption = $lang_module['category_add'];
}
if ($nv_Request->get_int('save', 'post') == 1) {
$data['category_id'] = $nv_Request->get_int('category_id', 'post', 0);
$data['parentid_old'] = $nv_Request->get_int('parentid_old', 'post', 0);
$data['parent_id'] = $nv_Request->get_int('parent_id', 'post', 0);
$data['inhome'] = $nv_Request->get_int('inhome', 'post', 0);
$data['status'] = $nv_Request->get_int('status', 'post', 0);
$data['name'] = nv_substr($nv_Request->get_title('name', 'post', '', ''), 0, 255);
$data['alias'] = nv_substr($nv_Request->get_title('alias', 'post', '', ''), 0, 255);
$description = $nv_Request->get_string('description', 'post', '');
$data['description'] = defined('NV_EDITOR') ? nv_nl2br($description, '') : nv_nl2br(nv_htmlspecialchars(strip_tags($description)), '<br />');
$data['meta_title'] = nv_substr($nv_Request->get_title('meta_title', 'post', '', ''), 0, 255);
$data['meta_description'] = nv_substr($nv_Request->get_title('meta_description', 'post', '', ''), 0, 255);
$data['meta_keyword'] = nv_substr($nv_Request->get_title('meta_keyword', 'post', '', ''), 0, 255);
$data['layout'] = nv_substr($nv_Request->get_title('layout', 'post', '', ''), 0, 255);
if (empty($data['name'])) {
$error['name'] = $lang_module['category_error_name'];
}
if (!empty($error) && !isset($error['warning'])) {
$error['warning'] = $lang_module['category_error_warning'];
}
$_groups_post = $nv_Request->get_array('groups_view', 'post', array());
$data['groups_view'] = !empty($_groups_post) ? implode(',', nv_groups_post(array_intersect($_groups_post, array_keys($groups_list)))) : '';
$stmt = $db->prepare('SELECT COUNT(*) FROM ' . TABLE_PHOTO_NAME . '_category WHERE category_id !=' . $data['category_id'] . ' AND alias= :alias');
$stmt->bindParam(':alias', $data['alias'], PDO::PARAM_STR);
$stmt->execute();
$check_alias = $stmt->fetchColumn();
if ($check_alias) {
$error['warning'] = $lang_module['duplicate_alias'];
} elseif ($check_alias and $data['parent_id'] > 0) {