示例#1
0
/**
 * nv_del_cat()
 *
 * @param mixed $catid
 * @return
 */
function nv_del_cat($catid)
{
    global $db, $module_name, $module_data, $admin_info, $nv_Cache;
    $sql = 'SELECT parentid, title FROM ' . NV_PREFIXLANG . '_' . $module_data . '_categories WHERE id=' . $catid;
    list($p, $title) = $db->query($sql)->fetch(3);
    $sql = 'SELECT id, fileupload, fileimage FROM ' . NV_PREFIXLANG . '_' . $module_data . ' WHERE catid=' . $catid;
    $result = $db->query($sql);
    $ids = array();
    while (list($id, $fileupload, $fileimage) = $result->fetch(3)) {
        $ids[] = $id;
    }
    if (!empty($ids)) {
        $ids = implode(',', $ids);
        $sql = 'DELETE FROM ' . NV_PREFIXLANG . '_comment WHERE module=' . $db->quote($module_name) . ' AND id IN (' . $ids . ')';
        $db->query($sql);
        $sql = 'DELETE FROM ' . NV_PREFIXLANG . '_' . $module_data . '_report WHERE fid IN (' . $ids . ')';
        $db->query($sql);
    }
    $sql = 'DELETE FROM ' . NV_PREFIXLANG . '_' . $module_data . ' WHERE catid=' . $catid;
    $db->query($sql);
    $sql = 'SELECT id FROM ' . NV_PREFIXLANG . '_' . $module_data . '_categories WHERE parentid=' . $catid;
    $result = $db->query($sql);
    while (list($id) = $result->fetch(3)) {
        nv_del_cat($id);
    }
    $sql = 'DELETE FROM ' . NV_PREFIXLANG . '_' . $module_data . '_categories WHERE id=' . $catid;
    $db->query($sql);
    $nv_Cache->delMod($module_name);
    nv_insert_logs(NV_LANG_DATA, $module_data, 'Delete Category', $title, $admin_info['userid']);
}
示例#2
0
文件: cat.php 项目: atarubi/nuke-viet
/**
 * nv_del_cat()
 * 
 * @param mixed $catid
 * @return
 */
function nv_del_cat($catid)
{
    global $db, $module_data, $admin_info;
    $sql = "SELECT `parentid`, `title` FROM `" . NV_PREFIXLANG . "_" . $module_data . "_categories` WHERE `id`=" . $catid;
    $result = $db->sql_query($sql);
    list($p, $title) = $db->sql_fetchrow($result);
    $sql = "SELECT `id`, `fileupload`, `fileimage` FROM `" . NV_PREFIXLANG . "_" . $module_data . "` WHERE `catid`=" . $catid;
    $result = $db->sql_query($sql);
    $ids = array();
    while (list($id, $fileupload, $fileimage) = $db->sql_fetchrow($result)) {
        $ids[] = $id;
        //Khong xao file vi co the co truong hop file dung chung
        /*
                if(!empty($fileupload))
                {
                $fileupload = explode("[NV]",$fileupload);
                
                foreach($fileupload as $file)
                {
                $file = substr($file,strlen(NV_BASE_SITEURL));
                if ( ! empty( $file ) and file_exists( NV_ROOTDIR . '/' . $file ) )
                {
                @nv_deletefile( NV_ROOTDIR . '/' . $file );
                }
                }
                }
        
                $fileimage = substr($array['fileimage'],strlen(NV_BASE_SITEURL));
                if ( ! empty( $fileimage ) and file_exists( NV_ROOTDIR . '/' . $fileimage ) )
                {
                @nv_deletefile( NV_ROOTDIR . '/' . $fileimage );
                }*/
    }
    if (!empty($ids)) {
        $ids = implode(",", $ids);
        $sql = "DELETE FROM `" . NV_PREFIXLANG . "_" . $module_data . "_comments` WHERE `fid` IN (" . $ids . ")";
        $db->sql_query($sql);
        $sql = "DELETE FROM `" . NV_PREFIXLANG . "_" . $module_data . "_report` WHERE `fid` IN (" . $ids . ")";
        $db->sql_query($sql);
    }
    $sql = "DELETE FROM `" . NV_PREFIXLANG . "_" . $module_data . "` WHERE `catid`=" . $catid;
    $db->sql_query($sql);
    $sql = "SELECT `id` FROM `" . NV_PREFIXLANG . "_" . $module_data . "_categories` WHERE `parentid`=" . $catid;
    $result = $db->sql_query($sql);
    while (list($id) = $db->sql_fetchrow($result)) {
        nv_del_cat($id);
    }
    $sql = "DELETE FROM `" . NV_PREFIXLANG . "_" . $module_data . "_categories` WHERE `id`=" . $catid;
    $db->sql_query($sql);
    nv_insert_logs(NV_LANG_DATA, $module_data, "Delete Category", $title, $admin_info['userid']);
}
示例#3
0
function nv_del_cat($catid, $db, $module_data, $BL)
{
    global $admin_info;
    $sql = "SELECT parentid, title FROM " . $BL->table_prefix . "_categories WHERE id=" . $catid;
    list($parentid, $catTitle) = $db->query($sql)->fetch(3);
    $sql = "SELECT id FROM " . $BL->table_prefix . "_categories WHERE parentid=" . $catid;
    $result = $db->query($sql);
    while (list($id) = $result->fetch(3)) {
        nv_del_cat($id, $db, $module_data, $BL);
    }
    // Xoa bang danh muc
    $sql = "DELETE FROM " . $BL->table_prefix . "_categories WHERE id=" . $catid;
    $db->query($sql);
    // Cap nhat thong ke danh muc
    $BL->fixCat($parentid);
    // Ghi nhat ky
    nv_insert_logs(NV_LANG_DATA, $module_data, $BL->lang('categoriesDelete'), $catTitle, $admin_info['userid']);
}
示例#4
0
/**
 * nv_del_cat()
 *
 * @param mixed $catid
 * @return
 */
