本文整理汇总了PHP中nv_deletefile函数的典型用法代码示例。如果您正苦于以下问题:PHP nv_deletefile函数的具体用法?PHP nv_deletefile怎么用?PHP nv_deletefile使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了nv_deletefile函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: cron_auto_del_temp_download
function cron_auto_del_temp_download()
{
$dir = NV_ROOTDIR . '/' . NV_TEMP_DIR;
$result = true;
if ($dh = opendir($dir)) {
while (($file = readdir($dh)) !== false) {
if (preg_match('/^(' . nv_preg_quote(NV_TEMPNAM_PREFIX) . ')[a-zA-Z0-9\\_\\.]+$/', $file)) {
if (filemtime($dir . '/' . $file) + 600 < NV_CURRENTTIME) {
if (is_file($dir . '/' . $file)) {
if (!@unlink($dir . '/' . $file)) {
$result = false;
}
} else {
$rt = nv_deletefile($dir . '/' . $file, true);
if ($rt[0] == 0) {
$result = false;
}
}
}
}
}
closedir($dh);
clearstatcache();
}
return $result;
}
示例2: nv_delete_cache
/**
* nv_delete_cache()
*
* @param mixed $pattern
* @return
*/
function nv_delete_cache($pattern)
{
$files = nv_scandir(NV_ROOTDIR . "/" . NV_CACHEDIR, $pattern);
if (!empty($files)) {
foreach ($files as $f) {
nv_deletefile(NV_ROOTDIR . "/" . NV_CACHEDIR . "/" . $f, true);
}
}
}
示例3: nv_save_file_banip
/**
* nv_save_file_banip()
*
* @return
*/
function nv_save_file_banip()
{
global $db, $db_config;
$content_config_site = "";
$content_config_admin = "";
$sql = "SELECT `ip`, `mask`, `area`, `begintime`, `endtime` FROM `" . $db_config['prefix'] . "_banip`";
$result = $db->sql_query($sql);
while (list($dbip, $dbmask, $dbarea, $dbbegintime, $dbendtime) = $db->sql_fetchrow($result)) {
$dbendtime = intval($dbendtime);
$dbarea = intval($dbarea);
if ($dbendtime == 0 or $dbendtime > NV_CURRENTTIME) {
switch ($dbmask) {
case 3:
$ip_mask = "/\\.[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}\$/";
break;
case 2:
$ip_mask = "/\\.[0-9]{1,3}.[0-9]{1,3}\$/";
break;
case 1:
$ip_mask = "/\\.[0-9]{1,3}\$/";
break;
default:
$ip_mask = "//";
}
if ($dbarea == 1 or $dbarea == 3) {
$content_config_site .= "\$array_banip_site['" . $dbip . "'] = array( 'mask' => \"" . $ip_mask . "\", 'begintime' => " . $dbbegintime . ", 'endtime' => " . $dbendtime . " );\n";
}
if ($dbarea == 2 or $dbarea == 3) {
$content_config_admin .= "\$array_banip_admin['" . $dbip . "'] = array( 'mask' => \"" . $ip_mask . "\", 'begintime' => " . $dbbegintime . ", 'endtime' => " . $dbendtime . " );\n";
}
}
}
if (!$content_config_site and !$content_config_admin) {
nv_deletefile(NV_ROOTDIR . "/" . NV_DATADIR . "/banip.php");
return true;
}
$content_config = "<?php\n\n";
$content_config .= NV_FILEHEAD . "\n\n";
$content_config .= "if ( ! defined( 'NV_MAINFILE' ) ) die( 'Stop!!!' );\n\n";
$content_config .= "\$array_banip_site = array();\n";
$content_config .= $content_config_site;
$content_config .= "\n";
$content_config .= "\$array_banip_admin = array();\n";
$content_config .= $content_config_admin;
$content_config .= "\n";
$content_config .= "?>";
$write = file_put_contents(NV_ROOTDIR . "/" . NV_DATADIR . "/banip.php", $content_config, LOCK_EX);
if ($write === false) {
return $content_config;
}
return true;
}
示例4: nv_save_file_banip
/**
* nv_save_file_banip()
*
* @return
*/
function nv_save_file_banip()
{
global $db, $db_config;
$content_config_site = '';
$content_config_admin = '';
$result = $db->query('SELECT ip, mask, area, begintime, endtime FROM ' . $db_config['prefix'] . '_banip');
while (list($dbip, $dbmask, $dbarea, $dbbegintime, $dbendtime) = $result->fetch(3)) {
$dbendtime = intval($dbendtime);
$dbarea = intval($dbarea);
if ($dbendtime == 0 or $dbendtime > NV_CURRENTTIME) {
switch ($dbmask) {
case 3:
$ip_mask = '/\\.[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}$/';
break;
case 2:
$ip_mask = '/\\.[0-9]{1,3}.[0-9]{1,3}$/';
break;
case 1:
$ip_mask = '/\\.[0-9]{1,3}$/';
break;
default:
$ip_mask = '//';
}
if ($dbarea == 1 or $dbarea == 3) {
$content_config_site .= "\$array_banip_site['" . $dbip . "'] = array( 'mask' => \"" . $ip_mask . "\", 'begintime' => " . $dbbegintime . ", 'endtime' => " . $dbendtime . " );\n";
}
if ($dbarea == 2 or $dbarea == 3) {
$content_config_admin .= "\$array_banip_admin['" . $dbip . "'] = array( 'mask' => \"" . $ip_mask . "\", 'begintime' => " . $dbbegintime . ", 'endtime' => " . $dbendtime . " );\n";
}
}
}
if (!$content_config_site and !$content_config_admin) {
nv_deletefile(NV_ROOTDIR . '/' . NV_DATADIR . '/banip.php');
return true;
}
$content_config = "<?php\n\n";
$content_config .= NV_FILEHEAD . "\n\n";
$content_config .= "if ( ! defined( 'NV_MAINFILE' ) ) die( 'Stop!!!' );\n\n";
$content_config .= "\$array_banip_site = array();\n";
$content_config .= $content_config_site;
$content_config .= "\n";
$content_config .= "\$array_banip_admin = array();\n";
$content_config .= $content_config_admin;
$write = file_put_contents(NV_ROOTDIR . '/' . NV_DATADIR . '/banip.php', $content_config, LOCK_EX);
if ($write === false) {
return $content_config;
}
return true;
}
示例5: nv_del_content_module
function nv_del_content_module($id)
{
global $db, $module_name, $module_data, $title;
$content_del = "NO_" . $id;
$title = "";
list($id, $listcatid, $title, $homeimgfile, $homeimgthumb) = $db->sql_fetchrow($db->sql_query("SELECT `id`, `listcatid`, `title`, `homeimgfile`, `homeimgthumb` FROM `" . NV_PREFIXLANG . "_" . $module_data . "_rows` WHERE `id`=" . intval($id) . ""));
if ($id > 0) {
nv_save_log_content($id);
if ($homeimgfile != "" or $homeimgthumb != "") {
$homeimgfile .= "|" . $homeimgthumb;
$homeimgfile_arr = explode("|", $homeimgfile);
foreach ($homeimgfile_arr as $homeimgfile_i) {
if (!empty($homeimgfile_i) and is_file(NV_UPLOADS_REAL_DIR . '/' . $module_name . '/' . $homeimgfile_i)) {
@nv_deletefile(NV_UPLOADS_REAL_DIR . '/' . $module_name . '/' . $homeimgfile_i);
}
}
}
$number_no_del = 0;
$array_catid = explode(",", $listcatid);
foreach ($array_catid as $catid_i) {
$catid_i = intval($catid_i);
if ($catid_i > 0) {
$query = "DELETE FROM `" . NV_PREFIXLANG . "_" . $module_data . "_" . $catid_i . "` WHERE `id`=" . $id . "";
$db->sql_query($query);
if (!$db->sql_affectedrows()) {
$number_no_del++;
}
$db->sql_freeresult();
}
}
if ($number_no_del == 0) {
$query = "DELETE FROM `" . NV_PREFIXLANG . "_" . $module_data . "_rows` WHERE `id`=" . $id;
$db->sql_query($query);
if (!$db->sql_affectedrows()) {
$number_no_del++;
$db->sql_freeresult();
}
}
$number_no_del = 0;
if ($number_no_del == 0) {
$db->sql_query("DELETE FROM `" . NV_PREFIXLANG . "_" . $module_data . "_comments` WHERE `id` = " . $id);
$db->sql_query("DELETE FROM `" . NV_PREFIXLANG . "_" . $module_data . "_block` WHERE `id` = " . $id);
$content_del = "OK_" . $id;
} else {
$content_del = "ERR_" . $lang_module['error_del_content'];
}
}
return $content_del;
}
示例6: deleteAvatar
function deleteAvatar()
{
global $db, $user_info;
$sql = 'SELECT photo FROM ' . NV_USERS_GLOBALTABLE . ' WHERE userid=' . $user_info['userid'];
$result = $db->query($sql);
$oldAvatar = $result->fetchColumn();
$result->closeCursor();
if (!empty($oldAvatar)) {
if (file_exists(NV_ROOTDIR . '/' . $oldAvatar)) {
nv_deletefile(NV_ROOTDIR . '/' . $oldAvatar);
}
$stmt = $db->prepare("UPDATE " . NV_USERS_GLOBALTABLE . " SET photo='' WHERE userid=" . $user_info['userid']);
$stmt->execute();
}
}
示例7: nv_CreateXML_bannerPlan
/**
* nv_CreateXML_bannerPlan()
*
* @return
*/
function nv_CreateXML_bannerPlan()
{
global $db, $global_config;
$pattern = $global_config['idsite'] ? '/^site\\_' . $global_config['idsite'] . '\\_bpl\\_([0-9]+)\\.xml$/' : '/^bpl\\_([0-9]+)\\.xml$/';
$files = nv_scandir(NV_ROOTDIR . '/' . NV_DATADIR, $pattern);
if (!empty($files)) {
foreach ($files as $file) {
nv_deletefile(NV_ROOTDIR . '/' . NV_DATADIR . '/' . $file);
}
}
include NV_ROOTDIR . '/includes/class/array2xml.class.php';
$sql = 'SELECT * FROM ' . NV_BANNERS_GLOBALTABLE . '_plans WHERE act = 1';
$result = $db->query($sql);
while ($row = $result->fetch()) {
$id = intval($row['id']);
if ($global_config['idsite']) {
$xmlfile = NV_ROOTDIR . '/' . NV_DATADIR . '/site_' . $global_config['idsite'] . '_bpl_' . $id . '.xml';
} else {
$xmlfile = NV_ROOTDIR . '/' . NV_DATADIR . '/bpl_' . $id . '.xml';
}
$plan = array();
$plan['id'] = $id;
$plan['lang'] = $row['blang'];
$plan['title'] = $row['title'];
if (!empty($row['description'])) {
$plan['description'] = $row['description'];
}
$plan['form'] = $row['form'];
$plan['width'] = $row['width'];
$plan['height'] = $row['height'];
$query2 = 'SELECT * FROM ' . NV_BANNERS_GLOBALTABLE . '_rows WHERE pid = ' . $id . ' AND (exp_time > ' . NV_CURRENTTIME . ' OR exp_time = 0 ) AND act = 1';
if ($row['form'] == 'sequential') {
$query2 .= ' ORDER BY weight ASC';
}
$plan['banners'] = array();
$result2 = $db->query($query2);
while ($row2 = $result2->fetch()) {
$plan['banners'][] = array('id' => $row2['id'], 'title' => $row2['title'], 'clid' => $row2['clid'], 'file_name' => $row2['file_name'], 'imageforswf' => $row2['imageforswf'], 'file_ext' => $row2['file_ext'], 'file_mime' => $row2['file_mime'], 'file_width' => $row2['width'], 'file_height' => $row2['height'], 'file_alt' => $row2['file_alt'], 'file_click' => $row2['click_url'], 'target' => $row2['target'], 'publ_time' => $row2['publ_time'], 'exp_time' => $row2['exp_time']);
}
if (sizeof($plan['banners'])) {
$array2XML = new Array2XML();
$array2XML->saveXML($plan, 'plan', $xmlfile, $encoding = $global_config['site_charset']);
}
}
}
示例8: nv_CreateXML_bannerPlan
/**
* nv_CreateXML_bannerPlan()
*
* @return
*/
function nv_CreateXML_bannerPlan()
{
global $db, $global_config;
$files = nv_scandir(NV_ROOTDIR . '/' . NV_DATADIR, "/^bpl\\_([0-9]+)\\.xml\$/");
if (!empty($files)) {
foreach ($files as $file) {
nv_deletefile(NV_ROOTDIR . '/' . NV_DATADIR . '/' . $file);
}
}
include NV_ROOTDIR . '/includes/class/array2xml.class.php';
$sql = "SELECT * FROM `" . NV_BANNERS_PLANS_GLOBALTABLE . "` WHERE `act` = 1";
$result = $db->sql_query($sql);
while ($row = $db->sql_fetchrow($result)) {
$id = intval($row['id']);
$xmlfile = NV_ROOTDIR . '/' . NV_DATADIR . '/bpl_' . $id . '.xml';
$plan = array();
$plan['id'] = $id;
$plan['lang'] = $row['blang'];
$plan['title'] = $row['title'];
if (!empty($row['description'])) {
$plan['description'] = $row['description'];
}
$plan['form'] = $row['form'];
$plan['width'] = $row['width'];
$plan['height'] = $row['height'];
$query2 = "SELECT * FROM `" . NV_BANNERS_ROWS_GLOBALTABLE . "` WHERE `pid` = " . $id . " AND (`exp_time` > " . NV_CURRENTTIME . " OR `exp_time` = 0 ) AND `act` = 1";
if ($row['form'] == "sequential") {
$query2 .= " ORDER BY `weight` ASC";
}
$result2 = $db->sql_query($query2);
$numrows2 = $db->sql_numrows($result2);
if (empty($numrows2)) {
continue;
}
$plan['banners'] = array();
while ($row2 = $db->sql_fetchrow($result2)) {
$plan['banners'][] = array('id' => $row2['id'], 'title' => $row2['title'], 'clid' => $row2['clid'], 'file_name' => $row2['file_name'], 'file_ext' => $row2['file_ext'], 'file_mime' => $row2['file_mime'], 'file_width' => $row2['width'], 'file_height' => $row2['height'], 'file_alt' => $row2['file_alt'], 'file_click' => $row2['click_url']);
}
$array2XML = new Array2XML();
$array2XML->saveXML($plan, 'plan', $xmlfile, $encoding = $global_config['site_charset']);
}
}
示例9: nv_del_user
/**
* nv_del_user()
*
* @param mixed $userid
* @return
*/
function nv_del_user($userid)
{
global $db, $global_config, $nv_Request, $module_name, $user_info, $lang_module;
$sql = 'SELECT group_id, username, first_name, last_name, email, photo, in_groups, idsite FROM ' . NV_MOD_TABLE . ' WHERE userid=' . $userid;
$row = $db->query($sql)->fetch(3);
if (empty($row)) {
$return = 0;
}
list($group_id, $username, $first_name, $last_name, $email, $photo, $in_groups, $idsite) = $row;
if ($global_config['idsite'] > 0 and $idsite != $global_config['idsite']) {
return 0;
}
$query = $db->query('SELECT COUNT(*) FROM ' . NV_MOD_TABLE . '_groups_users WHERE group_id IN (1,2,3) AND userid=' . $userid);
if ($query->fetchColumn()) {
return 0;
} else {
$userdelete = !empty($first_name) ? $first_name . ' (' . $username . ')' : $username;
$result = $db->exec('DELETE FROM ' . NV_MOD_TABLE . ' WHERE userid=' . $userid);
if (!$result) {
return 0;
}
$in_groups = explode(',', $in_groups);
$db->query('UPDATE ' . NV_MOD_TABLE . '_groups SET numbers = numbers-1 WHERE group_id IN (SELECT group_id FROM ' . NV_MOD_TABLE . '_groups_users WHERE userid=' . $userid . ' AND approved = 1)');
$db->query('UPDATE ' . NV_MOD_TABLE . '_groups SET numbers = numbers-1 WHERE group_id=' . (($group_id == 7 or in_array(7, $in_groups)) ? 7 : 4));
$db->query('DELETE FROM ' . NV_MOD_TABLE . '_groups_users WHERE userid=' . $userid);
$db->query('DELETE FROM ' . NV_MOD_TABLE . '_openid WHERE userid=' . $userid);
$db->query('DELETE FROM ' . NV_MOD_TABLE . '_info WHERE userid=' . $userid);
nv_insert_logs(NV_LANG_DATA, $module_name, 'log_del_user', 'userid ' . $userid, $user_info['userid']);
if (!empty($photo) and is_file(NV_ROOTDIR . '/' . $photo)) {
@nv_deletefile(NV_ROOTDIR . '/' . $photo);
}
$subject = $lang_module['delconfirm_email_title'];
$message = sprintf($lang_module['delconfirm_email_content'], $userdelete, $global_config['site_name']);
$message = nl2br($message);
nv_sendmail($global_config['site_email'], $email, $subject, $message);
return $userid;
}
}
示例10: intval
$array_config['maxfilesize'] = intval($array_config['maxfilesize'] * 1048576);
}
$array_config['upload_filetype'] = !empty($array_config['upload_filetype']) ? implode(',', $array_config['upload_filetype']) : '';
$sth = $db->prepare('UPDATE ' . NV_MOD_TABLE . '_config SET config_value = :config_value WHERE config_name = :config_name');
foreach ($array_config as $config_name => $config_value) {
if ($config_name != 'readme') {
$sth->bindParam(':config_name', $config_name, PDO::PARAM_STR);
$sth->bindParam(':config_value', $config_value, PDO::PARAM_STR);
$sth->execute();
}
}
if (!empty($array_config['readme'])) {
file_put_contents($readme_file, $array_config['readme']);
} else {
if (file_exists($readme_file)) {
@nv_deletefile($readme_file);
}
}
$nv_Cache->delMod('settings');
$nv_Cache->delMod($module_name);
Header('Location: ' . NV_BASE_ADMINURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&' . NV_NAME_VARIABLE . '=' . $module_name . '&' . NV_OP_VARIABLE . '=' . $op);
die;
}
$array_config['is_addfile'] = 0;
$array_config['groups_addfile'] = '';
$array_config['groups_upload'] = '';
$array_config['maxfilesize'] = NV_UPLOAD_MAX_FILESIZE;
$array_config['upload_filetype'] = array('images', 'archives');
$array_config['is_zip'] = 0;
$array_config['readme'] = '';
$array_config['is_resume'] = 0;
示例11: unset
$config_theme['block_heading'] = $property;
unset($property);
// General css
$config_theme['generalcss'] = nv_unhtmlspecialchars($nv_Request->get_textarea('generalcss', 'post', ''));
$config_value = serialize($config_theme);
if (isset($module_config['themes'][$selectthemes])) {
$sth = $db->prepare("UPDATE " . NV_CONFIG_GLOBALTABLE . " SET config_value= :config_value WHERE config_name = :config_name AND lang = '" . NV_LANG_DATA . "' AND module='themes'");
} else {
$sth = $db->prepare("INSERT INTO " . NV_CONFIG_GLOBALTABLE . " (lang, module, config_name, config_value) VALUES ('" . NV_LANG_DATA . "', 'themes', :config_name, :config_value)");
}
$sth->bindParam(':config_name', $selectthemes, PDO::PARAM_STR);
$sth->bindParam(':config_value', $config_value, PDO::PARAM_STR, strlen($config_value));
$sth->execute();
nv_del_moduleCache('settings');
if (file_exists(NV_ROOTDIR . "/" . SYSTEM_FILES_DIR . "/css/theme_" . $selectthemes . "_" . $global_config['idsite'] . ".css")) {
nv_deletefile(NV_ROOTDIR . "/" . SYSTEM_FILES_DIR . "/css/theme_" . $selectthemes . "_" . $global_config['idsite'] . ".css");
}
Header('Location: ' . NV_BASE_ADMINURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&' . NV_NAME_VARIABLE . '=' . $module_name . '&' . NV_OP_VARIABLE . '=' . $op . '&selectthemes=' . $selectthemes . '&rand=' . nv_genpass());
die;
} elseif (isset($module_config['themes'][$selectthemes])) {
$config_theme = unserialize($module_config['themes'][$selectthemes]);
} else {
require NV_ROOTDIR . '/themes/' . $selectthemes . '/config_default.php';
}
$xtpl = new XTemplate('config.tpl', NV_ROOTDIR . '/themes/' . $selectthemes . '/system/');
$xtpl->assign('LANG', $lang_module);
$xtpl->assign('NV_LANG_VARIABLE', NV_LANG_VARIABLE);
$xtpl->assign('NV_LANG_DATA', NV_LANG_DATA);
$xtpl->assign('NV_BASE_ADMINURL', NV_BASE_ADMINURL);
$xtpl->assign('NV_NAME_VARIABLE', NV_NAME_VARIABLE);
$xtpl->assign('NV_OP_VARIABLE', NV_OP_VARIABLE);
示例12: XTemplate
}
$xtpl->parse('complete');
echo $xtpl->text('complete');
}
die;
}
if ($nv_Request->get_title('checksess', 'get', '') == md5('download' . $version . $package . NV_CHECK_SESSION)) {
$xtpl = new XTemplate('getupdate.tpl', NV_ROOTDIR . '/themes/' . $global_config['module_theme'] . '/modules/' . $module_file);
$xtpl->assign('LANG', $lang_module);
$NV_Http = new NukeViet\Http\Http($global_config, NV_TEMP_DIR);
$filename = NV_TEMPNAM_PREFIX . 'sysupd_' . NV_CHECK_SESSION . '.zip';
// Debug
$args = array('headers' => array('Referer' => NUKEVIET_STORE_APIURL), 'stream' => true, 'filename' => NV_ROOTDIR . '/' . NV_TEMP_DIR . '/' . $filename, 'body' => array('lang' => NV_LANG_INTERFACE, 'basever' => $global_config['version'], 'mode' => 'getsysupd', 'version' => $version, 'package' => $package), 'timeout' => 0);
// Delete temp file if exists
if (file_exists(NV_ROOTDIR . '/' . NV_TEMP_DIR . '/' . $filename)) {
@nv_deletefile(NV_ROOTDIR . '/' . NV_TEMP_DIR . '/' . $filename);
}
$apidata = $NV_Http->post(NUKEVIET_STORE_APIURL, $args);
if (!empty(NukeViet\Http\Http::$error)) {
$error = nv_http_get_lang(NukeViet\Http\Http::$error);
} elseif (empty($apidata['filename']) or !file_exists($apidata['filename'])) {
$error = $lang_module['get_update_error_file_download'];
}
if (!empty($error)) {
$xtpl->assign('ERROR', $error);
$xtpl->parse('error');
echo $xtpl->text('error');
} else {
$zip = new PclZip(NV_ROOTDIR . '/' . NV_TEMP_DIR . '/' . $filename);
$ziplistContent = $zip->listContent();
// Not exists (can not download)
示例13: while
while (file_exists($new_photo_path . $new_photo_name2)) {
$new_photo_name2 = preg_replace('/(.*)(\\.[a-zA-Z0-9]+)$/', '\\1_' . $i . '\\2', $new_photo_name);
++$i;
}
$new_photo = $new_photo_path . $new_photo_name2;
if (nv_copyfile($tmp_photo, $new_photo)) {
$_user['photo'] = substr($new_photo, strlen(NV_ROOTDIR . '/'));
} else {
$_user['photo'] = '';
}
nv_deletefile($tmp_photo);
}
}
// Delete old photo
if ($_user['delpic'] and !empty($row['photo']) and file_exists(NV_ROOTDIR . '/' . $row['photo'])) {
nv_deletefile(NV_ROOTDIR . '/' . $row['photo']);
}
} else {
$_user['photo'] = $row['photo'];
if (!empty($_user['photo'])) {
if (!file_exists(NV_ROOTDIR . '/' . $_user['photo'])) {
$_user['photo'] = '';
}
}
}
$in_groups = array();
foreach ($_user['in_groups'] as $_group_id) {
if ($_group_id > 9) {
$in_groups[] = $_group_id;
}
}
示例14: die
if (empty($row)) {
die('NO');
}
list($username, $first_name, $last_name, $email, $photo, $idsite) = $row;
if ($global_config['idsite'] > 0 and $idsite != $global_config['idsite']) {
die('NO');
}
$query = $db->query('SELECT COUNT(*) FROM ' . NV_GROUPS_GLOBALTABLE . '_users WHERE group_id IN (1,2,3) AND userid=' . $userid);
if ($query->fetchColumn()) {
die('ERROR_' . $lang_module['delete_group_system']);
} else {
$userdelete = !empty($first_name) ? $first_name . ' (' . $username . ')' : $username;
$result = $db->exec('DELETE FROM ' . NV_USERS_GLOBALTABLE . ' WHERE userid=' . $userid);
if (!$result) {
die('NO');
}
$db->query('UPDATE ' . NV_GROUPS_GLOBALTABLE . ' SET numbers = numbers-1 WHERE group_id IN (SELECT group_id FROM ' . NV_GROUPS_GLOBALTABLE . '_users WHERE userid=' . $userid . ')');
$db->query('UPDATE ' . NV_GROUPS_GLOBALTABLE . ' SET numbers = numbers-1 WHERE group_id=4');
$db->query('DELETE FROM ' . NV_GROUPS_GLOBALTABLE . '_users WHERE userid=' . $userid);
$db->query('DELETE FROM ' . NV_USERS_GLOBALTABLE . '_openid WHERE userid=' . $userid);
$db->query('DELETE FROM ' . NV_USERS_GLOBALTABLE . '_info WHERE userid=' . $userid);
nv_insert_logs(NV_LANG_DATA, $module_name, 'log_del_user', 'userid ' . $userid, $admin_info['userid']);
if (!empty($photo) and is_file(NV_ROOTDIR . '/' . $photo)) {
@nv_deletefile(NV_ROOTDIR . '/' . $photo);
}
$subject = $lang_module['delconfirm_email_title'];
$message = sprintf($lang_module['delconfirm_email_content'], $userdelete, $global_config['site_name']);
$message = nl2br($message);
nv_sendmail($global_config['site_email'], $email, $subject, $message);
die('OK');
}
示例15: nv_deletefile
if (!($ftp_check_login == 1 and ftp_delete($conn_id, 'themes/' . $array_file['filename']))) {
nv_deletefile(NV_ROOTDIR . '/themes/' . $array_file['filename']);
}
}
if (!($ftp_check_login == 1 and ftp_rename($conn_id, $temp_extract_dir . '/' . $array_file['filename'], 'themes/' . $array_file['filename']))) {
@rename(NV_ROOTDIR . '/' . $temp_extract_dir . '/' . $array_file['filename'], NV_ROOTDIR . '/themes/' . $array_file['filename']);
}
if (file_exists(NV_ROOTDIR . '/' . $temp_extract_dir . '/' . $array_file['filename'])) {
$error_move_folder[] = $array_file['filename'];
}
}
}
if (empty($error_move_folder)) {
// Giai nen hoan tat
nv_deletefile($filename);
nv_deletefile(NV_ROOTDIR . '/' . $temp_extract_dir, true);
$theme = substr($ziplistContent[0]['filename'], 0, -1);
$nv_redirect = NV_BASE_ADMINURL . 'index.php?' . NV_NAME_VARIABLE . '=' . $module_name . '&' . NV_OP_VARIABLE . '=setuplayout&selectthemes=' . $theme;
$xtpl->assign('NV_REDIRECT', $nv_redirect);
$xtpl->parse('complete');
$contents = $xtpl->text('complete');
include NV_ROOTDIR . "/includes/header.php";
echo $contents;
include NV_ROOTDIR . "/includes/footer.php";
exit;
} else {
// Xuat cac thu muc khong the di chuyen file qua
asort($error_move_folder);
foreach ($error_move_folder as $i => $folder) {
$xtpl->assign('FOLDER', $folder);
$xtpl->assign('CLASS', $i % 2 ? ' class="second"' : '');