本文整理汇总了PHP中change_alias函数的典型用法代码示例。如果您正苦于以下问题:PHP change_alias函数的具体用法?PHP change_alias怎么用?PHP change_alias使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了change_alias函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: change_alias
$file_name = change_alias($page_title) . "_" . $id_export_save;
$result = "OK_GETFILE";
$nv_Request->set_Session($module_data . '_id_export', $id_export_save);
$nv_Request->set_Session($module_data . '_export_filename', $export_filename . "@" . $file_name);
}
$objWriter->save(NV_ROOTDIR . "/" . NV_CACHEDIR . "/" . $file_name . "." . $excel_ext);
die($result);
} elseif ($step == 2 and $nv_Request->isset_request($module_data . '_export_filename', 'session')) {
$export_filename = $nv_Request->get_string($module_data . '_export_filename', 'session', '');
$array_filename = explode("@", $export_filename);
$arry_file_zip = array();
foreach ($array_filename as $file_name) {
if (!empty($file_name) and file_exists(NV_ROOTDIR . '/' . NV_CACHEDIR . '/' . $file_name . '.' . $excel_ext)) {
$arry_file_zip[] = NV_ROOTDIR . "/" . NV_CACHEDIR . "/" . $file_name . "." . $excel_ext;
}
}
$file_src = NV_ROOTDIR . '/' . NV_TEMP_DIR . '/' . NV_TEMPNAM_PREFIX . change_alias($lang_module['export']) . '_' . md5(nv_genpass(10) . session_id()) . '.zip';
require_once NV_ROOTDIR . '/includes/class/pclzip.class.php';
$zip = new PclZip($file_src);
$zip->create($arry_file_zip, PCLZIP_OPT_REMOVE_PATH, NV_ROOTDIR . "/" . NV_CACHEDIR);
$filesize = @filesize($file_src);
$nv_Request->unset_request($module_data . '_export_filename', 'session');
foreach ($arry_file_zip as $file) {
nv_deletefile($file);
}
//Download file
require_once NV_ROOTDIR . '/includes/class/download.class.php';
$download = new download($file_src, NV_ROOTDIR . "/" . NV_TEMP_DIR, basename(change_alias($lang_module['export']) . ".zip"));
$download->download_file();
exit;
}
示例2: die
<?php
/**
* @Project NUKEVIET 3.x
* @Author VINADES.,JSC (contact@vinades.vn)
* @Copyright (C) 2012 VINADES.,JSC. All rights reserved
* @Createdate 2-10-2010 18:49
*/
if (!defined('NV_IS_FILE_ADMIN')) {
die('Stop!!!');
}
$title = filter_text_input('title', 'post', '');
$id = $nv_Request->get_int('id', 'post', 0);
$alias = change_alias($title);
list($number) = $db->sql_fetchrow($db->sql_query("SELECT COUNT(*) FROM `" . NV_PREFIXLANG . "_" . $module_data . "` WHERE `id` !=" . $id . " AND `alias` = " . $db->dbescape($alias) . ""));
if (intval($number) > 0) {
$result = $db->sql_query("SHOW TABLE STATUS WHERE `Name`='" . NV_PREFIXLANG . "_" . $module_data . "'");
$item = $db->sql_fetch_assoc($result);
$db->sql_freeresult($result);
if (isset($item['Auto_increment'])) {
$alias = $alias . "-" . $item['Auto_increment'];
} else {
list($weight) = $db->sql_fetchrow($db->sql_query("SELECT COUNT(*) FROM `" . NV_PREFIXLANG . "_" . $module_data . "`"));
$weight = intval($weight) + 1;
$alias = $alias . "-" . $weight;
}
}
include NV_ROOTDIR . "/includes/header.php";
echo $alias;
include NV_ROOTDIR . "/includes/footer.php";
示例3: die
if (!defined('NV_IS_FILE_ADMIN')) {
die('Stop!!!');
}
$page_title = $lang_module['playlists'];
$error = '';
$savecat = 0;
list($playlist_id, $title, $alias, $description, $image, $keywords, $status, $private_mode) = array(0, '', '', '', '', '', 1, 1);
$savecat = $nv_Request->get_int('savecat', 'post', 0);
if (!empty($savecat)) {
$playlist_id = $nv_Request->get_int('playlist_id', 'post', 0);
$title = $nv_Request->get_title('title', 'post', '', 1);
$keywords = $nv_Request->get_title('keywords', 'post', '', 1);
$alias = $nv_Request->get_title('alias', 'post', '');
$description = $nv_Request->get_string('description', 'post', '');
$description = nv_nl2br(nv_htmlspecialchars(strip_tags($description)), '<br/>');
$alias = $alias == '' ? change_alias($title) : change_alias($alias);
$status = $nv_Request->get_int('status', 'post', 0);
$private_mode = $nv_Request->get_int('private_mode', 'post', 0);
$image = $nv_Request->get_string('image', 'post', '');
if (is_file(NV_DOCUMENT_ROOT . $image)) {
$lu = strlen(NV_BASE_SITEURL . NV_UPLOADS_DIR . '/' . $module_upload . '/img/');
$image = substr($image, $lu);
} else {
$image = '';
}
if (empty($title)) {
$error = $lang_module['error_name'];
} elseif ($playlist_id == 0) {
$weight = $db->query("SELECT max(weight) FROM " . NV_PREFIXLANG . "_" . $module_data . "_playlist_cat")->fetchColumn();
$weight = intval($weight) + 1;
$sql = "INSERT INTO " . NV_PREFIXLANG . "_" . $module_data . "_playlist_cat ( numbers, title, alias, status, private_mode, userid, description, image, weight, keywords, add_time, edit_time) VALUES (20, :title , :alias, :status, :private_mode, :userid, :description, :image, :weight, :keywords, " . NV_CURRENTTIME . ", " . NV_CURRENTTIME . ")";
示例4: list
}
$page_title = $lang_module['categories'];
$error = $admins = "";
$savecat = 0;
list($catid, $parentid, $title, $alias, $description, $keywords) = array(0, 0, "", "", "", "");
$savecat = $nv_Request->get_int('savecat', 'post', 0);
if (!empty($savecat)) {
$catid = $nv_Request->get_int('catid', 'post', 0);
list($parentid_old) = $db->sql_fetchrow($db->sql_query("SELECT `parentid` FROM `" . NV_PREFIXLANG . "_" . $module_data . "_cat` WHERE `catid` = '" . $catid . "'"));
$parentid = $nv_Request->get_int('parentid', 'post', 0);
$title = filter_text_input('title', 'post', "", 1, 100);
$catimage = filter_text_input('catimage', 'post');
$keywords = filter_text_input('keywords', 'post');
$alias = filter_text_input('alias', 'post');
$description = filter_text_textarea('description', '', NV_ALLOWED_HTML_TAGS);
$alias = $alias == "" ? change_alias($title) : change_alias($alias);
if ($catid == 0 and !empty($title)) {
$description = nv_nl2br($description, '<br />');
//
list($weight) = $db->sql_fetchrow($db->sql_query("SELECT max(`weight`) FROM `" . NV_PREFIXLANG . "_" . $module_data . "_cat` WHERE `parentid`=" . $db->dbescape($parentid) . ""));
$weight = intval($weight) + 1;
$query = "INSERT INTO `" . NV_PREFIXLANG . "_" . $module_data . "_cat` (`catid`, `parentid`, `title`, `catimage`, `alias`, `description`, `weight`, `inhome`, `numlinks`, `keywords`, `add_time`, `edit_time`) VALUES (NULL, " . $db->dbescape($parentid) . ", " . $db->dbescape($title) . ", " . $db->dbescape($catimage) . " , " . $db->dbescape($alias) . ", " . $db->dbescape($description) . ", " . $db->dbescape($weight) . ", '1', '3', " . $db->dbescape($keywords) . ", UNIX_TIMESTAMP(), UNIX_TIMESTAMP())";
if ($db->sql_query_insert_id($query)) {
nv_insert_logs(NV_LANG_DATA, $module_name, 'log_add_cat', " ", $admin_info['userid']);
$db->sql_freeresult();
nv_del_moduleCache($module_name);
Header("Location: " . NV_BASE_ADMINURL . "index.php?" . NV_NAME_VARIABLE . "=" . $module_name . "&" . NV_OP_VARIABLE . "=" . $op . "");
die;
} else {
$error = $lang_module['errorsave'];
}
示例5: nv_substr
$data['catid'] = $nv_Request->get_int('catid', 'post', 0);
$data['typeprice'] = $nv_Request->get_int('typeprice', 'post', 2);
$data['parentid_old'] = $nv_Request->get_int('parentid_old', 'post', 0);
$data['parentid'] = $nv_Request->get_int('parentid', 'post', 0);
$data['title'] = nv_substr($nv_Request->get_title('title', 'post', '', 1), 0, 255);
$data['title_custom'] = nv_substr($nv_Request->get_title('title_custom', 'post', '', 1), 0, 255);
$data['keywords'] = nv_substr($nv_Request->get_title('keywords', 'post', '', 1), 0, 255);
$data['alias'] = nv_substr($nv_Request->get_title('alias', 'post', '', 1), 0, 255);
$data['description'] = $nv_Request->get_string('description', 'post', '');
$data['description'] = nv_nl2br(nv_htmlspecialchars(strip_tags($data['description'])), '<br />');
$data['descriptionhtml'] = $nv_Request->get_editor('descriptionhtml', '', NV_ALLOWED_HTML_TAGS);
$data['viewdescriptionhtml'] = $nv_Request->get_int('viewdescriptionhtml', 'post', 0);
$data['cat_allow_point'] = $nv_Request->get_int('cat_allow_point', 'post', 0);
$data['cat_number_point'] = $nv_Request->get_int('cat_number_point', 'post', 0);
$data['cat_number_product'] = $nv_Request->get_int('cat_number_product', 'post', 0);
$data['alias'] = $data['alias'] == '' ? change_alias($data['title']) : change_alias($data['alias']);
// Cat mo ta cho chinh xac
if (strlen($data['description']) > 255) {
$data['description'] = nv_clean60($data['description'], 250);
}
$_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)))) : '';
if ($data['title'] == '') {
$error = $lang_module['error_cat_name'];
}
$image = $nv_Request->get_string('image', 'post', '');
if (is_file(NV_DOCUMENT_ROOT . $image)) {
$lu = strlen(NV_BASE_SITEURL . NV_UPLOADS_DIR . '/' . $module_upload . '/');
$data['image'] = substr($image, $lu);
} else {
$data['image'] = '';
示例6: gltJsonResponse
if ($token != md5($nv_Request->session_id . $global_config['sitekey'])) {
gltJsonResponse(array('code' => 200, 'message' => $lang_module['uploadErrorSess']));
}
// Chi admin moi co quyen upload
if (!defined('NV_IS_MODADMIN')) {
gltJsonResponse(array('code' => 200, 'message' => $lang_module['uploadErrorPermission']));
}
// Tang thoi luong phien lam viec
if ($sys_info['allowed_set_time_limit']) {
set_time_limit(5 * 3600);
}
// Get request value
$folder = $nv_Request->get_title('folder', 'post', '');
$fileName = $nv_Request->get_title('name', 'post', '');
$fileExt = nv_getextension($fileName);
$fileName = change_alias(substr($fileName, 0, -(strlen($fileExt) + 1))) . '.' . $fileExt;
$chunk = $nv_Request->get_int('chunk', 'post', 0);
$chunks = $nv_Request->get_int('chunks', 'post', 0);
if (empty($fileName) or empty($fileExt)) {
gltJsonResponse(array('code' => 200, 'message' => $lang_module['uploadErrorFile']));
}
// Kiem tra file ton tai
$fileName2 = $fileName;
$i = 1;
while (file_exists(NV_ROOTDIR . '/' . NV_TEMP_DIR . '/' . $fileName2)) {
$fileName2 = preg_replace('/(.*)(\\.[a-zA-Z0-9]+)$/', '\\1-' . $i . '\\2', $fileName);
++$i;
}
$fileName = $fileName2;
$filePath = NV_ROOTDIR . '/' . NV_TEMP_DIR . '/' . $fileName;
// Open temp file
示例7: die
die('Stop!!!');
}
$array_site_cat_module = array();
if ($global_config['idsite']) {
$_module = $db->query('SELECT module FROM ' . $db_config['dbsystem'] . '.' . $db_config['prefix'] . '_site_cat t1 INNER JOIN ' . $db_config['dbsystem'] . '.' . $db_config['prefix'] . '_site t2 ON t1.cid=t2.cid WHERE t2.idsite=' . $global_config['idsite'])->fetchColumn();
if (!empty($_module)) {
$array_site_cat_module = explode(',', $_module);
}
}
$title = $note = $modfile = $error = '';
$modules_site = nv_scandir(NV_ROOTDIR . '/modules', $global_config['check_module']);
if ($nv_Request->get_title('checkss', 'post') == NV_CHECK_SESSION) {
$title = $nv_Request->get_title('title', 'post', '', 1);
$modfile = $nv_Request->get_title('module_file', 'post', '', 1);
$note = $nv_Request->get_title('note', 'post', '', 1);
$title = strtolower(change_alias($title));
$modules_admin = nv_scandir(NV_ROOTDIR . '/' . NV_ADMINDIR, $global_config['check_module']);
$error = $lang_module['vmodule_exit'];
if (!empty($title) and !empty($modfile) and !in_array($title, $modules_site) and !in_array($title, $modules_admin) and preg_match($global_config['check_module'], $title) and preg_match($global_config['check_module'], $modfile)) {
$version = '';
$author = '';
$note = nv_nl2br($note, '<br />');
$module_data = preg_replace('/(\\W+)/i', '_', $title);
if (empty($array_site_cat_module) or in_array($modfile, $array_site_cat_module)) {
try {
$sth = $db->prepare('INSERT INTO ' . $db_config['prefix'] . '_setup_extensions (type, title, is_sys, is_virtual, basename, table_prefix, version, addtime, author, note) VALUES ( \'module\', :title, 0, 0, :basename, :table_prefix, :version, ' . NV_CURRENTTIME . ', :author, :note)');
$sth->bindParam(':title', $title, PDO::PARAM_STR);
$sth->bindParam(':basename', $modfile, PDO::PARAM_STR);
$sth->bindParam(':table_prefix', $module_data, PDO::PARAM_STR);
$sth->bindParam(':version', $version, PDO::PARAM_STR);
$sth->bindParam(':author', $author, PDO::PARAM_STR);
示例8: detail_product
/**
* detail_product()
*
* @param mixed $data_content
* @param mixed $data_unit
* @param mixed $data_others
* @param mixed $array_other_view
* @param mixed $content_comment
* @return
*/
function detail_product($data_content, $data_unit, $data_others, $array_other_view, $content_comment, $compare_id, $popup, $idtemplate, $array_keyword)
{
global $module_info, $lang_module, $module_file, $module_name, $module_upload, $pro_config, $global_config, $global_array_group, $array_wishlist_id, $client_info, $global_array_shops_cat, $meta_property, $pro_config, $user_info, $discounts_config, $my_head, $my_footer;
$link = NV_BASE_SITEURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&' . NV_NAME_VARIABLE . '=' . $module_name . '&' . NV_OP_VARIABLE . '=';
$link2 = NV_BASE_SITEURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&' . NV_NAME_VARIABLE . '=' . $module_name . '&' . NV_OP_VARIABLE . '=';
$xtpl = new XTemplate('detail.tpl', NV_ROOTDIR . '/themes/' . $module_info['template'] . '/modules/' . $module_file);
$xtpl->assign('GLANG', $lang_module);
$xtpl->assign('LANG', $lang_module);
$xtpl->assign('MODULE', $module_name);
$xtpl->assign('MODULE_FILE', $module_file);
$xtpl->assign('TEMPLATE', $module_info['template']);
$xtpl->assign('NV_BASE_SITEURL', NV_BASE_SITEURL);
$xtpl->assign('SELFURL', $client_info['selfurl']);
$xtpl->assign('POPUP', $popup);
$xtpl->assign('LINK_LOAD', NV_BASE_SITEURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&' . NV_NAME_VARIABLE . '=' . $module_name . '&' . NV_OP_VARIABLE . '=loadcart');
$xtpl->assign('THEME_URL', NV_BASE_SITEURL . 'themes/' . $module_info['template']);
$xtpl->assign('LINK_PRINT', NV_BASE_SITEURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&' . NV_NAME_VARIABLE . '=' . $module_name . '&' . NV_OP_VARIABLE . '=print_pro&id=' . $data_content['id']);
if (!empty($data_content)) {
$xtpl->assign('proid', $data_content['id']);
$xtpl->assign('CAT_TITLE', $global_array_shops_cat[$data_content['listcatid']]['title']);
$xtpl->assign('SRC_PRO_FULL', $global_config['site_url'] . $data_content['homeimgthumb']);
$xtpl->assign('SRC_PRO', $data_content['homeimgthumb']);
$xtpl->assign('SRC_PRO_LAGE', $data_content['homeimgfile']);
if (!empty($data_content['homeimgfile']) and file_exists(NV_ROOTDIR . $data_content['homeimgfile'])) {
$xtpl->assign('SRC_PRO_LAGE_INFO', nv_is_image(NV_ROOTDIR . $data_content['homeimgfile']));
}
$xtpl->assign('TITLE', $data_content[NV_LANG_DATA . '_title']);
$xtpl->assign('NUM_VIEW', $data_content['hitstotal']);
$xtpl->assign('DATE_UP', $lang_module['detail_dateup'] . ' ' . nv_date('d-m-Y h:i:s A', $data_content['publtime']));
$xtpl->assign('DETAIL', $data_content[NV_LANG_DATA . '_bodytext']);
$xtpl->assign('LINK_ORDER', $link2 . 'setcart&id=' . $data_content['id']);
$price = nv_get_price($data_content['id'], $pro_config['money_unit']);
$xtpl->assign('PRICE', $price);
$xtpl->assign('PRODUCT_CODE', $data_content['product_code']);
$xtpl->assign('PRODUCT_NUMBER', $data_content['product_number']);
$xtpl->assign('pro_unit', $data_unit['title']);
if ($pro_config['active_gift'] and !empty($data_content[NV_LANG_DATA . '_gift_content']) and NV_CURRENTTIME >= $data_content['gift_from'] and NV_CURRENTTIME <= $data_content['gift_to']) {
$xtpl->assign('gift_content', $data_content[NV_LANG_DATA . '_gift_content']);
$xtpl->parse('main.gift');
}
// Hien thi du lieu tuy bien o phan gioi thieu
if (!empty($data_content['array_custom']) and !empty($data_content['array_custom_lang'])) {
$custom_data = nv_custom_tpl('tab-introduce' . '.tpl', $data_content['array_custom'], $data_content['array_custom_lang'], $idtemplate);
$xtpl->assign('CUSTOM_DATA', $custom_data);
$xtpl->parse('main.custom_data');
}
// San pham yeu thich
if ($pro_config['active_wishlist']) {
if (!empty($array_wishlist_id)) {
if (in_array($data_content['id'], $array_wishlist_id)) {
$xtpl->parse('main.wishlist.disabled');
}
}
$xtpl->parse('main.wishlist');
}
$exptime = $data_content['exptime'] != 0 ? date('d-m-Y', $data_content['exptime']) : 'N/A';
$xtpl->assign('exptime', $exptime);
$xtpl->assign('height', $pro_config['homeheight']);
$xtpl->assign('width', $pro_config['homewidth']);
if ($pro_config['active_showhomtext'] == '1') {
$xtpl->assign('hometext', $data_content[NV_LANG_DATA . '_hometext']);
$xtpl->parse('main.hometext');
}
if (!$popup) {
// Hien thi tabs
if (!empty($data_content['tabs'])) {
$i = 0;
foreach ($data_content['tabs'] as $tabs_id => $tabs_value) {
$tabs_content = '';
$tabs_key = $tabs_value['content'];
if ($tabs_key == 'content_detail') {
$tabs_content = $data_content[NV_LANG_DATA . '_bodytext'];
} elseif ($tabs_key == 'content_download' and $pro_config['download_active'] == 1) {
$download_content = nv_download_content($data_content, $tabs_key . '-' . $tabs_id);
$tabs_content = !empty($download_content) ? $download_content : '';
} elseif ($tabs_key == 'content_otherimage') {
$tabs_content = nv_display_othersimage($data_content['otherimage']);
} elseif ($tabs_key == 'content_comments') {
$tabs_content = $content_comment;
} elseif ($tabs_key == 'content_rate') {
if (!empty($data_content['allowed_rating']) and !empty($pro_config['review_active'])) {
$tabs_content = nv_review_content($data_content);
}
} elseif ($tabs_key == 'content_customdata') {
if (!empty($data_content['array_custom']) and !empty($data_content['array_custom_lang'])) {
$tabs_content = nv_custom_tpl('tab-' . strtolower(change_alias($data_content['tabs'][$tabs_id][NV_LANG_DATA . '_title'])) . '.tpl', $data_content['array_custom'], $data_content['array_custom_lang'], $idtemplate);
}
}
if (!empty($tabs_content)) {
$xtpl->assign('TABS_TITLE', $tabs_value[NV_LANG_DATA . '_title']);
//.........这里部分代码省略.........
示例9: die
<?php
/**
* @Project NUKEVIET 4.x
* @Author VINADES.,JSC (contact@vinades.vn)
* @Copyright (C) 2015 VINADES.,JSC. All rights reserved
* @License GNU/GPL version 2 or any later version
* @Createdate Tue, 02 Jun 2015 07:53:31 GMT
*/
if (!defined('NV_IS_FILE_ADMIN')) {
die('Stop!!!');
}
if ($nv_Request->isset_request('get_alias_title', 'post')) {
$alias = $nv_Request->get_title('get_alias_title', 'post', '');
$alias = change_alias($alias);
die($alias);
}
//change status
if ($nv_Request->isset_request('change_status', 'post, get')) {
$id = $nv_Request->get_int('id', 'post, get', 0);
$content = 'NO_' . $id;
$query = 'SELECT status FROM ' . NV_PREFIXLANG . '_' . $module_data . '_cat WHERE id=' . $id;
$row = $db->query($query)->fetch();
if (isset($row['status'])) {
$status = $row['status'] ? 0 : 1;
$query = 'UPDATE ' . NV_PREFIXLANG . '_' . $module_data . '_cat SET status=' . intval($status) . ' WHERE id=' . $id;
$db->query($query);
$content = 'OK_' . $id;
}
nv_del_moduleCache($module_name);
include NV_ROOTDIR . '/includes/header.php';
示例10: nv_getFileInfo
}
}
$editor = $nv_Request->get_title('editor', 'post,get', '');
$CKEditorFuncNum = $nv_Request->get_int('CKEditorFuncNum', 'post,get', 0);
if (!preg_match("/^([a-zA-Z0-9\\-\\_]+)\$/", $editor)) {
$editor = '';
}
if (empty($error)) {
if (isset($array_dirname[$path])) {
$did = $array_dirname[$path];
$info = nv_getFileInfo($path, $upload_info['basename']);
$info['userid'] = $admin_info['userid'];
$newalt = $nv_Request->get_title('filealt', 'post', '', true);
if (empty($newalt)) {
$newalt = preg_replace('/(.*)(\\.[a-zA-Z0-9]+)$/', '\\1', $upload_info['basename']);
$newalt = str_replace('-', ' ', change_alias($newalt));
}
$sth = $db->prepare("INSERT INTO " . NV_UPLOAD_GLOBALTABLE . "_file\n\t\t(name, ext, type, filesize, src, srcwidth, srcheight, sizes, userid, mtime, did, title, alt) VALUES\n\t\t('" . $info['name'] . "', '" . $info['ext'] . "', '" . $info['type'] . "', " . $info['filesize'] . ", '" . $info['src'] . "', " . $info['srcwidth'] . ", " . $info['srcheight'] . ", '" . $info['size'] . "', " . $info['userid'] . ", " . $info['mtime'] . ", " . $did . ", '" . $upload_info['basename'] . "', :newalt)");
$sth->bindParam(':newalt', $newalt, PDO::PARAM_STR);
$sth->execute();
}
nv_insert_logs(NV_LANG_DATA, $module_name, $lang_module['upload_file'], $path . '/' . $upload_info['basename'], $admin_info['userid']);
if ($editor == 'ckeditor') {
echo "<script type=\"text/javascript\">window.parent.CKEDITOR.tools.callFunction(" . $CKEditorFuncNum . ", '" . NV_BASE_SITEURL . $path . "/" . $upload_info['basename'] . "', '');</script>";
} else {
echo $upload_info['basename'];
}
} else {
if ($editor == 'ckeditor') {
echo "<script type=\"text/javascript\">window.parent.CKEDITOR.tools.callFunction(" . $CKEditorFuncNum . ", '', '" . $error . "');</script>";
} else {
示例11: array
$array_data = array();
$page = (isset($array_op[0]) and substr($array_op[0], 0, 5) == 'page-') ? intval(substr($array_op[0], 5)) : 1;
$per_page = $array_config['per_page'];
$base_url = NV_BASE_SITEURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&' . NV_NAME_VARIABLE . '=' . $module_name;
if ($nv_Request->isset_request('search', 'get')) {
$array_search['keywords'] = $nv_Request->get_title('keywords', 'get', '');
$array_search['blood_group'] = $nv_Request->get_title('blood_group', 'get', '');
$base_url .= '&search=1';
if (!empty($array_search['keywords'])) {
$where .= ' AND first_name like "%' . $array_search['keywords'] . '%" OR last_name like "%' . $array_search['keywords'] . '%" OR email like "%' . $array_search['keywords'] . '%" OR phone like "%' . $array_search['keywords'] . '%" OR identity_card like "%' . $array_search['keywords'] . '%" OR width like "%' . $array_search['keywords'] . '%" OR weight like "%' . $array_search['keywords'] . '%" OR organize like "%' . $array_search['keywords'] . '%"';
$base_url .= '&keywords=' . $array_search['keywords'];
}
if (!empty($array_search['blood_group'])) {
$where .= ' AND blood_group=' . $db->quote($array_search['blood_group']);
$base_url .= '&blood_group=' . $array_search['blood_group'];
}
}
$db->sqlreset()->select('COUNT(*)')->from(NV_PREFIXLANG . '_' . $module_data)->where('1=1' . $where);
$all_page = $db->query($db->sql())->fetchColumn();
$db->select('id, userid, organize, last_name, first_name, birthday, gender, blood_group')->order('id DESC')->limit($per_page)->offset(($page - 1) * $per_page);
$_query = $db->query($db->sql());
while ($row = $_query->fetch()) {
$row['alias'] = change_alias($row['last_name'] . ' ' . $row['first_name']) . '-' . $row['id'];
$row['link'] = NV_BASE_SITEURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&' . NV_NAME_VARIABLE . '=' . $module_name . '/' . $row['alias'];
$array_data[$row['id']] = $row;
}
$generate_page = nv_alias_page($page_title, $base_url, $all_page, $per_page, $page);
$contents = nv_theme_blood_bank_main($array_data, $array_search, $generate_page);
include NV_ROOTDIR . '/includes/header.php';
echo nv_site_theme($contents);
include NV_ROOTDIR . '/includes/footer.php';
示例12: die
$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);
nv_del_moduleCache($module_name);
示例13: filter_text_input
}
$error = "";
if (defined('NV_EDITOR')) {
require_once NV_ROOTDIR . '/' . NV_EDITORSDIR . '/' . NV_EDITOR . '/nv.php';
}
if ($nv_Request->get_int('save', 'post') == '1') {
$title = filter_text_input('title', 'post', '', 1);
$alias = filter_text_input('alias', 'post', '', 1);
$bodytext = nv_editor_filter_textarea('bodytext', '', NV_ALLOWED_HTML_TAGS);
if (empty($title)) {
$error = $lang_module['aabout9'];
} elseif (strip_tags($bodytext) == "") {
$error = $lang_module['aabout10'];
} else {
$bodytext = nv_editor_nl2br($bodytext);
$alias = empty($alias) ? change_alias($title) : change_alias($alias);
if (defined('IS_EDIT')) {
nv_insert_logs(NV_LANG_DATA, $module_name, 'log_edit_about', "aboutid " . $id, $admin_info['userid']);
$query = "UPDATE`" . NV_PREFIXLANG . "_" . $module_data . "` SET \r\n `title`=" . $db->dbescape($title) . ", `alias` = " . $db->dbescape($alias) . ", \r\n `bodytext`=" . $db->dbescape($bodytext) . ", `keywords`='', `edit_time`=" . NV_CURRENTTIME . " WHERE `id` =" . $id;
} else {
list($weight) = $db->sql_fetchrow($db->sql_query("SELECT MAX(`weight`) FROM `" . NV_PREFIXLANG . "_" . $module_data . "`"));
$weight = intval($weight) + 1;
$query = "INSERT INTO `" . NV_PREFIXLANG . "_" . $module_data . "` VALUES (\r\n NULL, " . $db->dbescape($title) . ", " . $db->dbescape($alias) . ", " . $db->dbescape($bodytext) . ", '', \r\n " . $weight . ", " . $admin_info['admin_id'] . ", " . NV_CURRENTTIME . ", " . NV_CURRENTTIME . ", 1);";
nv_insert_logs(NV_LANG_DATA, $module_name, 'log_add_about', " ", $admin_info['userid']);
}
$db->sql_query($query);
nv_del_moduleCache($module_name);
Header("Location: " . NV_BASE_ADMINURL . "index.php?" . NV_NAME_VARIABLE . "=" . $module_name . "&" . NV_OP_VARIABLE . "=main");
die;
}
} else {
示例14: array
$array_fiter = array('create table if not exists', 'create table', '(', '`');
$table = str_replace($array_fiter, '', $table);
$table = preg_replace('/(\\W+)/i', '_', trim($table));
$table = preg_replace("/^" . nv_preg_quote(NV_PREFIXLANG . '_' . $data_system['module_data'] . '_') . "(.*)\$/", "\\1", $table);
$table = preg_replace("/^" . nv_preg_quote(NV_PREFIXLANG . '_' . $data_system['module_data']) . "(.*)\$/", "\\1", $table);
$table = preg_replace("/^" . nv_preg_quote($db_config['prefix'] . '_' . $data_system['module_data'] . '_') . "(.*)\$/", "\\1", $table);
$table = preg_replace("/^" . nv_preg_quote($db_config['prefix'] . '_' . $data_system['module_data']) . "(.*)\$/", "\\1", $table);
$table = preg_replace("/^" . nv_preg_quote(NV_PREFIXLANG . '_') . "(.*)\$/", "\\1", $table);
$table = preg_replace("/^" . nv_preg_quote($db_config['prefix'] . '_') . "(.*)\$/", "\\1", $table);
}
$data_sql[] = array('table' => $table, 'sql' => $sql);
} elseif (strlen($sql) > 10) {
$table = $tablename[$key];
if (!empty($table)) {
$table = str_replace("_", "-", $table);
$table = change_alias($table);
$table = str_replace("-", "_", $table);
}
$data_sql[] = array('table' => $table, 'sql' => $sql);
}
}
}
if (!empty($data_system['module_name'])) {
if ($nv_Request->get_string('download', 'post', 0)) {
$tempdir = 'nv4_module_' . $data_system['module_name'] . '_' . md5(nv_genpass(10) . session_id());
if (is_dir(NV_ROOTDIR . "/" . NV_TEMP_DIR . "/" . $tempdir)) {
nv_deletefile(NV_ROOTDIR . "/" . NV_TEMP_DIR . "/" . $tempdir, true);
}
nv_mkdir_nvtools(NV_ROOTDIR . "/" . NV_TEMP_DIR, $tempdir);
nv_mkdir_nvtools(NV_ROOTDIR . "/" . NV_TEMP_DIR . "/" . $tempdir, "modules");
nv_mkdir_nvtools(NV_ROOTDIR . "/" . NV_TEMP_DIR . "/" . $tempdir . "/modules", $data_system['module_name'], 1);
示例15: nv_strtolower
$row['imagealt'] = $nv_Request->get_title('imagealt', 'post', '', 1);
$row['imageposition'] = $nv_Request->get_int('imageposition', 'post', 0);
$row['description'] = $nv_Request->get_textarea('description', '', 'br', 1);
$row['bodytext'] = $nv_Request->get_editor('bodytext', '', NV_ALLOWED_HTML_TAGS);
$row['keywords'] = nv_strtolower($nv_Request->get_title('keywords', 'post', '', 0));
$row['socialbutton'] = $nv_Request->get_int('socialbutton', 'post', 0);
$row['layout_func'] = $nv_Request->get_title('layout_func', 'post', '');
$row['gid'] = $nv_Request->get_int('gid', 'post', 0);
$_groups_post = $nv_Request->get_array('activecomm', 'post', array());
$row['activecomm'] = !empty($_groups_post) ? implode(',', nv_groups_post(array_intersect($_groups_post, array_keys($groups_list)))) : '';
if (empty($row['title'])) {
$error = $lang_module['empty_title'];
} elseif (strip_tags($row['bodytext']) == '') {
$error = $lang_module['empty_bodytext'];
} elseif (empty($row['layout_func']) or in_array('layout.' . $row['layout_func'] . '.tpl', $layout_array)) {
$row['alias'] = empty($row['alias']) ? change_alias($row['title']) : change_alias($row['alias']);
if (empty($row['keywords'])) {
$row['keywords'] = nv_get_keywords($row['title']);
if (empty($row['keywords'])) {
$row['keywords'] = nv_unhtmlspecialchars($row['keywords']);
$row['keywords'] = strip_punctuation($row['keywords']);
$row['keywords'] = trim($row['keywords']);
$row['keywords'] = nv_strtolower($row['keywords']);
$row['keywords'] = preg_replace('/[ ]+/', ',', $row['keywords']);
}
}
if ($id) {
$_sql = 'UPDATE ' . NV_PREFIXLANG . '_' . $module_data . ' SET title = :title, alias = :alias, image = :image, imagealt = :imagealt, imageposition = :imageposition, description = :description, bodytext = :bodytext, keywords = :keywords, socialbutton = :socialbutton, activecomm = :activecomm, layout_func = :layout_func, gid = :gid, admin_id = :admin_id, edit_time = ' . NV_CURRENTTIME . ' WHERE id =' . $id;
$publtime = $row['add_time'];
} else {
if ($page_config['news_first']) {