function nv_del_cat($catid)
{
    global $db, $module_name, $module_data, $admin_info, $nv_Cache;
    $sql = 'SELECT parentid, title FROM ' . NV_MOD_TABLE . '_categories WHERE id=' . $catid;
    list($p, $title) = $db->query($sql)->fetch(3);
    $sql = 'SELECT id, fileimage FROM ' . NV_MOD_TABLE . ' WHERE catid=' . $catid;
    $result = $db->query($sql);
    $ids = array();
    while (list($id, $fileimage) = $result->fetch(3)) {
        $ids[] = $id;
        nv_delete_notification(NV_LANG_DATA, $module_name, 'report', $id);
    }
    if (!empty($ids)) {
        $ids = implode(',', $ids);
        $sql = 'DELETE FROM ' . NV_PREFIXLANG . '_comment WHERE module=' . $db->quote($module_name) . ' AND id IN (' . $ids . ')';
        $db->query($sql);
        $sql = 'DELETE FROM ' . NV_MOD_TABLE . '_report WHERE fid IN (' . $ids . ')';
        $db->query($sql);
        $sql = 'DELETE FROM ' . NV_MOD_TABLE . '_detail WHERE id IN (' . $ids . ')';
        $db->query($sql);
        $sql = 'DELETE FROM ' . NV_MOD_TABLE . '_files WHERE download_id IN (' . $ids . ')';
        $db->query($sql);
        $sql = 'SELECT * FROM ' . NV_MOD_TABLE . '_tags_id WHERE id IN (' . $ids . ')';
        $result = $db->query($sql);
        while ($row = $result->fetch()) {
            $sql = 'UPDATE ' . NV_MOD_TABLE . '_tags SET numdownload=numdownload-1 WHERE did=' . $row['did'];
            $db->query($sql);
        }
        $sql = 'DELETE FROM ' . NV_MOD_TABLE . '_tags_id WHERE id IN (' . $ids . ')';
        $db->query($sql);
    }
    $sql = 'DELETE FROM ' . NV_MOD_TABLE . ' WHERE catid=' . $catid;
    $db->query($sql);
    $sql = 'SELECT id FROM ' . NV_MOD_TABLE . '_categories WHERE parentid=' . $catid;
    $result = $db->query($sql);
    while (list($id) = $result->fetch(3)) {
        nv_del_cat($id);
    }
    $sql = 'DELETE FROM ' . NV_MOD_TABLE . '_categories WHERE id=' . $catid;
    $db->query($sql);
    $nv_Cache->delMod($module_name);
    nv_insert_logs(NV_LANG_DATA, $module_data, 'Delete Category', $title, $admin_info['userid']);
}
示例#5
0
/**
 * 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;
    }
}
示例#6
0
    } elseif (!is_array($tables)) {
        $tables = array($tables);
    }
    $tab_list = array();
    $result = $db->query("SHOW TABLES LIKE '" . $db_config['prefix'] . "_%'");
    while ($item = $result->fetch(3)) {
        $tab_list[] = $item[0];
    }
    $result->closeCursor();
    $contents = array();
    $contents['tables'] = empty($tables) ? $tab_list : array_values(array_intersect($tab_list, $tables));
    $contents['type'] = $type != 'str' ? 'all' : 'str';
    $contents['savetype'] = $ext != 'sql' ? 'gz' : 'sql';
    $contents['filename'] = tempnam(NV_ROOTDIR . '/' . NV_TEMP_DIR, NV_TEMPNAM_PREFIX);
    include NV_ROOTDIR . '/includes/core/dump.php';
    $result = nv_dump_save($contents);
    if (!empty($result)) {
        nv_insert_logs(NV_LANG_DATA, $module_name, $lang_module['download'], 'File name: ' . basename($contents['filename']), $admin_info['userid']);
        $content['mime'] = $contents['savetype'] == 'gz' ? 'application/x-gzip' : 'text/x-sql';
        $contents['fname'] = $db->dbname . '.sql';
        if ($contents['savetype'] == 'gz') {
            $contents['fname'] .= '.gz';
        }
        //Download file
        require_once NV_ROOTDIR . '/includes/class/download.class.php';
        $download = new download($result[0], NV_ROOTDIR . '/' . NV_TEMP_DIR, basename($contents['fname']));
        $download->download_file();
        exit;
    }
}
die;
示例#7
0
** @Project: NUKEVIET SUPPORT ONLINE
** @Author: Viet Group (vietgroup.biz@gmail.com)
** @Copyright: VIET GROUP
** @Craetdate: 19.08.2011
** @Website: http://vietgroup.biz
*/
if (!defined('NV_IS_FILE_ADMIN')) {
    die('Stop!!!');
}
$id = $nv_Request->get_int('id', 'post', 0);
if (empty($id)) {
    die('NO_' . $id);
}
$query = "SELECT * FROM `" . NV_PREFIXLANG . "_" . $module_data . "` WHERE `id`=" . $id;
$result = $db->sql_query($query);
$numrows = $db->sql_numrows($result);
if ($numrows != 1) {
    die('NO_' . $id);
}
nv_insert_logs(NV_LANG_DATA, $module_name, $lang_module['log_del_support'], "supportid  " . $id, $admin_info['userid']);
$query = "DELETE FROM `" . NV_PREFIXLANG . "_" . $module_data . "` WHERE `id` = " . $id;
$db->sql_query($query);
nv_fix_weight_sp();
if ($db->sql_affectedrows() > 0) {
    nv_del_moduleCache($module_name);
} else {
    die('NO_' . $id);
}
include NV_ROOTDIR . "/includes/header.php";
echo 'OK_' . $id;
include NV_ROOTDIR . "/includes/footer.php";
<?php

/**
 * @Project NUKEVIET 3.0
 * @Author VINADES.,JSC (contact@vinades.vn)
 * @Copyright (C) 2010 VINADES.,JSC. All rights reserved
 * @Createdate 2-10-2010 18:49
 */
if (!defined('NV_IS_FILE_ADMIN')) {
    die('Stop!!!');
}
$bid = $nv_Request->get_int('bid', 'post', 0);
$contents = "NO_" . $bid;
list($bid) = $db->sql_fetchrow($db->sql_query("SELECT `bid` FROM `" . NV_PREFIXLANG . "_" . $module_data . "_block_cat` WHERE `bid`=" . intval($bid) . ""));
if ($bid > 0) {
    nv_insert_logs(NV_LANG_DATA, $module_name, 'log_del_blockcat', "block_catid " . $bid, $admin_info['userid']);
    $query = "DELETE FROM `" . NV_PREFIXLANG . "_" . $module_data . "_block_cat` WHERE `bid`=" . $bid . "";
    if ($db->sql_query($query)) {
        $db->sql_freeresult();
        $query = "DELETE FROM `" . NV_PREFIXLANG . "_" . $module_data . "_block` WHERE `bid`=" . $bid . "";
        $db->sql_query($query);
        nv_fix_block_cat();
        nv_del_moduleCache($module_name);
        $contents = "OK_" . $bid;
    }
}
include NV_ROOTDIR . "/includes/header.php";
echo $contents;
include NV_ROOTDIR . "/includes/footer.php";
示例#9
0
            die;
        } else {
            $error = $lang_module['errorsave'];
        }
    } else {
        $stmt = $db->prepare("UPDATE " . NV_PREFIXLANG . "_" . $module_data . "_playlist_cat SET title= :title, alias = :alias, status = :status, private_mode = :private_mode, description= :description, image= :image, keywords= :keywords, edit_time=" . NV_CURRENTTIME . " WHERE playlist_id =" . $playlist_id);
        $stmt->bindParam(':title', $title, PDO::PARAM_STR);
        $stmt->bindParam(':alias', $alias, PDO::PARAM_STR);
        $stmt->bindParam(':status', $status, PDO::PARAM_STR);
        $stmt->bindParam(':private_mode', $private_mode, PDO::PARAM_STR);
        $stmt->bindParam(':description', $description, PDO::PARAM_STR);
        $stmt->bindParam(':image', $image, PDO::PARAM_STR);
        $stmt->bindParam(':keywords', $keywords, PDO::PARAM_STR);
        $stmt->execute();
        if ($stmt->execute()) {
            nv_insert_logs(NV_LANG_DATA, $module_name, 'log_edit_playlistcat', "playlist_id " . $playlist_id, $admin_info['userid']);
            Header('Location: ' . NV_BASE_ADMINURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&' . NV_NAME_VARIABLE . '=' . $module_name . '&' . NV_OP_VARIABLE . '=' . $op);
            die;
        } else {
            $error = $lang_module['errorsave'];
        }
    }
}
$array_status = array($lang_global['no'], $lang_global['yes'], $lang_module['playlist_waiting_approve']);
$array_private_mode = array($lang_module['playlist_private_off'], $lang_module['playlist_private_on']);
$playlist_id = $nv_Request->get_int('playlist_id', 'get', 0);
if ($playlist_id > 0) {
    list($playlist_id, $title, $alias, $description, $image, $keywords, $status, $private_mode) = $db->query("SELECT playlist_id, title, alias, description, image, keywords, status, private_mode FROM " . NV_PREFIXLANG . "_" . $module_data . "_playlist_cat where playlist_id=" . $playlist_id)->fetch(3);
    $lang_module['add_playlist_cat'] = $lang_module['edit_playlist_cat'];
}
$lang_global['title_suggest_max'] = sprintf($lang_global['length_suggest_max'], 65);
示例#10
0
<?php

/**
 * @Project NUKEVIET 3.0
 * @Author VINADES.,JSC (contact@vinades.vn)
 * @Copyright (C) 2010 VINADES., JSC. All rights reserved
 * @Createdate 3/11/2010 21:1
 */
if (!defined('NV_IS_FILE_ADMIN')) {
    die('Stop!!!');
}
if (!defined('NV_IS_AJAX')) {
    die('Wrong URL');
}
$id = $nv_Request->get_int('id', 'post', 0);
nv_insert_logs(NV_LANG_DATA, $module_name, 'log_del_client', "clientid " . $id, $admin_info['userid']);
if (empty($id)) {
    die('Stop!!!');
}
$query = "SELECT * FROM `" . NV_BANNERS_CLIENTS_GLOBALTABLE . "` WHERE `id`=" . $id;
$result = $db->sql_query($query);
$numrows = $db->sql_numrows($result);
if ($numrows != 1) {
    die('Stop!!!');
}
$banners_id = array();
$query = "SELECT `id`, `file_name`,`file_name_tmp` FROM `" . NV_BANNERS_ROWS_GLOBALTABLE . "` WHERE `clid`=" . $id;
$result = $db->sql_query($query);
while ($row = $db->sql_fetchrow($result)) {
    if (!empty($row['file_name']) and is_file(NV_ROOTDIR . '/' . $row['file_name'])) {
        @nv_deletefile(NV_ROOTDIR . '/' . $row['file_name']);
示例#11
0
         $post['exp_time'] = 0;
     }
     $post['public'] = $nv_Request->get_int('public', 'post', 0);
     if ($post['public'] != 1) {
         $post['public'] = 0;
     }
     if (isset($post['id'])) {
         $query = "UPDATE `" . NV_GROUPS_GLOBALTABLE . "` SET \n                    `title`=" . $db->dbescape($post['title']) . ", \n                    `content`=" . $db->dbescape($post['content']) . ", \n                    `exp_time`='" . $post['exp_time'] . "', \n                    `public`= " . $post['public'] . " \n                    WHERE `group_id`=" . $post['id'] . " LIMIT 1";
         $ok = $db->sql_query($query);
     } else {
         $query = "INSERT INTO `" . NV_GROUPS_GLOBALTABLE . "` \n                VALUES (NULL, " . $db->dbescape($post['title']) . ", \n                " . $db->dbescape($post['content']) . ", \n                " . NV_CURRENTTIME . ", \n                " . $post['exp_time'] . ", \n                '', " . $post['public'] . ", " . ($groupcount + 1) . ", 1);";
         $ok = $post['id'] = $db->sql_query_insert_id($query);
     }
     if ($ok) {
         nv_del_moduleCache($module_name);
         nv_insert_logs(NV_LANG_DATA, $module_name, $log_title, "Id: " . $post['id'], $admin_info['userid']);
         die("OK");
     } else {
         die($lang_module['errorsave']);
     }
 }
 if ($nv_Request->isset_request('edit', 'get')) {
     $post = $groupsList[$post['id']];
     $post['content'] = nv_editor_br2nl($post['content']);
     $post['exp_time'] = !empty($post['exp_time']) ? date("d.m.Y", $post['exp_time']) : "";
     $post['public'] = $post['public'] ? " checked=\"checked\"" : "";
 } else {
     $post['title'] = $post['content'] = $post['exp_time'] = "";
     $post['public'] = "";
 }
 if (!empty($post['content'])) {
示例#12
0
    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);
                $sth->bindParam(':note', $note, PDO::PARAM_STR);
                if ($sth->execute()) {
                    nv_insert_logs(NV_LANG_DATA, $module_name, $lang_module['vmodule_add'] . ' ' . $module_data, '', $admin_info['userid']);
                    Header('Location: ' . NV_BASE_ADMINURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&' . NV_NAME_VARIABLE . '=' . $module_name . '&' . NV_OP_VARIABLE . '=setup&setmodule=' . $title . '&checkss=' . md5($title . NV_CHECK_SESSION));
                    die;
                }
            } catch (PDOException $e) {
                trigger_error($e->getMessage());
            }
        }
    }
}
$page_title = $lang_module['vmodule_add'];
$xtpl = new XTemplate('vmodule.tpl', NV_ROOTDIR . '/themes/' . $global_config['module_theme'] . '/modules/' . $module_file);
if ($error) {
    $lang_module['vmodule_blockquote'] = $lang_module['vmodule_exit'];
    $xtpl->parse('main.error');
}
示例#13
0
                    $groups_download = '2';
                }
                if ($row['who_download'] == 2) {
                    $groups_download = '3';
                } else {
                    $groups_download = '6';
                }
                $db->query("INSERT " . NV_PREFIXLANG . "_" . $mod_data . "_categories (id, parentid, title, alias, description, groups_view, groups_download, weight, status) SELECT id, parentid, title, alias, description, " . $groups_view . " , " . $groups_download . ", weight, status  FROM " . NV_PREFIXLANG3 . "_" . $mod_data3 . "_categories Where id = " . $row['id']);
            }
        } catch (PDOException $e) {
            die($e->getMessage());
        }
        $db->query("INSERT " . NV_PREFIXLANG . "_" . $mod_data . "_tmp  SELECT  * FROM " . NV_PREFIXLANG3 . "_" . $mod_data3 . "_tmp");
        $db->query("INSERT " . NV_PREFIXLANG . "_" . $mod_data . "_report  SELECT  * FROM " . NV_PREFIXLANG3 . "_" . $mod_data3 . "_report");
        nv_del_moduleCache($mod_name);
        nv_insert_logs(NV_LANG_DATA, $mod_name, 'Convert', '', $admin_info['userid']);
        Header('Location: ' . nv_url_rewrite(NV_BASE_SITEURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&' . NV_NAME_VARIABLE . '=' . $mod_name, true));
        die;
    }
} else {
    $result = $db->query('SELECT title, module_data, custom_title FROM ' . NV3_PREFIX . '_' . NV_LANG_DATA . '_modules WHERE module_file="download"');
    $array_nv3_download = $result->fetchAll();
    $xtpl = new XTemplate($op . '.tpl', NV_ROOTDIR . '/themes/' . $module_info['template'] . '/modules/' . $module_file);
    $xtpl->assign('LANG', $lang_module);
    $xtpl->assign('NV_BASE_SITEURL', NV_BASE_SITEURL);
    $xtpl->assign('NV_NAME_VARIABLE', NV_NAME_VARIABLE);
    $xtpl->assign('NV_OP_VARIABLE', NV_OP_VARIABLE);
    $xtpl->assign('MODULE_NAME', $module_name);
    $xtpl->assign('OP', $op);
    foreach ($site_mods as $mod_name => $mod_data) {
        if ($mod_data['module_file'] == 'download') {
示例#14
0
                    echo nv_site_theme($contents);
                    include NV_ROOTDIR . '/includes/footer.php';
                    exit;
                }
                $query_field['userid'] = $userid;
                $db->query('INSERT INTO ' . NV_USERS_GLOBALTABLE . '_info (' . implode(', ', array_keys($query_field)) . ') VALUES (' . implode(', ', array_values($query_field)) . ')');
                $db->query('UPDATE ' . NV_GROUPS_GLOBALTABLE . ' SET numbers = numbers+1 WHERE group_id=4');
                $subject = $lang_module['account_register'];
                $message = sprintf($lang_module['account_register_info'], $array_register['first_name'], $global_config['site_name'], NV_MY_DOMAIN . NV_BASE_SITEURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&' . NV_NAME_VARIABLE . '=' . $module_name, $array_register['username']);
                nv_sendmail($global_config['site_email'], $array_register['email'], $subject, $message);
                $info = $lang_module['register_ok'] . "<br /><br />\n";
                $info .= "<img border=\"0\" src=\"" . NV_BASE_SITEURL . "images/load_bar.gif\"><br /><br />\n";
                $info .= '[<a href="' . NV_BASE_SITEURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&amp;' . NV_NAME_VARIABLE . '=' . $module_name . '">' . $lang_module['redirect_to_login'] . '</a>]';
                $contents = user_info_exit($info);
                $contents .= '<meta http-equiv="refresh" content="5;url=' . nv_url_rewrite(NV_BASE_SITEURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&amp;' . NV_NAME_VARIABLE . '=' . $module_name, true) . '" />';
                nv_insert_logs(NV_LANG_DATA, $module_name, $lang_module['register'], $array_register['username'] . ' | ' . $client_info['ip'] . ' | Simple', 0);
                include NV_ROOTDIR . '/includes/header.php';
                echo nv_site_theme($contents);
                include NV_ROOTDIR . '/includes/footer.php';
                exit;
            }
        }
    }
    $array_register['info'] = '<span style="color:#fb490b;">' . $error . '</span>';
} else {
    $array_register['first_name'] = $array_register['username'] = $array_register['email'] = '';
    $array_register['password'] = $array_register['re_password'] = $array_register['your_question'] = $array_register['answer'] = '';
    $array_register['question'] = $array_register['agreecheck'] = 0;
    $array_register['info'] = $lang_module['info'];
}
$array_register['agreecheck'] = $array_register['agreecheck'] ? ' checked="checked"' : '';
示例#15
0
            $data_insert['filepath'] = $data['filepath'];
            $data_insert['otherpath'] = $data['otherpath'];
            $data_insert['roomid'] = $data['roomid'];
            $data_insert['fieldid'] = $data['fieldid'];
            $data_insert['down'] = $data['down'];
            $data_insert['view'] = $data['view'];
            $data_insert['userid'] = $data['userid'];
            $data_insert['type'] = $data['type'];
            $data_insert['sign'] = $data['sign'];
            $data_insert['signtime'] = $data['signtime'];
            $data_insert['organid'] = $data['organid'];
            $newid = $db->insert_id($sql, 'id', $data_insert);
            if ($newid > 0) {
                nv_del_moduleCache($module_name);
                nv_fix_cat_row($data['catid']);
                nv_insert_logs(NV_LANG_DATA, $module_name, $lang_module['addcontent'], $data['title'], $user_info['userid']);
                $nv_redirect = NV_BASE_SITEURL . "index.php?" . NV_LANG_VARIABLE . "=" . NV_LANG_DATA . "&amp;" . NV_NAME_VARIABLE . "=" . $module_name;
                redict_link($lang_module['upload_ok'], $lang_module['upload_view'], $nv_redirect);
            } else {
                $error = $lang_module['errorsave'];
            }
            $db->sqlreset();
        }
    }
}
if ($data['signtime'] == 0) {
    $data['signtime'] = "";
} elseif ($data['signtime'] > 0) {
    $data['signtime'] = date("d/m/Y", $data['signtime']);
}
$contents = upload_content($data, $error);
示例#16
0
				WHERE id =' . $rowcontent['id']);
            $sth->bindParam(':listcatid', $rowcontent['listcatid'], PDO::PARAM_STR);
            $sth->bindParam(':author', $rowcontent['author'], PDO::PARAM_STR);
            $sth->bindParam(':artist', $rowcontent['artist'], PDO::PARAM_STR);
            $sth->bindParam(':title', $rowcontent['title'], PDO::PARAM_STR);
            $sth->bindParam(':alias', $rowcontent['alias'], PDO::PARAM_STR);
            $sth->bindParam(':hometext', $rowcontent['hometext'], PDO::PARAM_STR, strlen($rowcontent['hometext']));
            $sth->bindParam(':vid_path', $rowcontent['vid_path'], PDO::PARAM_STR);
            $sth->bindParam(':vid_duration', $rowcontent['vid_duration'], PDO::PARAM_STR);
            $sth->bindParam(':vid_type', $rowcontent['vid_type'], PDO::PARAM_STR);
            $sth->bindParam(':homeimgfile', $rowcontent['homeimgfile'], PDO::PARAM_STR);
            $sth->bindParam(':homeimgalt', $rowcontent['homeimgalt'], PDO::PARAM_STR);
            $sth->bindParam(':homeimgthumb', $rowcontent['homeimgthumb'], PDO::PARAM_STR);
            $sth->bindParam(':allowed_comm', $rowcontent['allowed_comm'], PDO::PARAM_STR);
            if ($sth->execute()) {
                nv_insert_logs(NV_LANG_DATA, $module_name, $lang_module['content_edit'], $rowcontent['title'], $admin_info['userid']);
                $ct_query = array();
                $sth = $db->prepare('UPDATE ' . NV_PREFIXLANG . '_' . $module_data . '_bodyhtml_' . ceil($rowcontent['id'] / 2000) . ' SET
					bodyhtml=:bodyhtml,
					sourcetext=:sourcetext,
					copyright=' . intval($rowcontent['copyright']) . ',
					allowed_send=' . intval($rowcontent['allowed_send']) . ',
					allowed_save=' . intval($rowcontent['allowed_save']) . ',
					gid=' . intval($rowcontent['gid']) . '
				WHERE id =' . $rowcontent['id']);
                $sth->bindParam(':bodyhtml', $rowcontent['bodyhtml'], PDO::PARAM_STR, strlen($rowcontent['bodyhtml']));
                $sth->bindParam(':sourcetext', $rowcontent['sourcetext'], PDO::PARAM_STR, strlen($rowcontent['sourcetext']));
                $ct_query[] = (int) $sth->execute();
                $array_cat_old = explode(',', $rowcontent_old['listcatid']);
                $array_cat_new = explode(',', $rowcontent['listcatid']);
                $array_cat_diff = array_diff($array_cat_old, $array_cat_new);
示例#17
0
文件: cat.php 项目: lzhao18/nukeviet
        $stmt->bindParam(':image', $image, PDO::PARAM_STR);
        $stmt->bindParam(':viewdescription', $viewdescription, PDO::PARAM_STR);
        $stmt->bindParam(':keywords', $keywords, PDO::PARAM_STR);
        $stmt->bindParam(':description', $description, PDO::PARAM_STR, strlen($description));
        $stmt->bindParam(':descriptionhtml', $descriptionhtml, PDO::PARAM_STR, strlen($descriptionhtml));
        $stmt->bindParam(':groups_view', $groups_view, PDO::PARAM_STR);
        $stmt->bindParam(':featured', $featured, PDO::PARAM_INT);
        $stmt->execute();
        if ($stmt->rowCount()) {
            if ($parentid != $parentid_old) {
                $weight = $db->query('SELECT max(weight) FROM ' . NV_PREFIXLANG . '_' . $module_data . '_cat WHERE parentid=' . $parentid)->fetchColumn();
                $weight = intval($weight) + 1;
                $sql = 'UPDATE ' . NV_PREFIXLANG . '_' . $module_data . '_cat SET weight=' . $weight . ' WHERE catid=' . intval($catid);
                $db->query($sql);
                nv_fix_cat_order();
                nv_insert_logs(NV_LANG_DATA, $module_name, $lang_module['edit_cat'], $title, $admin_info['userid']);
            }
            nv_del_moduleCache($module_name);
            Header('Location: ' . NV_BASE_ADMINURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&' . NV_NAME_VARIABLE . '=' . $module_name . '&' . NV_OP_VARIABLE . '=' . $op . '&parentid=' . $parentid);
            die;
        } else {
            $error = $lang_module['errorsave'];
        }
    } else {
        $error = $lang_module['error_name'];
    }
}
$groups_view = explode(',', $groups_view);
$array_cat_list = array();
if (defined('NV_IS_ADMIN_MODULE')) {
    $array_cat_list[0] = $lang_module['cat_sub_sl'];
示例#18
0
while (file_exists(NV_ROOTDIR . '/' . $path . '/' . $file)) {
    $file = preg_replace('/^(.*)(\\.[a-zA-Z]+)$/', '\\1_' . $width . '_' . $height . '_' . $i . '\\2', $imagename);
    ++$i;
}
if (isset($array_thumb_config[$path])) {
    $thumb_config = $array_thumb_config[$path];
} else {
    $thumb_config = $array_thumb_config[''];
    $_arr_path = explode('/', $path);
    while (sizeof($_arr_path) > 1) {
        array_pop($_arr_path);
        $_path = implode('/', $_arr_path);
        if (isset($array_thumb_config[$_path])) {
            $thumb_config = $array_thumb_config[$_path];
            break;
        }
    }
}
$createImage = new NukeViet\Files\Image(NV_ROOTDIR . '/' . $path . '/' . $imagename, NV_MAX_WIDTH, NV_MAX_HEIGHT);
$createImage->resizeXY($width, $height);
$createImage->save(NV_ROOTDIR . '/' . $path, $file, $thumb_config['thumb_quality']);
$createImage->close();
if (isset($array_dirname[$path])) {
    $did = $array_dirname[$path];
    $info = nv_getFileInfo($path, $file);
    $info['userid'] = $admin_info['userid'];
    $db->query("INSERT INTO " . NV_UPLOAD_GLOBALTABLE . "_file\n\t\t\t\t\t\t\t(name, ext, type, filesize, src, srcwidth, srcheight, sizes, userid, mtime, did, title) VALUES\n\t\t\t\t\t\t\t('" . $info['name'] . "', '" . $info['ext'] . "', '" . $info['type'] . "', " . $info['filesize'] . ", '" . $info['src'] . "', " . $info['srcwidth'] . ", " . $info['srcheight'] . ", '" . $info['size'] . "', " . $info['userid'] . ", " . $info['mtime'] . ", " . $did . ", '" . $file . "')");
}
nv_insert_logs(NV_LANG_DATA, $module_name, $lang_module['upload_createimage'], $path . '/' . $file, $admin_info['userid']);
echo $file;
exit;
示例#19
0
}
$row = $db->sql_fetchrow($result);
$theme_list = array();
$theme_array_file = nv_scandir(NV_ROOTDIR . "/themes", $global_config['check_theme']);
$theme_array_file = array_flip($theme_array_file);
$theme_array_file = array_keys($theme_array_file);
$sql = "SELECT DISTINCT `theme` FROM `" . NV_PREFIXLANG . "_modthemes`  WHERE `func_id`=0";
$result = $db->sql_query($sql);
while (list($theme) = $db->sql_fetchrow($result)) {
    if (in_array($theme, $theme_array_file)) {
        $theme_list[] = $theme;
    }
}
$groups_list = nv_groups_list();
if ($nv_Request->get_int('save', 'post') == '1') {
    nv_insert_logs(NV_LANG_DATA, $module_name, 'log_edit_modul', "module  " . $mod, $admin_info['userid']);
    $custom_title = filter_text_input('custom_title', 'post', 1);
    $theme = filter_text_input('theme', 'post', '', 1);
    $keywords = filter_text_input('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($keywords)) {
        $keywords = explode(",", $keywords);
        $keywords = array_map("trim", $keywords);
        $keywords = implode(", ", $keywords);
    }
    if ($mod != $global_config['site_home_module']) {
        $who_view = $nv_Request->get_int('who_view', 'post', 0);
示例#20
0
            $error = "error delete cat";
        } else {
            $description = nv_nl2br($description, '<br />');
            //
            $query = "UPDATE `" . NV_PREFIXLANG . "_" . $module_data . "_cat` SET `parentid`=" . $db->dbescape($parentid) . ", `title`=" . $db->dbescape($title) . ", `catimage` =  " . $db->dbescape($catimage) . ", `alias` =  " . $db->dbescape($alias) . ", `description`=" . $db->dbescape($description) . ", `keywords`= " . $db->dbescape($keywords) . ", `edit_time`=UNIX_TIMESTAMP( ) WHERE `catid` =" . $catid . "";
            $db->sql_query($query);
            if ($db->sql_affectedrows() > 0) {
                $db->sql_freeresult();
                if ($parentid != $parentid_old) {
                    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;
                    $sql = "UPDATE `" . NV_PREFIXLANG . "_" . $module_data . "_cat` SET `weight`=" . $weight . " WHERE `catid`=" . intval($catid);
                    $db->sql_query($sql);
                    nv_fix_cat($parentid);
                    nv_fix_cat($parentid_old);
                    nv_insert_logs(NV_LANG_DATA, $module_name, 'log_edit_cat', "catid " . $catid, $admin_info['userid']);
                }
                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'];
            }
            $db->sql_freeresult();
        }
    }
}
global $array_cat, $numcat;
$contents = "<div id=\"module_show_list\">";
$contents .= nv_show_cat_list($array_cat, $numcat);
$contents .= "</div><br>\n";
/**
 * @Project VIDEOS 4.x
 * @Author KENNYNGUYEN (nguyentiendat713@gmail.com)
 * @Website tradacongnghe.com
 * @License GNU/GPL version 2 or any later version
 * @Createdate Oct 08, 2015 10:47:41 AM
 */
if (!defined('NV_IS_FILE_ADMIN')) {
    die('Stop!!!');
}
$playlist_id = $nv_Request->get_int('playlist_id', 'post', 0);
$checkss = $nv_Request->get_string('checkss', 'post');
$contents = 'NO_' . $playlist_id;
list($playlist_id, $image) = $db->query('SELECT playlist_id, image FROM ' . NV_PREFIXLANG . '_' . $module_data . '_playlists WHERE playlist_id=' . intval($playlist_id))->fetch(3);
if ($playlist_id > 0) {
    nv_insert_logs(NV_LANG_DATA, $module_name, 'log_del_playlist', 'playlist_id ' . $playlist_id, $admin_info['userid']);
    $check_del_playlist_id = false;
    $query = $db->query('SELECT id, listcatid FROM ' . NV_PREFIXLANG . '_' . $module_data . '_rows WHERE playlist_id = ' . $playlist_id);
    $_rows = $query->fetchAll();
    $check_rows = sizeof($_rows);
    if ($check_rows > 0 and $checkss == md5($playlist_id . session_id() . $global_config['sitekey'])) {
        foreach ($_rows as $row) {
            $arr_catid = explode(',', $row['listcatid']);
            foreach ($arr_catid as $catid_i) {
                $db->query('UPDATE ' . NV_PREFIXLANG . '_' . $module_data . '_' . $catid_i . ' SET playlist_id = 0 WHERE id =' . $row['id']);
            }
            $db->query('UPDATE ' . NV_PREFIXLANG . '_' . $module_data . '_rows SET playlist_id = 0 WHERE id =' . $row['id']);
        }
        $check_del_playlist_id = true;
    } elseif ($check_rows > 0) {
        $contents = 'ERR_ROWS_' . $playlist_id . '_' . md5($playlist_id . session_id() . $global_config['sitekey']) . '_' . sprintf($lang_module['delplaylist_msg_rows'], $check_rows);
示例#22
0
/**
 * @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 12/30/2009 0:51
 */
if (!defined('NV_MAINFILE')) {
    die('Stop!!!');
}
$js = $nv_Request->get_int('js', 'get', 0);
if ($js) {
    nv_insert_logs(NV_LANG_DATA, 'login', '[' . $admin_info['username'] . '] ' . $lang_global['admin_logout_title'], ' Client IP:' . NV_CLIENT_IP, 0);
    $nv_Request->unset_request('admin,online', 'session');
    include NV_ROOTDIR . '/includes/header.php';
    die('1');
}
$ok = $nv_Request->get_int('ok', 'get', 0);
if ($ok) {
    nv_insert_logs(NV_LANG_DATA, 'login', '[' . $admin_info['username'] . '] ' . $lang_global['admin_logout_title'], ' Client IP:' . NV_CLIENT_IP, 0);
    $nv_Request->unset_request('admin,online', 'session');
    $info = $lang_global['admin_logout_ok'];
    $info .= '<meta http-equiv="Refresh" content="5;URL=' . $global_config['site_url'] . '" />';
} else {
    $url = $client_info['referer'] != '' ? $client_info['referer'] : (isset($_SERVER['SCRIPT_URI']) ? $_SERVER['SCRIPT_URI'] : '');
    $info = $lang_global['admin_logout_question'] . " ?<br /><br />\n";
    $info .= "<a href=\"" . NV_BASE_SITEURL . "index.php?second=admin_logout&amp;ok=1\">" . $lang_global['ok'] . "</a> | \n";
    $info .= "<a href=\"" . $url . "\">" . $lang_global['cancel'] . "</a>\n";
}
nv_info_die($global_config['site_description'], $lang_global['admin_logout_title'], $info);
示例#23
0
<?php

/**
 * @Project NUKEVIET 3.x
 * @Author VINADES.,JSC (contact@vinades.vn)
 * @Copyright (C) 2012 VINADES.,JSC. All rights reserved
 * @Createdate 2-1-2010 21:39
 */
if (!defined('NV_IS_FILE_SETTINGS')) {
    die('Stop!!!');
}
$id = $nv_Request->get_int('id', 'get', 0);
if (!empty($id)) {
    nv_insert_logs(NV_LANG_DATA, $module_name, 'log_cronjob_atc', "id  " . $id, $admin_info['userid']);
    $sql = "SELECT `act` FROM `" . NV_CRONJOBS_GLOBALTABLE . "` WHERE `id`=" . $id . " AND (`is_sys`=0 OR `act`=0)";
    $result = $db->sql_query($sql);
    if ($db->sql_numrows($result) == 1) {
        $row = $db->sql_fetchrow($result);
        $act = intval($row['act']);
        $new_act = !empty($act) ? 0 : 1;
        $sql = "UPDATE `" . NV_CRONJOBS_GLOBALTABLE . "` SET `act`=" . $new_act . " WHERE `id`=" . $id;
        $db->sql_query($sql);
    }
}
Header("Location: " . NV_BASE_ADMINURL . "index.php?" . NV_NAME_VARIABLE . "=" . $module_name . "&" . NV_OP_VARIABLE . "=cronjobs");
die;
示例#24
0
文件: stop.php 项目: lzhao18/nukeviet
                                ++$check_edit;
                            } elseif ($array_cat_admin[$admin_id][$catid_i]['pub_content'] == 1 and ($status == 0 or $status = 2)) {
                                ++$check_edit;
                            } elseif ($status == 0 and $post_id == $admin_id) {
                                ++$check_edit;
                            } elseif ($status == 2) {
                                ++$check_edit;
                            }
                        }
                    }
                }
                if ($check_edit == sizeof($arr_catid)) {
                    $check_permission = true;
                }
            }
            if ($check_permission > 0) {
                $db->query('UPDATE ' . NV_PREFIXLANG . '_' . $module_data . '_rows SET status = 0 WHERE id =' . $id);
                foreach ($arr_catid as $catid_i) {
                    $db->query('UPDATE ' . NV_PREFIXLANG . '_' . $module_data . '_' . $catid_i . ' SET status = 0 WHERE id =' . $id);
                }
                $exp_array[] = $id;
            }
        }
    }
    if (!empty($exp_array)) {
        nv_insert_logs(NV_LANG_DATA, $module_name, 'log_exp_content', 'listid: ' . implode(', ', $exp_array), $admin_info['userid']);
    }
    nv_set_status_module();
}
Header('Location: ' . NV_BASE_ADMINURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&' . NV_NAME_VARIABLE . '=' . $module_name);
die;
示例#25
0
            $sth->bindParam(':end_time', $data['end_time'], PDO::PARAM_INT);
            $sth->bindParam(':status', $data['status'], PDO::PARAM_INT);
            $sth->execute();
            if ($sth->rowCount()) {
                // Get next execute
                $sql = 'SELECT MIN(end_time) next_execute FROM ' . NV_PREFIXLANG . '_' . $module_data . '_rows WHERE end_time > 0 AND status = 1';
                $result = $db->query($sql);
                $next_execute = intval($result->fetchColumn());
                $sth = $db->prepare("UPDATE " . NV_CONFIG_GLOBALTABLE . " SET config_value = :config_value WHERE lang = '" . NV_LANG_DATA . "' AND module = :module_name AND config_name = 'next_execute'");
                $sth->bindParam(':module_name', $module_name, PDO::PARAM_STR);
                $sth->bindParam(':config_value', $next_execute, PDO::PARAM_STR);
                $sth->execute();
                if ($data['id']) {
                    nv_insert_logs(NV_LANG_DATA, $module_name, 'Edit Content', 'ID: ' . $data['id'], $admin_info['userid']);
                } else {
                    nv_insert_logs(NV_LANG_DATA, $module_name, 'Add Content', $data['title'], $admin_info['userid']);
                }
                nv_del_moduleCache('settings');
                nv_del_moduleCache($module_name);
                $message = $lang_module['save_success'];
            } else {
                $error[] = array('name' => '', 'value' => $lang_module['error_save']);
            }
        } catch (PDOException $e) {
            $error[] = array('name' => '', 'value' => $lang_module['error_save']);
        }
    }
    include NV_ROOTDIR . '/includes/header.php';
    echo json_encode(array('status' => empty($error) ? 'success' : 'error', 'message' => $message, 'error' => $error));
    include NV_ROOTDIR . '/includes/footer.php';
}
示例#26
0
文件: edit.php 项目: nukeplus/nuke
                            // Change comment
                            $sth = $db->prepare("UPDATE " . NV_PREFIXLANG . "_comment SET module= :mod_name WHERE module= :mod_old");
                            $sth->bindParam(':mod_name', $mod_name, PDO::PARAM_STR);
                            $sth->bindParam(':mod_old', $mod, PDO::PARAM_STR);
                            $sth->execute();
                            // Change logs
                            $sth = $db->prepare("UPDATE " . $db_config['prefix'] . "_logs SET module_name= :mod_name WHERE lang = '" . NV_LANG_DATA . "' AND module_name= :mod_old");
                            $sth->bindParam(':mod_name', $mod_name, PDO::PARAM_STR);
                            $sth->bindParam(':mod_old', $mod, PDO::PARAM_STR);
                            $sth->execute();
                        }
                    }
                }
            }
            $nv_Cache->delAll();
            nv_insert_logs(NV_LANG_DATA, $module_name, sprintf($lang_module['edit'], $mod), '', $admin_info['userid']);
            Header('Location: ' . NV_BASE_ADMINURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&' . NV_NAME_VARIABLE . '=' . $module_name);
            exit;
        } else {
            $data['error'] = sprintf($lang_module['edit_error_update_theme'], implode(', ', $data['error']));
        }
    } elseif ($groups_view != '') {
        $row['groups_view'] = $groups_view;
    }
} else {
    $custom_title = $row['custom_title'];
    $admin_title = $row['admin_title'];
    $theme = $row['theme'];
    $mobile = $row['mobile'];
    $act = $row['act'];
    $description = $row['description'];
示例#27
0
$my_footer .= "<script type=\"text/javascript\" src=\"" . NV_BASE_SITEURL . NV_ASSETS_DIR . "/js/language/jquery.ui.datepicker-" . NV_LANG_INTERFACE . ".js\"></script>\n";
$page_title = $lang_module['logs_title'];
$page = $nv_Request->get_int('page', 'get', 1);
$per_page = 30;
$data = array();
$array_userid = array();
$disabled = ' disabled="disabled"';
$base_url = NV_BASE_ADMINURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&' . NV_NAME_VARIABLE . '=' . $module_name . '&' . NV_OP_VARIABLE . '=' . $op;
// Search data
$data_search = array('q' => $lang_module['filter_enterkey'], 'from' => '', 'to' => '', 'lang' => '', 'module' => '', 'user' => '');
$array_where = array();
$check_like = false;
if ($nv_Request->isset_request('filter', 'get') and $nv_Request->isset_request('checksess', 'get')) {
    $checksess = $nv_Request->get_title('checksess', 'get', '');
    if ($checksess != md5('siteinfo_' . NV_CHECK_SESSION . '_' . $admin_info['userid'])) {
        nv_insert_logs(NV_LANG_DATA, $module_name, sprintf($lang_module['filter_check_log'], $op), $admin_info['username'] . ' - ' . $admin_info['userid'], 0);
        Header('Location: ' . NV_BASE_ADMINURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&' . NV_NAME_VARIABLE . '=' . $module_name . '&' . NV_OP_VARIABLE . '=' . $op);
        exit;
    }
    $data_search = array('q' => $nv_Request->get_title('q', 'get', ''), 'from' => $nv_Request->get_title('from', 'get', ''), 'to' => $nv_Request->get_title('to', 'get', ''), 'lang' => $nv_Request->get_title('lang', 'get', ''), 'module' => $nv_Request->get_title('module', 'get', ''), 'user' => $nv_Request->get_title('user', 'get', ''));
    $base_url .= '&amp;filter=1&amp;checksess=' . $checksess;
    $disabled = '';
    if (!empty($data_search['q']) and $data_search['q'] != $lang_module['filter_enterkey']) {
        $base_url .= '&amp;q=' . $data_search['q'];
        $array_where[] = "( name_key LIKE :keyword1 OR note_action LIKE :keyword2 )";
        $check_like = true;
    }
    if (!empty($data_search['from'])) {
        if (preg_match('/^([0-9]{1,2})\\.([0-9]{1,2})\\.([0-9]{4})$/', $data_search['from'], $match)) {
            $from = mktime(0, 0, 0, $match[2], $match[1], $match[3]);
            $array_where[] = 'log_time >= ' . $from;
示例#28
0
文件: cat.php 项目: nukeplus/shops
 $stmt->bindParam(':title_custom', $data['title_custom'], PDO::PARAM_STR);
 $stmt->bindParam(':image', $data['image'], PDO::PARAM_STR);
 $stmt->bindParam(':alias', $data['alias'], PDO::PARAM_STR);
 $stmt->bindParam(':description', $data['description'], PDO::PARAM_STR);
 $stmt->bindParam(':descriptionhtml', $data['descriptionhtml'], PDO::PARAM_STR);
 $stmt->bindParam(':keywords', $data['keywords'], PDO::PARAM_STR);
 $stmt->bindParam(':typeprice', $data['typeprice'], PDO::PARAM_INT);
 $stmt->bindParam(':form', $data['form'], PDO::PARAM_STR);
 $stmt->bindParam(':group_price', $data['group_price'], PDO::PARAM_STR);
 $stmt->bindParam(':viewdescriptionhtml', $data['viewdescriptionhtml'], PDO::PARAM_INT);
 $stmt->bindParam(':groups_view', $data['groups_view'], PDO::PARAM_STR);
 $stmt->bindParam(':cat_allow_point', $data['cat_allow_point'], PDO::PARAM_INT);
 $stmt->bindParam(':cat_number_point', $data['cat_number_point'], PDO::PARAM_INT);
 $stmt->bindParam(':cat_number_product', $data['cat_number_product'], PDO::PARAM_INT);
 if ($stmt->execute()) {
     nv_insert_logs(NV_LANG_DATA, $module_name, 'log_edit_catalog', 'id ' . $data['catid'], $admin_info['userid']);
     if ($data['parentid'] != $data['parentid_old']) {
         $w = 'SELECT max(weight) FROM ' . $table_name . ' WHERE parentid=' . $data['parentid'];
         $rw = $db->query($w);
         $weight = $rw->fetchColumn();
         $weight = intval($weight) + 1;
         $sql = 'UPDATE ' . $table_name . ' SET weight=' . $weight . ' WHERE catid=' . intval($data['catid']);
         $db->query($sql);
         nv_fix_cat_order();
     }
     //cập nhật các form dữ liệu tùy biến cho các subcat
     $_sql = 'SELECT catid FROM ' . $table_name . ' WHERE parentid=' . intval($data['catid']);
     $_query = $db->query($_sql);
     while ($row_catid = $_query->fetch()) {
         $db->query('UPDATE ' . $table_name . ' SET form=' . $db->quote($data['form']) . ' WHERE catid=' . intval($row_catid['catid']));
     }
示例#29
0
            } else {
                unset($m);
                preg_match("/^([0-9]{1,2})\\.([0-9]{1,2})\\.([0-9]{4})\$/", $exp_date, $m);
                $exptime = mktime(23, 59, 59, $m[2], $m[1], $m[3]);
            }
            if ($exptime != 0 and $exptime <= $publtime) {
                $exptime = $publtime;
            }
            list($pid_old) = $db->sql_fetchrow($db->sql_query("SELECT `pid` FROM `" . NV_BANNERS_ROWS_GLOBALTABLE . "` WHERE `id`=" . intval($id) . ""));
            $sql = "UPDATE `" . NV_BANNERS_ROWS_GLOBALTABLE . "` SET `title`=" . $db->dbescape($title) . ", `pid`=" . $pid . ", `clid`=" . $clid . ", \n            `file_name`=" . $db->dbescape($file_name) . ", `file_ext`=" . $db->dbescape($file_ext) . ", `file_mime`=" . $db->dbescape($file_mime) . ", \n            `width`=" . $width . ", `height`=" . $height . ", `file_alt`=" . $db->dbescape($file_alt) . ", `click_url`=" . $db->dbescape($click_url) . ", \n            `publ_time`=" . $publtime . ", `exp_time`=" . $exptime . " WHERE `id`=" . $id;
            $db->sql_query($sql);
            if ($pid_old != $pid) {
                nv_fix_banner_weight($pid);
                nv_fix_banner_weight($pid_old);
            }
            nv_insert_logs(NV_LANG_DATA, $module_name, 'log_edit_banner', "bannerid " . $id, $admin_info['userid']);
            nv_CreateXML_bannerPlan();
            Header("Location: " . NV_BASE_ADMINURL . "index.php?" . NV_NAME_VARIABLE . "=" . $module_name . "&" . NV_OP_VARIABLE . "=info_banner&id=" . $id);
            die;
        }
    }
} else {
    $title = $row['title'];
    $pid = $row['pid'];
    $clid = $row['clid'];
    $file_alt = $row['file_alt'];
    $click_url = $row['click_url'];
    $publ_date = !empty($row['publ_time']) ? date("d.m.Y", $row['publ_time']) : "";
    $exp_date = !empty($row['exp_time']) ? date("d.m.Y", $row['exp_time']) : "";
}
if ($click_url == "") {
示例#30
0
<?php

/**
 * @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_DATABASE')) {
    die('Stop!!!');
}
$filename = $nv_Request->get_title('filename', 'get', '');
$checkss = $nv_Request->get_title('checkss', 'get', '');
$log_dir = NV_LOGS_DIR . '/dump_backup';
if ($global_config['idsite']) {
    $log_dir .= '/' . $global_config['site_dir'];
}
$path_filename = NV_BASE_SITEURL . $log_dir . '/' . $filename;
if (nv_is_file($path_filename, $log_dir) === true and $checkss == md5($filename . NV_CHECK_SESSION)) {
    $temp = explode('_', $filename);
    nv_insert_logs(NV_LANG_DATA, $module_name, $lang_global['delete'] . ' ' . $lang_module['file_backup'], 'File name: ' . end($temp), $admin_info['userid']);
    nv_deletefile(NV_DOCUMENT_ROOT . $path_filename);
    Header('Location: ' . NV_BASE_ADMINURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&' . NV_NAME_VARIABLE . '=' . $module_name . '&' . NV_OP_VARIABLE . '=file&rand=' . nv_genpass());
    exit;
} else {
    $contents = 'File not exist !';
    include NV_ROOTDIR . '/includes/header.php';
    echo nv_admin_theme($contents);
    include NV_ROOTDIR . '/includes/footer.php';
}