예제 #1
0
    }
    nv_save_file_config_global();
    Header('Location: ' . NV_BASE_ADMINURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&' . NV_NAME_VARIABLE . '=' . $module_name . '&' . NV_OP_VARIABLE . '=' . $op . '&rand=' . nv_genpass());
    die;
}
$page_title = $lang_module['uploadconfig'];
$xtpl = new XTemplate('uploadconfig.tpl', NV_ROOTDIR . '/themes/' . $global_config['module_theme'] . '/modules/' . $module_file);
$xtpl->assign('NV_BASE_ADMINURL', NV_BASE_ADMINURL);
$xtpl->assign('NV_NAME_VARIABLE', NV_NAME_VARIABLE);
$xtpl->assign('MODULE_NAME', $module_name);
$xtpl->assign('NV_OP_VARIABLE', NV_OP_VARIABLE);
$xtpl->assign('OP', $op);
$xtpl->assign('LANG', $lang_module);
$xtpl->assign('NV_MAX_WIDTH', NV_MAX_WIDTH);
$xtpl->assign('NV_MAX_HEIGHT', NV_MAX_HEIGHT);
$sys_max_size = min(nv_converttoBytes(ini_get('upload_max_filesize')), nv_converttoBytes(ini_get('post_max_size')));
$p_size = $sys_max_size / 100;
$xtpl->assign('SYS_MAX_SIZE', nv_convertfromBytes($sys_max_size));
$xtpl->assign('NV_AUTO_RESIZE', $global_config['nv_auto_resize'] ? ' checked="checked"' : '');
$xtpl->assign('UPLOAD_ALT_REQUIRE', $global_config['upload_alt_require'] ? ' checked="checked"' : '');
$xtpl->assign('UPLOAD_AUTO_ALT', $global_config['upload_auto_alt'] ? ' checked="checked"' : '');
for ($index = 100; $index > 0; --$index) {
    $size = floor($index * $p_size);
    $xtpl->assign('SIZE', array('key' => $size, 'title' => nv_convertfromBytes($size), 'selected' => $size == $global_config['nv_max_size'] ? ' selected="selected"' : ''));
    $xtpl->parse('main.size');
}
$_upload_checking_mode = array('strong' => $lang_module['strong_mode'], 'mild' => $lang_module['mild_mode'], 'lite' => $lang_module['lite_mode'], 'none' => $lang_module['none_mode']);
foreach ($_upload_checking_mode as $m => $n) {
    $xtpl->assign('UPLOAD_CHECKING_MODE', array('key' => $m, 'title' => $n, 'selected' => $m == $global_config['upload_checking_mode'] ? ' selected="selected"' : ''));
    $xtpl->parse('main.upload_checking_mode');
}
예제 #2
0
//vd: 80
define('NV_MY_DOMAIN', $nv_Request->my_current_domain);
//vd: http://mydomain1.com:80
define('NV_HEADERSTATUS', $nv_Request->headerstatus);
//vd: HTTP/1.0
define('NV_USER_AGENT', $nv_Request->user_agent);
//HTTP_USER_AGENT
define("NV_BASE_SITEURL", $nv_Request->base_siteurl . '/');
//vd: /ten_thu_muc_chua_site/
define("NV_BASE_ADMINURL", $nv_Request->base_adminurl . '/');
//vd: /ten_thu_muc_chua_site/admin/
define('NV_DOCUMENT_ROOT', $nv_Request->doc_root);
// D:/AppServ/www
define('NV_EOL', strtoupper(substr(PHP_OS, 0, 3) == 'WIN') ? "\r\n" : (strtoupper(substr(PHP_OS, 0, 3) == 'MAC') ? "\r" : "\n"));
//Ngat dong
define('NV_UPLOAD_MAX_FILESIZE', min(nv_converttoBytes(ini_get('upload_max_filesize')), nv_converttoBytes(ini_get('post_max_size')), $global_config['nv_max_size']));
define('NV_UPLOADS_REAL_DIR', NV_ROOTDIR . '/' . NV_UPLOADS_DIR);
//Xac dinh duong dan thuc den thu muc upload
define('NV_CACHE_PREFIX', md5($global_config['sitekey'] . NV_BASE_SITEURL));
//Hau to cua file cache
if (preg_match("/^[0-9]{10,}\$/", $nv_Request->get_string('nocache', 'get', '')) and $client_info['is_myreferer'] === 1) {
    define('NV_IS_AJAX', true);
}
//Chan truy cap neu HTTP_USER_AGENT == 'none'
if (NV_USER_AGENT == "none") {
    trigger_error('We\'re sorry. The software you are using to access our website is not allowed. Some examples of this are e-mail harvesting programs and programs that will  copy websites to your hard drive. If you feel you have gotten this message  in error, please send an e-mail addressed to admin. Your I.P. address has been logged. Thanks.', 256);
}
//xac dinh co phai User_Agent cua NukeViet hay khong
if (NV_USER_AGENT == 'NUKEVIET CMS ' . $global_config['version'] . '. Developed by VINADES. Url: http://nukeviet.vn. Code: ' . md5($global_config['sitekey'])) {
    define('NV_IS_MY_USER_AGENT', true);
}
예제 #3
0
/**
 * nv_save_file_config_global()
 *
 * @return
 */
function nv_save_file_config_global()
{
    global $db, $sys_info, $global_config, $db_config;
    if ($global_config['idsite']) {
        return false;
    }
    $content_config = "<?php" . "\n\n";
    $content_config .= NV_FILEHEAD . "\n\n";
    $content_config .= "if ( ! defined( 'NV_MAINFILE' ) ) die( 'Stop!!!' );\n\n";
    //disable_classes
    $sys_info['disable_classes'] = (($disable_classes = ini_get('disable_classes')) != '' and $disable_classes != false) ? array_map('trim', preg_split("/[\\s,]+/", $disable_classes)) : array();
    if (!empty($sys_info['disable_classes'])) {
        $disable_classes = "'" . implode("','", $sys_info['disable_classes']) . "'";
    } else {
        $disable_classes = '';
    }
    $content_config .= "\$sys_info['disable_classes']=array(" . $disable_classes . ");\n";
    //disable_functions
    $sys_info['disable_functions'] = (($disable_functions = ini_get('disable_functions')) != '' and $disable_functions != false) ? array_map('trim', preg_split("/[\\s,]+/", $disable_functions)) : array();
    if (extension_loaded('suhosin')) {
        $sys_info['disable_functions'] = array_merge($sys_info['disable_functions'], array_map('trim', preg_split("/[\\s,]+/", ini_get('suhosin.executor.func.blacklist'))));
    }
    if (!empty($sys_info['disable_functions'])) {
        $disable_functions = "'" . implode("','", $sys_info['disable_functions']) . "'";
    } else {
        $disable_functions = '';
    }
    $content_config .= "\$sys_info['disable_functions']=array(" . $disable_functions . ");\n";
    //ini_set_support
    $sys_info['ini_set_support'] = (function_exists('ini_set') and !in_array('ini_set', $sys_info['disable_functions'])) ? true : false;
    $ini_set_support = $sys_info['ini_set_support'] ? 'true' : 'false';
    $content_config .= "\$sys_info['ini_set_support']= " . $ini_set_support . ";\n";
    //Kiem tra ho tro rewrite
    if (function_exists('apache_get_modules')) {
        $apache_modules = apache_get_modules();
        if (in_array('mod_rewrite', $apache_modules)) {
            $sys_info['supports_rewrite'] = 'rewrite_mode_apache';
        } else {
            $sys_info['supports_rewrite'] = false;
        }
    } elseif (strpos($_SERVER['SERVER_SOFTWARE'], 'Microsoft-IIS/7.') !== false) {
        if (isset($_SERVER['IIS_UrlRewriteModule']) and class_exists('DOMDocument')) {
            $sys_info['supports_rewrite'] = 'rewrite_mode_iis';
        } else {
            $sys_info['supports_rewrite'] = false;
        }
    }
    if ($sys_info['supports_rewrite'] == 'rewrite_mode_iis' or $sys_info['supports_rewrite'] == 'rewrite_mode_apache') {
        $content_config .= "\$sys_info['supports_rewrite']='" . $sys_info['supports_rewrite'] . "';\n";
    } else {
        $content_config .= "\$sys_info['supports_rewrite']=false;\n";
    }
    $content_config .= "\n";
    $config_variable = array();
    $allowed_html_tags = '';
    $sql = "SELECT module, config_name, config_value FROM " . NV_CONFIG_GLOBALTABLE . " WHERE lang='sys' AND (module='global' OR module='define') ORDER BY config_name ASC";
    $result = $db->query($sql);
    while (list($c_module, $c_config_name, $c_config_value) = $result->fetch(3)) {
        if ($c_module == 'define') {
            if (preg_match('/^\\d+$/', $c_config_value)) {
                $content_config .= "define('" . strtoupper($c_config_name) . "', " . $c_config_value . ");\n";
            } else {
                $content_config .= "define('" . strtoupper($c_config_name) . "', '" . $c_config_value . "');\n";
            }
            if ($c_config_name == 'nv_allowed_html_tags') {
                $allowed_html_tags = $c_config_value;
            }
        } else {
            $config_variable[$c_config_name] = $c_config_value;
        }
    }
    $nv_eol = strtoupper(substr(PHP_OS, 0, 3) == 'WIN') ? '"\\r\\n"' : (strtoupper(substr(PHP_OS, 0, 3) == 'MAC') ? '"\\r"' : '"\\n"');
    $upload_max_filesize = min(nv_converttoBytes(ini_get('upload_max_filesize')), nv_converttoBytes(ini_get('post_max_size')), $config_variable['nv_max_size']);
    $content_config .= "define('NV_EOL', " . $nv_eol . ");\n";
    $content_config .= "define('NV_UPLOAD_MAX_FILESIZE', " . floatval($upload_max_filesize) . ");\n";
    if ($config_variable['openid_mode']) {
        $content_config .= "define('NV_OPENID_ALLOWED', true);\n\n";
    }
    $my_domains = array_map('trim', explode(',', $config_variable['my_domains']));
    $my_domains[] = NV_SERVER_NAME;
    $config_variable['my_domains'] = implode(',', array_unique($my_domains));
    $config_variable['check_rewrite_file'] = nv_check_rewrite_file();
    $config_variable['allow_request_mods'] = NV_ALLOW_REQUEST_MODS != '' ? NV_ALLOW_REQUEST_MODS : "request";
    $config_variable['request_default_mode'] = NV_REQUEST_DEFAULT_MODE != '' ? trim(NV_REQUEST_DEFAULT_MODE) : 'request';
    $config_variable['session_save_path'] = NV_SESSION_SAVE_PATH;
    $config_variable['log_errors_list'] = NV_LOG_ERRORS_LIST;
    $config_variable['display_errors_list'] = NV_DISPLAY_ERRORS_LIST;
    $config_variable['send_errors_list'] = NV_SEND_ERRORS_LIST;
    $config_variable['error_log_path'] = NV_LOGS_DIR . '/error_logs';
    $config_variable['error_log_filename'] = NV_ERRORLOGS_FILENAME;
    $config_variable['error_log_fileext'] = NV_LOGS_EXT;
    $config_variable['error_send_email'] = $config_variable['error_send_email'];
    $config_name_array = array('file_allowed_ext', 'forbid_extensions', 'forbid_mimes', 'allow_sitelangs', 'openid_servers', 'allow_request_mods', 'config_sso');
    if (empty($config_variable['openid_servers'])) {
        $config_variable['openid_mode'] = 0;
    }
    if ($config_variable['is_user_forum']) {
        $forum_files = @scandir(NV_ROOTDIR . '/' . DIR_FORUM . '/nukeviet');
        if (!empty($forum_files) and in_array('is_user.php', $forum_files) and in_array('changepass.php', $forum_files) and in_array('editinfo.php', $forum_files) and in_array('login.php', $forum_files) and in_array('logout.php', $forum_files) and in_array('lostpass.php', $forum_files) and in_array('register.php', $forum_files)) {
            $content_config .= "define( 'NV_IS_USER_FORUM', true );\n\n";
        } else {
            $config_variable['is_user_forum'] = 0;
        }
    }
    foreach ($config_variable as $c_config_name => $c_config_value) {
        if ($c_config_name == 'config_sso') {
            $config_sso = empty($c_config_value) ? '' : nv_var_export(unserialize($c_config_value));
            $content_config .= "\$global_config['" . $c_config_name . "']=" . $config_sso . ";\n";
        } elseif (in_array($c_config_name, $config_name_array)) {
            if (!empty($c_config_value)) {
                $c_config_value = "'" . implode("','", array_map("trim", explode(',', $c_config_value))) . "'";
            } else {
                $c_config_value = '';
            }
            $content_config .= "\$global_config['" . $c_config_name . "']=array(" . $c_config_value . ");\n";
        } else {
            if (preg_match('/^\\d+$/', $c_config_value) and $c_config_name != 'facebook_client_id') {
                $content_config .= "\$global_config['" . $c_config_name . "']=" . $c_config_value . ";\n";
            } else {
                $c_config_value = nv_unhtmlspecialchars($c_config_value);
                if (!preg_match("/^[a-z0-9\\-\\_\\.\\,\\;\\:\\@\\/\\s]+\$/i", $c_config_value) and $c_config_name != 'my_domains') {
                    $c_config_value = nv_htmlspecialchars($c_config_value);
                }
                $content_config .= "\$global_config['" . $c_config_name . "']='" . $c_config_value . "';\n";
            }
        }
    }
    $content_config .= "\$global_config['array_theme_type']=" . nv_var_export(array_filter(array_map('trim', explode(',', NV_THEME_TYPE)))) . ";\n";
    //allowed_html_tags
    if (!empty($allowed_html_tags)) {
        $allowed_html_tags = "'" . implode("','", array_map('trim', explode(',', $allowed_html_tags))) . "'";
    } else {
        $allowed_html_tags = '';
    }
    $content_config .= "\$global_config['allowed_html_tags']=array(" . $allowed_html_tags . ");\n";
    //Xac dinh cac search_engine
    $engine_allowed = file_exists(NV_ROOTDIR . '/' . NV_DATADIR . '/search_engine.xml') ? nv_object2array(simplexml_load_file(NV_ROOTDIR . '/' . NV_DATADIR . '/search_engine.xml')) : array();
    $content_config .= "\$global_config['engine_allowed']=" . nv_var_export($engine_allowed) . ";\n";
    $content_config .= "\n";
    $language_array = nv_parse_ini_file(NV_ROOTDIR . '/includes/ini/langs.ini', true);
    $tmp_array = array();
    $lang_array_exit = nv_scandir(NV_ROOTDIR . "/language", "/^[a-z]{2}+\$/");
    foreach ($lang_array_exit as $lang) {
        $tmp_array[$lang] = $language_array[$lang];
    }
    unset($language_array);
    $content_config .= "\$language_array=" . nv_var_export($tmp_array) . ";\n";
    $tmp_array = nv_parse_ini_file(NV_ROOTDIR . '/includes/ini/br.ini', true);
    $content_config .= "\$nv_parse_ini_browsers=" . nv_var_export($tmp_array) . ";\n";
    $tmp_array = nv_parse_ini_file(NV_ROOTDIR . '/includes/ini/mobile.ini', true);
    $content_config .= "\$nv_parse_ini_mobile=" . nv_var_export($tmp_array) . ";\n";
    $tmp_array = nv_parse_ini_file(NV_ROOTDIR . '/includes/ini/os.ini', true);
    $content_config .= "\$nv_parse_ini_os=" . nv_var_export($tmp_array) . ";\n";
    $tmp_array = nv_parse_ini_file(NV_ROOTDIR . '/includes/ini/timezone.ini', true);
    $content_config .= "\$nv_parse_ini_timezone=" . nv_var_export($tmp_array) . ";\n";
    $rewrite = array();
    $global_config['rewrite_optional'] = $config_variable['rewrite_optional'];
    $global_config['rewrite_op_mod'] = $config_variable['rewrite_op_mod'];
    $global_config['rewrite_endurl'] = $config_variable['rewrite_endurl'];
    $global_config['rewrite_exturl'] = $config_variable['rewrite_exturl'];
    if ($config_variable['check_rewrite_file']) {
        require NV_ROOTDIR . '/includes/rewrite.php';
    } else {
        require NV_ROOTDIR . '/includes/rewrite_index.php';
    }
    $content_config .= "\n";
    $nv_plugin_area = array();
    $_sql = 'SELECT * FROM ' . $db_config['prefix'] . '_plugin ORDER BY plugin_area ASC, weight ASC';
    $_query = $db->query($_sql);
    while ($row = $_query->fetch()) {
        $nv_plugin_area[$row['plugin_area']][] = $row['plugin_file'];
    }
    $content_config .= "\$nv_plugin_area=" . nv_var_export($nv_plugin_area) . ";\n\n";
    $content_config .= "\$rewrite_keys=" . nv_var_export(array_keys($rewrite)) . ";\n";
    $content_config .= "\$rewrite_values=" . nv_var_export(array_values($rewrite)) . ";\n";
    $return = file_put_contents(NV_ROOTDIR . "/" . NV_DATADIR . "/config_global.php", trim($content_config), LOCK_EX);
    nv_delete_all_cache();
    return $return;
}
예제 #4
0
$sql_drop_module[] = "DROP TABLE IF EXISTS " . $db_config['prefix'] . "_" . $lang . "_" . $module_data . "_categories";
$sql_drop_module[] = "DROP TABLE IF EXISTS " . $db_config['prefix'] . "_" . $lang . "_" . $module_data . "_config";
$sql_drop_module[] = "DROP TABLE IF EXISTS " . $db_config['prefix'] . "_" . $lang . "_" . $module_data . "_report";
$sql_drop_module[] = "DROP TABLE IF EXISTS " . $db_config['prefix'] . "_" . $lang . "_" . $module_data . "_tmp";
$sql_drop_module[] = "DROP TABLE IF EXISTS " . $db_config['prefix'] . "_" . $lang . "_" . $module_data . "_tags";
$sql_drop_module[] = "DROP TABLE IF EXISTS " . $db_config['prefix'] . "_" . $lang . "_" . $module_data . "_tags_id";
$result = $db->query("SHOW TABLE STATUS LIKE '" . $db_config['prefix'] . "\\_" . $lang . "\\_comment'");
$rows = $result->fetchAll();
if (sizeof($rows)) {
    $sql_drop_module[] = "DELETE FROM " . $db_config['prefix'] . "_" . $lang . "_comment WHERE module='" . $module_name . "'";
}
$sql_create_module = $sql_drop_module;
$sql_create_module[] = "CREATE TABLE IF NOT EXISTS " . $db_config['prefix'] . "_" . $lang . "_" . $module_data . " (\n id mediumint(8) unsigned NOT NULL AUTO_INCREMENT,\n catid smallint(5) unsigned NOT NULL,\n title varchar(250) NOT NULL,\n alias varchar(250) NOT NULL,\n description mediumtext NOT NULL,\n introtext text NOT NULL,\n uploadtime int(11) unsigned NOT NULL,\n updatetime int(11) unsigned NOT NULL DEFAULT '0',\n user_id mediumint(8) unsigned NOT NULL,\n user_name varchar(100) NOT NULL,\n author_name varchar(100) NOT NULL,\n author_email varchar(60) NOT NULL,\n author_url varchar(255) NOT NULL,\n fileupload text NOT NULL,\n linkdirect text NOT NULL,\n version varchar(20) NOT NULL,\n filesize int(11) NOT NULL DEFAULT '0',\n fileimage varchar(255) NOT NULL,\n status tinyint(1) unsigned NOT NULL DEFAULT '0',\n copyright varchar(255) NOT NULL,\n view_hits int(11) NOT NULL DEFAULT '0',\n download_hits int(11) NOT NULL DEFAULT '0',\n groups_comment varchar(255) NOT NULL,\n groups_view varchar(255) NOT NULL,\n groups_download varchar(255) NOT NULL,\n comment_hits int(11) NOT NULL DEFAULT '0',\n rating_detail varchar(255) NOT NULL,\n PRIMARY KEY (id),\n UNIQUE KEY alias (alias),\n KEY catid (catid),\n KEY user_id (user_id)\n)ENGINE=MyISAM";
$sql_create_module[] = "CREATE TABLE " . $db_config['prefix'] . "_" . $lang . "_" . $module_data . "_tmp (\n id mediumint(8) unsigned NOT NULL AUTO_INCREMENT,\n catid int(10) unsigned NOT NULL DEFAULT '0',\n title varchar(250) NOT NULL,\n description mediumtext NOT NULL,\n introtext text NOT NULL,\n uploadtime int(11) unsigned NOT NULL DEFAULT '0',\n user_id mediumint(8) unsigned NOT NULL DEFAULT '0',\n user_name varchar(100) NOT NULL,\n author_name varchar(100) NOT NULL,\n author_email varchar(60) NOT NULL,\n author_url varchar(255) NOT NULL,\n fileupload text NOT NULL,\n linkdirect text NOT NULL,\n version varchar(20) NOT NULL,\n filesize varchar(255) NOT NULL,\n fileimage varchar(255) NOT NULL,\n copyright varchar(255) NOT NULL,\n PRIMARY KEY (id),\n UNIQUE KEY title (title),\n KEY catid (catid)\n)ENGINE=MyISAM";
$sql_create_module[] = "CREATE TABLE IF NOT EXISTS " . $db_config['prefix'] . "_" . $lang . "_" . $module_data . "_categories (\n id smallint(5) unsigned NOT NULL AUTO_INCREMENT,\n parentid smallint(5) unsigned NOT NULL,\n title varchar(250) NOT NULL,\n alias varchar(250) NOT NULL,\n description text,\n groups_view varchar(255) DEFAULT '',\n groups_download varchar(255) DEFAULT '',\n numsubcat smallint(5) NOT NULL DEFAULT '0',\n subcatid varchar(255) NOT NULL DEFAULT '',\n viewcat varchar(100) DEFAULT 'viewcat_list_new',\n numlink smallint(4) DEFAULT '3',\n sort smallint(5) NOT NULL DEFAULT '0',\n lev smallint(5) NOT NULL DEFAULT '0',\n weight smallint(4) unsigned NOT NULL DEFAULT '0',\n status tinyint(1) unsigned NOT NULL DEFAULT '0',\n PRIMARY KEY (id),\n UNIQUE KEY alias (alias)\n)ENGINE=MyISAM";
$sql_create_module[] = "CREATE TABLE " . $db_config['prefix'] . "_" . $lang . "_" . $module_data . "_report (\n fid mediumint(8) unsigned NOT NULL DEFAULT '0',\n post_ip varchar(45) NOT NULL,\n post_time int(11) unsigned NOT NULL DEFAULT '0',\n UNIQUE KEY fid (fid),\n KEY post_time (post_time)\n)ENGINE=MyISAM";
$sql_create_module[] = "CREATE TABLE " . $db_config['prefix'] . "_" . $lang . "_" . $module_data . "_config (\n config_name varchar(30) NOT NULL,\n config_value varchar(255) NOT NULL,\n UNIQUE KEY config_name (config_name)\n)ENGINE=MyISAM";
$sql_create_module[] = "CREATE TABLE " . $db_config['prefix'] . "_" . $lang . "_" . $module_data . "_tags (\n did mediumint(8) unsigned NOT NULL AUTO_INCREMENT,\n numdownload mediumint(8) NOT NULL DEFAULT '0',\n alias varchar(255) NOT NULL,\n image varchar(255),\n description text,\n keywords varchar(255),\n PRIMARY KEY (did)\n)ENGINE=MyISAM";
$sql_create_module[] = "CREATE TABLE " . $db_config['prefix'] . "_" . $lang . "_" . $module_data . "_tags_id (\n  id int(11) NOT NULL,\n  did mediumint(9) NOT NULL,\n  keyword varchar(65) NOT NULL\n  UNIQUE KEY id_tid (id,did),\n  KEY did (did)\n)ENGINE=MyISAM";
$maxfilesize = min($global_config['nv_max_size'], nv_converttoBytes(ini_get('upload_max_filesize')), nv_converttoBytes(ini_get('post_max_size')));
$sql_create_module[] = "INSERT INTO " . $db_config['prefix'] . "_" . $lang . "_" . $module_data . "_config VALUES\n('indexfile', 'viewcat_main_bottom'),\n('viewlist_type', 'list'),\n('per_page_home', '20'),\n('per_page_child', '20'),\n('is_addfile', '1'),\n('groups_upload', '4'),\n('maxfilesize', '" . $maxfilesize . "'),\n('upload_filetype', 'adobe,archives,audio,documents,flash,images,real,video'),\n('groups_addfile', '4'),\n('tags_alias', '0'),\n('is_zip', '0'),\n('is_resume', '1'),\n('max_speed', '0')";
// Comments
$sql_create_module[] = "INSERT INTO " . NV_CONFIG_GLOBALTABLE . " (lang, module, config_name, config_value) VALUES ('" . $lang . "', '" . $module_name . "', 'auto_postcomm', '1')";
$sql_create_module[] = "INSERT INTO " . NV_CONFIG_GLOBALTABLE . " (lang, module, config_name, config_value) VALUES ('" . $lang . "', '" . $module_name . "', 'allowed_comm', '-1')";
$sql_create_module[] = "INSERT INTO " . NV_CONFIG_GLOBALTABLE . " (lang, module, config_name, config_value) VALUES ('" . $lang . "', '" . $module_name . "', 'view_comm', '6')";
$sql_create_module[] = "INSERT INTO " . NV_CONFIG_GLOBALTABLE . " (lang, module, config_name, config_value) VALUES ('" . $lang . "', '" . $module_name . "', 'setcomm', '4')";
$sql_create_module[] = "INSERT INTO " . NV_CONFIG_GLOBALTABLE . " (lang, module, config_name, config_value) VALUES ('" . $lang . "', '" . $module_name . "', 'activecomm', '1')";
$sql_create_module[] = "INSERT INTO " . NV_CONFIG_GLOBALTABLE . " (lang, module, config_name, config_value) VALUES ('" . $lang . "', '" . $module_name . "', 'emailcomm', '0')";
$sql_create_module[] = "INSERT INTO " . NV_CONFIG_GLOBALTABLE . " (lang, module, config_name, config_value) VALUES ('" . $lang . "', '" . $module_name . "', 'adminscomm', '')";
$sql_create_module[] = "INSERT INTO " . NV_CONFIG_GLOBALTABLE . " (lang, module, config_name, config_value) VALUES ('" . $lang . "', '" . $module_name . "', 'sortcomm', '0')";
$sql_create_module[] = "INSERT INTO " . NV_CONFIG_GLOBALTABLE . " (lang, module, config_name, config_value) VALUES ('" . $lang . "', '" . $module_name . "', 'captcha', '1')";
예제 #5
0
파일: data.php 프로젝트: atarubi/nuke-viet
define('NV_SESSIONS_GLOBALTABLE', $db_config['prefix'] . '_sessions');
define('NV_CRONJOBS_GLOBALTABLE', $db_config['prefix'] . '_cronjobs');
$sql_create_table[] = "CREATE TABLE `" . NV_AUTHORS_GLOBALTABLE . "` (\n  `admin_id` mediumint(8) unsigned NOT NULL,\n  `editor` varchar(100) NOT NULL,\n  `lev` tinyint(1) unsigned NOT NULL DEFAULT '0',\n  `files_level` varchar(255) NOT NULL,\n  `position` varchar(255) NOT NULL,\n  `addtime` int(11) NOT NULL DEFAULT '0',\n  `edittime` int(11) NOT NULL DEFAULT '0',\n  `is_suspend` tinyint(1) unsigned NOT NULL DEFAULT '0',\n  `susp_reason` mediumtext NOT NULL,\n  `check_num` varchar(40) NOT NULL,\n  `last_login` int(11) unsigned NOT NULL DEFAULT '0',\n  `last_ip` varchar(45) NOT NULL,\n  `last_agent` varchar(255) NOT NULL,\n  PRIMARY KEY (`admin_id`)\n) ENGINE=MyISAM";
$sql_create_table[] = "CREATE TABLE `" . NV_AUTHORS_GLOBALTABLE . "_config` (\n  `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,\n  `keyname` varchar(32) DEFAULT NULL,\n  `mask` tinyint(4) NOT NULL DEFAULT '0',\n  `begintime` int(11) DEFAULT NULL,\n  `endtime` int(11) DEFAULT NULL,\n  `notice` varchar(255) NOT NULL,\n  PRIMARY KEY (`id`),\n  UNIQUE KEY `keyname` (`keyname`)\n) ENGINE=MyISAM";
$sql_create_table[] = "CREATE TABLE `" . NV_USERS_GLOBALTABLE . "_config` (\n  `config` varchar(100) NOT NULL,\n  `content` mediumtext NOT NULL,\n  `edit_time` int(11) unsigned NOT NULL DEFAULT '0',\n  PRIMARY KEY (`config`)\n) ENGINE=MyISAM";
$sql_create_table[] = "CREATE TABLE `" . NV_USERS_GLOBALTABLE . "_question` (\n  `qid` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,\n  `title` varchar(255) NOT NULL DEFAULT '',\n  `lang` char(2) NOT NULL DEFAULT '',\n  `weight` mediumint(8) unsigned NOT NULL DEFAULT '0',\n  `add_time` int(11) unsigned NOT NULL DEFAULT '0',\n  `edit_time` int(11) unsigned NOT NULL DEFAULT '0',\n  PRIMARY KEY (`qid`),\n  UNIQUE KEY `title` (`title`,`lang`)\n) ENGINE=MyISAM";
$sql_create_table[] = "CREATE TABLE `" . NV_USERS_GLOBALTABLE . "` (\n  `userid` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,\n  `username` varchar(100) NOT NULL DEFAULT '',\n  `md5username` char(32) NOT NULL DEFAULT '',\n  `password` varchar(50) NOT NULL DEFAULT '',\n  `email` varchar(100) NOT NULL DEFAULT '',\n  `full_name` varchar(255) NOT NULL DEFAULT '',\n  `gender` char(1) NOT NULL,\n  `photo` varchar(255) NOT NULL DEFAULT '',\n  `birthday` int(11) NOT NULL,\n  `sig` text,\n  `regdate` int(11) NOT NULL DEFAULT '0',\n  `website` varchar(255) NOT NULL DEFAULT '',\n  `location` varchar(255) NOT NULL,\n  `yim` varchar(100) NOT NULL DEFAULT '',\n  `telephone` varchar(100) NOT NULL DEFAULT '',\n  `fax` varchar(100) NOT NULL DEFAULT '',\n  `mobile` varchar(100) NOT NULL DEFAULT '',\n  `question` varchar(255) NOT NULL,\n  `answer` varchar(255) NOT NULL DEFAULT '',\n  `passlostkey` varchar(40) NOT NULL DEFAULT '',\n  `view_mail` tinyint(1) unsigned NOT NULL DEFAULT '0',\n  `remember` tinyint(1) unsigned NOT NULL DEFAULT '0',\n  `in_groups` varchar(255) NOT NULL DEFAULT '',\n  `active` tinyint(1) unsigned NOT NULL DEFAULT '0',\n  `checknum` varchar(40) NOT NULL DEFAULT '',\n  `last_login` int(11) unsigned NOT NULL DEFAULT '0',\n  `last_ip` varchar(45) NOT NULL DEFAULT '',\n  `last_agent` varchar(255) NOT NULL DEFAULT '',\n  `last_openid` varchar(255) NOT NULL DEFAULT '',\n  PRIMARY KEY (`userid`),\n  UNIQUE KEY `username` (`username`),\n  UNIQUE KEY `md5username` (`md5username`),\n  UNIQUE KEY `email` (`email`)\n) ENGINE=MyISAM";
$sql_create_table[] = "CREATE TABLE `" . NV_USERS_GLOBALTABLE . "_reg` (\n  `userid` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,\n  `username` varchar(100) NOT NULL DEFAULT '',\n  `md5username` char(32) NOT NULL DEFAULT '',\n  `password` varchar(50) NOT NULL DEFAULT '',\n  `email` varchar(100) NOT NULL DEFAULT '',\n  `full_name` varchar(255) NOT NULL DEFAULT '',\n  `regdate` int(11) unsigned NOT NULL DEFAULT '0',\n  `question` varchar(255) NOT NULL,\n  `answer` varchar(255) NOT NULL DEFAULT '',\n  `checknum` varchar(50) NOT NULL DEFAULT '',\n  PRIMARY KEY (`userid`),\n  UNIQUE KEY `login` (`username`),\n  UNIQUE KEY `md5username` (`md5username`),\n  UNIQUE KEY `email` (`email`)\n) ENGINE=MyISAM";
$sql_create_table[] = "CREATE TABLE `" . NV_USERS_GLOBALTABLE . "_openid` (\n  `userid` mediumint(8) unsigned NOT NULL DEFAULT '0',\n  `openid` varchar(255) NOT NULL DEFAULT '',\n  `opid` varchar(50) NOT NULL DEFAULT '',\n  `email` varchar(100) NOT NULL DEFAULT '',\n  PRIMARY KEY (`opid`),\n  KEY `userid` (`userid`),\n  KEY `email` (`email`)\n) ENGINE=MyISAM";
$sql_create_table[] = "CREATE TABLE `" . NV_CONFIG_GLOBALTABLE . "` (\n  `lang` char(3) NOT NULL DEFAULT 'sys',\n  `module` varchar(25) NOT NULL DEFAULT 'global',\n  `config_name` varchar(30) NOT NULL DEFAULT '',\n  `config_value` mediumtext NOT NULL,\n  UNIQUE KEY `lang` (`lang`,`module`,`config_name`)\n) ENGINE=MyISAM";
$sql_create_table[] = "CREATE TABLE `" . NV_CRONJOBS_GLOBALTABLE . "` (\n  `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,\n  `start_time` int(11) unsigned NOT NULL DEFAULT '0',\n  `interval` int(11) unsigned NOT NULL DEFAULT '0',\n  `run_file` varchar(255) NOT NULL,\n  `run_func` varchar(255) NOT NULL,\n  `params` varchar(255) NOT NULL,\n  `del` tinyint(1) unsigned NOT NULL DEFAULT '0',\n  `is_sys` tinyint(1) unsigned NOT NULL DEFAULT '0',\n  `act` tinyint(1) unsigned NOT NULL DEFAULT '0',\n  `last_time` int(11) unsigned NOT NULL DEFAULT '0',\n  `last_result` tinyint(1) unsigned NOT NULL DEFAULT '0',\n  PRIMARY KEY (`id`),\n  KEY `is_sys` (`is_sys`)\n) ENGINE=MyISAM";
$sql_create_table[] = "CREATE TABLE `" . NV_GROUPS_GLOBALTABLE . "` (\n  `group_id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,\n  `title` varchar(255) NOT NULL,\n  `content` mediumtext NOT NULL,\n  `add_time` int(11) NOT NULL,\n  `exp_time` int(11) NOT NULL,\n  `users` mediumtext NOT NULL,\n  `public` tinyint(1) unsigned NOT NULL DEFAULT '0',\n  `weight` int(11) unsigned NOT NULL DEFAULT '0',\n  `act` tinyint(1) unsigned NOT NULL,\n  PRIMARY KEY (`group_id`),\n  UNIQUE KEY `title` (`title`),\n  KEY `exp_time` (`exp_time`)\n) ENGINE=MyISAM AUTO_INCREMENT=10";
$sql_create_table[] = "CREATE TABLE `" . NV_LANGUAGE_GLOBALTABLE . "` (\n  `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,\n  `idfile` mediumint(8) unsigned NOT NULL DEFAULT '0',\n  `lang_key` varchar(50) NOT NULL,\n  PRIMARY KEY (`id`),\n  UNIQUE KEY `filelang` (`idfile`,`lang_key`)\n) ENGINE=MyISAM";
$sql_create_table[] = "CREATE TABLE `" . NV_LANGUAGE_GLOBALTABLE . "_file` (\n  `idfile` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,\n  `module` varchar(50) NOT NULL,\n  `admin_file` varchar(255) NOT NULL DEFAULT '0',  \n  `langtype` varchar(50) NOT NULL,\n  PRIMARY KEY (`idfile`),\n  UNIQUE KEY `module` (`module`,`admin_file`)\n) ENGINE=MyISAM";
$sql_create_table[] = "CREATE TABLE `" . NV_SESSIONS_GLOBALTABLE . "` (\n  `session_id` varchar(50) DEFAULT NULL,\n  `uid` mediumint(8) unsigned NOT NULL DEFAULT '0',\n  `full_name` varchar(100) NOT NULL,\n  `onl_time` int(11) unsigned NOT NULL DEFAULT '0',\n  UNIQUE KEY `session_id` (`session_id`),\n  KEY `onl_time` (`onl_time`)\n) ENGINE=MEMORY";
$sql_create_table[] = "CREATE TABLE `" . $db_config['prefix'] . "_setup` (\n  `lang` char(2) NOT NULL,\n  `module` varchar(50) NOT NULL,\n  `tables` varchar(255) NOT NULL,\n  `version` varchar(100) NOT NULL,\n  `setup_time` int(11) unsigned NOT NULL DEFAULT '0',\n  UNIQUE KEY `lang` (`lang`,`module`)\n) ENGINE=MyISAM";
$sql_create_table[] = "CREATE TABLE `" . $db_config['prefix'] . "_setup_language` (\n  `lang` char(2) NOT NULL,\n  `setup` tinyint(1) NOT NULL DEFAULT '0',\n  PRIMARY KEY (`lang`)\n) ENGINE=MyISAM";
$sql_create_table[] = "CREATE TABLE `" . $db_config['prefix'] . "_setup_modules` (\n  `title` varchar(55) NOT NULL,\n  `is_sysmod` tinyint(1) NOT NULL DEFAULT '0',\n  `virtual` tinyint(1) NOT NULL DEFAULT '0',\n  `module_file` varchar(50) NOT NULL DEFAULT '',\n  `module_data` varchar(55) NOT NULL DEFAULT '',\n  `mod_version` varchar(50) NOT NULL,\n  `addtime` int(11) NOT NULL DEFAULT '0',\n  `author` text NOT NULL,\n  `note` varchar(255) NOT NULL DEFAULT '',\n  PRIMARY KEY (`title`)\n) ENGINE=MyISAM";
$sql_create_table[] = "CREATE TABLE `" . $db_config['prefix'] . "_banners_click` (\n  `bid` mediumint(8) NOT NULL DEFAULT '0',\n  `click_time` int(11) unsigned NOT NULL DEFAULT '0',\n  `click_day` int(2) NOT NULL,\n  `click_ip` varchar(15) NOT NULL,\n  `click_country` varchar(10) NOT NULL,\n  `click_browse_key` varchar(100) NOT NULL,\n  `click_browse_name` varchar(100) NOT NULL,\n  `click_os_key` varchar(100) NOT NULL,\n  `click_os_name` varchar(100) NOT NULL,\n  `click_ref` varchar(255) NOT NULL,\n  KEY `bid` (`bid`),\n  KEY `click_day` (`click_day`),\n  KEY `click_ip` (`click_ip`),\n  KEY `click_country` (`click_country`),\n  KEY `click_browse_key` (`click_browse_key`),\n  KEY `click_os_key` (`click_os_key`)\n) ENGINE=MyISAM";
$sql_create_table[] = "CREATE TABLE `" . $db_config['prefix'] . "_banners_clients` (\n`id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,\n  `login` varchar(60) NOT NULL,\n  `pass` varchar(50) NOT NULL,\n  `reg_time` int(11) unsigned NOT NULL DEFAULT '0',\n  `full_name` varchar(255) NOT NULL,\n  `email` varchar(100) NOT NULL,\n  `website` varchar(255) NOT NULL,\n  `location` varchar(255) NOT NULL,\n  `yim` varchar(100) NOT NULL,\n  `phone` varchar(100) NOT NULL,\n  `fax` varchar(100) NOT NULL,\n  `mobile` varchar(100) NOT NULL,\n  `act` tinyint(1) unsigned NOT NULL DEFAULT '0',\n  `check_num` varchar(40) NOT NULL,\n  `last_login` int(11) unsigned NOT NULL DEFAULT '0',\n  `last_ip` varchar(15) NOT NULL,\n  `last_agent` varchar(255) NOT NULL,\n  `uploadtype` varchar(255) NOT NULL,\n  PRIMARY KEY (`id`),\n  UNIQUE KEY `login` (`login`),\n  UNIQUE KEY `email` (`email`),\n  KEY `full_name` (`full_name`)\n) ENGINE=MyISAM";
$sql_create_table[] = "CREATE TABLE `" . $db_config['prefix'] . "_banners_plans` (\n  `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,\n  `blang` char(2) NOT NULL,\n  `title` varchar(255) NOT NULL,\n  `description` varchar(255) NOT NULL,\n  `form` varchar(100) NOT NULL,\n  `width` smallint(4) unsigned NOT NULL DEFAULT '0',\n  `height` smallint(4) unsigned NOT NULL DEFAULT '0',\n  `act` tinyint(1) unsigned NOT NULL DEFAULT '0',\n  PRIMARY KEY (`id`),\n  KEY `title` (`title`)\n) ENGINE=MyISAM";
$sql_create_table[] = "CREATE TABLE `" . $db_config['prefix'] . "_banners_rows` (\n  `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,\n  `title` varchar(255) NOT NULL,\n  `pid` mediumint(8) unsigned NOT NULL DEFAULT '0',\n  `clid` mediumint(8) unsigned NOT NULL DEFAULT '0',\n  `file_name` varchar(255) NOT NULL,\n  `file_ext` varchar(100) NOT NULL,\n  `file_mime` varchar(100) NOT NULL,\n  `width` int(4) unsigned NOT NULL DEFAULT '0',\n  `height` int(4) unsigned NOT NULL DEFAULT '0',\n  `file_alt` varchar(255) NOT NULL,\n  `click_url` varchar(255) NOT NULL,\n  `file_name_tmp` varchar(255) NOT NULL,\n  `file_alt_tmp` varchar(255) NOT NULL,\n  `click_url_tmp` varchar(255) NOT NULL,\n  `add_time` int(11) unsigned NOT NULL DEFAULT '0',\n  `publ_time` int(11) unsigned NOT NULL DEFAULT '0',\n  `exp_time` int(11) unsigned NOT NULL DEFAULT '0',\n  `hits_total` mediumint(8) unsigned NOT NULL DEFAULT '0',\n  `act` tinyint(1) unsigned NOT NULL DEFAULT '0',\n  `weight` int(11) NOT NULL default '0',  \n  PRIMARY KEY (`id`),\n  KEY `pid` (`pid`),\n  KEY `clid` (`clid`)\n) ENGINE=MyISAM";
$sql_create_table[] = "CREATE TABLE `" . $db_config['prefix'] . "_banip` (\n  `id` int(11) NOT NULL AUTO_INCREMENT,\n  `ip` varchar(32) DEFAULT NULL,\n  `mask` tinyint(4) NOT NULL DEFAULT '0',  \n  `area` tinyint(3) NOT NULL,\n  `begintime` int(11) DEFAULT NULL,\n  `endtime` int(11) DEFAULT NULL,\n  `notice` varchar(255) NOT NULL,\n  PRIMARY KEY (`id`),\n  UNIQUE KEY `ip` (`ip`)\n) ENGINE=MyISAM";
$sql_create_table[] = "CREATE TABLE `" . $db_config['prefix'] . "_logs` (\n\t`id` int(11) NOT NULL AUTO_INCREMENT,\n\t`lang` varchar(10) NOT NULL,\n\t`module_name` varchar(150) NOT NULL,\n\t`name_key` varchar(255) NOT NULL,\n\t`note_action` text NOT NULL,\n\t`link_acess` varchar(255) NOT NULL,\n\t`userid` int(11) NOT NULL,\n\t`log_time` int(11) NOT NULL,\n\tPRIMARY KEY (`id`)\n) ENGINE=MyISAM";
$sql_create_table[] = "CREATE TABLE `" . $db_config['prefix'] . "_ipcountry` (\n\t  `ip_from` int(11) unsigned NOT NULL,\n\t  `ip_to` int(11) unsigned NOT NULL,\n\t  `country` char(2) NOT NULL,\n\t  `ip_file` smallint(5) unsigned NOT NULL,\n\t  `time` int(11) NOT NULL DEFAULT '0',\n\t  UNIQUE KEY `ip_from` (`ip_from`,`ip_to`),\n\t  KEY `ip_file` (`ip_file`),\n\t  KEY `country` (`country`),\n\t  KEY `time` (`time`)\n) ENGINE=MyISAM";
$sql_create_table[] = "INSERT INTO `" . NV_USERS_GLOBALTABLE . "_config` (`config`, `content`, `edit_time`) VALUES\n        ('registertype', '1', " . NV_CURRENTTIME . "),\n        ('deny_email', 'yoursite.com|mysite.com|localhost|xxx', " . NV_CURRENTTIME . "),\n        ('deny_name', 'anonimo|anonymous|god|linux|nobody|operator|root', " . NV_CURRENTTIME . ")";
$sql_create_table[] = "INSERT INTO `" . NV_CONFIG_GLOBALTABLE . "` (`lang`, `module`, `config_name`, `config_value`) VALUES\n('sys', 'global', 'closed_site', '0'),\n('sys', 'global', 'site_keywords', 'NukeViet, portal, mysql, php'),\n('sys', 'global', 'site_phone', ''),\n('sys', 'global', 'site_lang', '" . NV_LANG_DATA . "'),\n('sys', 'global', 'admin_theme', 'admin_full'),\n('sys', 'global', 'date_pattern', 'l, d-m-Y'),\n('sys', 'global', 'time_pattern', 'H:i'),\n('sys', 'global', 'block_admin_ip', '0'),\n('sys', 'global', 'admfirewall', '0'),\n('sys', 'global', 'online_upd', '1'),\n('sys', 'global', 'statistic', '1'),\n('sys', 'global', 'dump_autobackup', '1'),\n('sys', 'global', 'dump_backup_ext', 'gz'),\n('sys', 'global', 'dump_backup_day', '30'),\n('sys', 'global', 'gfx_chk', '" . $global_config['gfx_chk'] . "'),\n('sys', 'global', 'file_allowed_ext', 'adobe,archives,audio,documents,flash,images,real,video'),\n('sys', 'global', 'forbid_extensions', 'php'),\n('sys', 'global', 'forbid_mimes', ''),\n('sys', 'global', 'nv_max_size', '" . min(nv_converttoBytes(ini_get('upload_max_filesize')), nv_converttoBytes(ini_get('post_max_size'))) . "'),\n('sys', 'global', 'upload_checking_mode', 'strong'),\n('sys', 'global', 'upload_logo', 'images/logo.png'),\n('sys', 'global', 'str_referer_blocker', '0'),\n('sys', 'global', 'getloadavg', '0'),\n('sys', 'global', 'mailer_mode', ''),\n('sys', 'global', 'smtp_host', 'smtp.gmail.com'),\n('sys', 'global', 'smtp_ssl', '1'),\n('sys', 'global', 'smtp_port', '465'),\n('sys', 'global', 'smtp_username', '*****@*****.**'),\n('sys', 'global', 'smtp_password', 'userpass'),\n('sys', 'global', 'allowuserreg', '1'),\n('sys', 'global', 'allowuserlogin', '1'),\n('sys', 'global', 'allowloginchange', '0'),\n('sys', 'global', 'allowquestion', '1'),\n('sys', 'global', 'allowuserpublic', '0'),\n('sys', 'global', 'useactivate', '2'),\n('sys', 'global', 'allowmailchange', '1'),\n('sys', 'global', 'allow_sitelangs', '" . NV_LANG_DATA . "'),\n('sys', 'global', 'allow_adminlangs', '" . implode(",", $languageslist) . "'),\n('sys', 'global', 'read_type', '0'),\n('sys', 'global', 'is_url_rewrite', '" . $global_config['is_url_rewrite'] . "'),\n('sys', 'global', 'rewrite_optional', '" . $global_config['rewrite_optional'] . "'),\n('sys', 'global', 'rewrite_endurl', '" . $global_config['rewrite_endurl'] . "'),\n('sys', 'global', 'rewrite_exturl', '" . $global_config['rewrite_exturl'] . "'),\n('sys', 'global', 'autocheckupdate', '1'),\n('sys', 'global', 'autologomod', ''),\n('sys', 'global', 'autologosize1', '50'),\n('sys', 'global', 'autologosize2', '40'),\n('sys', 'global', 'autologosize3', '30'),\n('sys', 'global', 'autoupdatetime', '24'),\n('sys', 'global', 'gzip_method', '" . $global_config['gzip_method'] . "'),\n('sys', 'global', 'is_user_forum', '0'),\n('sys', 'global', 'openid_mode', '1'),\n('sys', 'global', 'authors_detail_main', '0'),\n('sys', 'global', 'spadmin_add_admin', '1'),\n('sys', 'global', 'openid_servers', 'yahoo,google,myopenid'),\n('sys', 'global', 'optActive', '1'),\n('sys', 'global', 'timestamp', '1'),\n('sys', 'global', 'googleAnalyticsID', ''),\n('sys', 'global', 'googleAnalyticsSetDomainName', '0'),\n('sys', 'global', 'searchEngineUniqueID', ''),\n('sys', 'global', 'captcha_type', '0'),\n('sys', 'global', 'revision', '" . $global_config['revision'] . "'),\n('sys', 'global', 'version', '" . $global_config['version'] . "'),\n('sys', 'global', 'whoviewuser', '2')";
$sql_create_table[] = "INSERT INTO `" . NV_CRONJOBS_GLOBALTABLE . "` (`id`, `start_time`, `interval`, `run_file`, `run_func`, `params`, `del`, `is_sys`, `act`, `last_time`, `last_result`) VALUES\n(NULL, " . NV_CURRENTTIME . ", 5, 'online_expired_del.php', 'cron_online_expired_del', '', 0, 1, 1, 0, 0),\n(NULL, " . NV_CURRENTTIME . ", 1440, 'dump_autobackup.php', 'cron_dump_autobackup', '', 0, 1, 1, 0, 0),\n(NULL, " . NV_CURRENTTIME . ", 60, 'temp_download_destroy.php', 'cron_auto_del_temp_download', '', 0, 1, 1, 0, 0),\n(NULL, " . NV_CURRENTTIME . ", 30, 'ip_logs_destroy.php', 'cron_del_ip_logs', '', 0, 1, 1, 0, 0),\n(NULL, " . NV_CURRENTTIME . ", 1440, 'error_log_destroy.php', 'cron_auto_del_error_log', '', 0, 1, 1, 0, 0),\n(NULL, " . NV_CURRENTTIME . ", 360, 'error_log_sendmail.php', 'cron_auto_sendmail_error_log', '', 0, 1, 0, 0, 0),\n(NULL, " . NV_CURRENTTIME . ", 60, 'ref_expired_del.php', 'cron_ref_expired_del', '', 0, 1, 1, 0, 0),\n(NULL, " . NV_CURRENTTIME . ", 1440, 'siteDiagnostic_update.php', 'cron_siteDiagnostic_update', '', 0, 1, 1, 0, 0),\n(NULL, " . NV_CURRENTTIME . ", 60, 'check_version.php', 'cron_auto_check_version', '', 0, 1, 1, 0, 0)";
$sql_create_table[] = "INSERT INTO `" . $db_config['prefix'] . "_setup_modules` (`title`, `is_sysmod`, `virtual`, `module_file`, `module_data`, `mod_version`, `addtime`, `author`, `note`) VALUES\n('about', 0, 1, 'about', 'about', '3.0.01 1287532800', " . NV_CURRENTTIME . ", 'VINADES (contact@vinades.vn)', ''),\n('banners', 1, 0, 'banners', 'banners', '3.0.01 1287532800', " . NV_CURRENTTIME . ", 'VINADES (contact@vinades.vn)', ''),\n('contact', 0, 1, 'contact', 'contact', '3.0.01 1287532800', " . NV_CURRENTTIME . ", 'VINADES (contact@vinades.vn)', ''),\n('news', 0, 1, 'news', 'news', '3.0.01 1287532800', " . NV_CURRENTTIME . ", 'VINADES (contact@vinades.vn)', ''),\n('voting', 0, 0, 'voting', 'voting', '3.1.01 1287532800', " . NV_CURRENTTIME . ", 'VINADES (contact@vinades.vn)', ''),\n('forum', 0, 0, 'forum', 'forum', '3.0.01 1287532800', " . NV_CURRENTTIME . ", 'VINADES (contact@vinades.vn)', ''),\n('search', 1, 0, 'search', 'search', '3.0.01 1287532800', " . NV_CURRENTTIME . ", 'VINADES (contact@vinades.vn)', ''),\n('users', 1, 0, 'users', 'users', '3.0.01 1287532800', " . NV_CURRENTTIME . ", 'VINADES (contact@vinades.vn)', ''),\n('download', 0, 1, 'download', 'download', '3.0.01 1287532800', " . NV_CURRENTTIME . ", 'VINADES (contact@vinades.vn)', ''),\n('weblinks', 0, 1, 'weblinks', 'weblinks', '3.0.01 1287532800', " . NV_CURRENTTIME . ", 'VINADES (contact@vinades.vn)', ''),\n('statistics', 0, 0, 'statistics', 'statistics', '3.0.01 1287532800', " . NV_CURRENTTIME . ", 'VINADES (contact@vinades.vn)', ''),\n('faq', 0, 1, 'faq', 'faq', '3.0.01 1287532800', " . NV_CURRENTTIME . ", 'VINADES (contact@vinades.vn)', ''),\n('menu', 0, 1, 'menu', 'menu', '3.1.00 1273225635', " . NV_CURRENTTIME . ", 'VINADES (contact@vinades.vn)', ''),\n('rss', 1, 0, 'rss', 'rss', '3.0.01 1287532800', " . NV_CURRENTTIME . ", 'VINADES (contact@vinades.vn)', '')";
$sql_create_table[] = "INSERT INTO `" . $db_config['prefix'] . "_banners_plans` VALUES\n(1, '', 'Quang cao giua trang', '', 'sequential', 510, 100, 1), \n(2, '', 'Quang cao trai', '', 'sequential', 190, 500, 1)";
$sql_create_table[] = "INSERT INTO `" . $db_config['prefix'] . "_banners_rows` VALUES\n(1, 'Bo ngoai giao', 2, 0, 'bongoaigiao.jpg', 'jpg', 'image/jpeg', 160, 54, '', 'http://www.mofa.gov.vn', '', '', '', " . NV_CURRENTTIME . ", " . NV_CURRENTTIME . ", 0, 0, 1,1), \n(2, 'vinades', 2, 0, 'vinades.jpg', 'jpg', 'image/jpeg', 190, 454, '', 'http://vinades.vn', '', '', '', " . NV_CURRENTTIME . ", " . NV_CURRENTTIME . ", 0, 0, 1,2), \n(3, 'Quang cao giua trang', 1, 0, 'webnhanh_vn.gif', 'gif', 'image/gif', 510, 65, '', 'http://webnhanh.vn', '', '', '', " . NV_CURRENTTIME . ", " . NV_CURRENTTIME . ", 0, 0, 1,1)";
예제 #6
0
파일: setting.php 프로젝트: nukeplus/photos
for ($i = 2; $i <= 60; ++$i) {
    $xtpl->assign('PER_PAGE_PHOTO', array('key' => $i, 'title' => $i, 'selected' => $i == $module_config[$module_name]['per_page_photo'] ? ' selected="selected"' : ''));
    $xtpl->parse('main.per_page_photo');
}
$array_structure_image = array();
$array_structure_image[''] = NV_UPLOADS_DIR . '/' . $module_upload;
$array_structure_image['Y'] = NV_UPLOADS_DIR . '/' . $module_upload . '/' . date('Y');
$array_structure_image['Ym'] = NV_UPLOADS_DIR . '/' . $module_upload . '/' . date('Y_m');
$array_structure_image['Y_m'] = NV_UPLOADS_DIR . '/' . $module_upload . '/' . date('Y/m');
$array_structure_image['Ym_d'] = NV_UPLOADS_DIR . '/' . $module_upload . '/' . date('Y_m/d');
$array_structure_image['Y_m_d'] = NV_UPLOADS_DIR . '/' . $module_upload . '/' . date('Y/m/d');
$structure_image_upload = isset($module_config[$module_name]['structure_upload']) ? $module_config[$module_name]['structure_upload'] : "Ym";
// Thu muc uploads
foreach ($array_structure_image as $type => $dir) {
    $xtpl->assign('STRUCTURE_UPLOAD', array('key' => $type, 'title' => $dir . '/' . $lang_module['setting_dir_album'], 'selected' => $type == $structure_image_upload ? ' selected="selected"' : ''));
    $xtpl->parse('main.structure_upload');
}
$sys_max_size = min(nv_converttoBytes(ini_get('upload_max_filesize')), nv_converttoBytes(ini_get('post_max_size')));
$p_size = $sys_max_size / 100;
$xtpl->assign('SYS_MAX_SIZE', nv_convertfromBytes($sys_max_size));
$data_maxupload = min(nv_converttoBytes(ini_get('upload_max_filesize')), nv_converttoBytes(ini_get('post_max_size')), $module_config[$module_name]['maxupload']);
for ($index = 100; $index > 0; --$index) {
    $size1 = floor($index * $p_size);
    $xtpl->assign('SIZE1', array('key' => $size1, 'title' => nv_convertfromBytes($size1), 'selected' => $data_maxupload == $size1 ? ' selected=\'selected\'' : ''));
    $xtpl->parse('main.size1');
}
$xtpl->parse('main');
$contents = $xtpl->text('main');
include NV_ROOTDIR . '/includes/header.php';
echo nv_admin_theme($contents);
include NV_ROOTDIR . '/includes/footer.php';
예제 #7
0
$sql_create_table[] = "INSERT INTO " . NV_CONFIG_GLOBALTABLE . " (lang, module, config_name, config_value) VALUES ('sys', 'site', 'description_length', '170')";
$sql_create_table[] = "INSERT INTO " . NV_CONFIG_GLOBALTABLE . " (lang, module, config_name, config_value) VALUES ('sys', 'global', 'ssl_https', '0')";
$sql_create_table[] = "INSERT INTO " . NV_CONFIG_GLOBALTABLE . " (lang, module, config_name, config_value) VALUES ('sys', 'global', 'notification_active', '1')";
$sql_create_table[] = "INSERT INTO " . NV_CONFIG_GLOBALTABLE . " (lang, module, config_name, config_value) VALUES ('sys', 'global', 'notification_autodel', '15')";
$sql_create_table[] = "INSERT INTO " . NV_CONFIG_GLOBALTABLE . " (lang, module, config_name, config_value) VALUES ('sys', 'global', 'site_keywords', 'NukeViet, portal, mysql, php')";
$sql_create_table[] = "INSERT INTO " . NV_CONFIG_GLOBALTABLE . " (lang, module, config_name, config_value) VALUES ('sys', 'global', 'site_phone', '')";
$sql_create_table[] = "INSERT INTO " . NV_CONFIG_GLOBALTABLE . " (lang, module, config_name, config_value) VALUES ('sys', 'global', 'block_admin_ip', '0')";
$sql_create_table[] = "INSERT INTO " . NV_CONFIG_GLOBALTABLE . " (lang, module, config_name, config_value) VALUES ('sys', 'global', 'admfirewall', '0')";
$sql_create_table[] = "INSERT INTO " . NV_CONFIG_GLOBALTABLE . " (lang, module, config_name, config_value) VALUES ('sys', 'global', 'dump_autobackup', '1')";
$sql_create_table[] = "INSERT INTO " . NV_CONFIG_GLOBALTABLE . " (lang, module, config_name, config_value) VALUES ('sys', 'global', 'dump_backup_ext', 'gz')";
$sql_create_table[] = "INSERT INTO " . NV_CONFIG_GLOBALTABLE . " (lang, module, config_name, config_value) VALUES ('sys', 'global', 'dump_backup_day', '30')";
$sql_create_table[] = "INSERT INTO " . NV_CONFIG_GLOBALTABLE . " (lang, module, config_name, config_value) VALUES ('sys', 'global', 'gfx_chk', '" . $global_config['gfx_chk'] . "')";
$sql_create_table[] = "INSERT INTO " . NV_CONFIG_GLOBALTABLE . " (lang, module, config_name, config_value) VALUES ('sys', 'global', 'file_allowed_ext', 'adobe,archives,audio,documents,flash,images,real,video')";
$sql_create_table[] = "INSERT INTO " . NV_CONFIG_GLOBALTABLE . " (lang, module, config_name, config_value) VALUES ('sys', 'global', 'forbid_extensions', 'php,php3,php4,php5,phtml,inc')";
$sql_create_table[] = "INSERT INTO " . NV_CONFIG_GLOBALTABLE . " (lang, module, config_name, config_value) VALUES ('sys', 'global', 'forbid_mimes', '')";
$sql_create_table[] = "INSERT INTO " . NV_CONFIG_GLOBALTABLE . " (lang, module, config_name, config_value) VALUES ('sys', 'global', 'nv_max_size', '" . min(nv_converttoBytes(ini_get('upload_max_filesize')), nv_converttoBytes(ini_get('post_max_size'))) . "')";
$sql_create_table[] = "INSERT INTO " . NV_CONFIG_GLOBALTABLE . " (lang, module, config_name, config_value) VALUES ('sys', 'global', 'upload_checking_mode', 'strong')";
$sql_create_table[] = "INSERT INTO " . NV_CONFIG_GLOBALTABLE . " (lang, module, config_name, config_value) VALUES ('sys', 'global', 'upload_alt_require', '1')";
$sql_create_table[] = "INSERT INTO " . NV_CONFIG_GLOBALTABLE . " (lang, module, config_name, config_value) VALUES ('sys', 'global', 'upload_auto_alt', '1')";
$sql_create_table[] = "INSERT INTO " . NV_CONFIG_GLOBALTABLE . " (lang, module, config_name, config_value) VALUES ('sys', 'global', 'allowuserreg', '1')";
$sql_create_table[] = "INSERT INTO " . NV_CONFIG_GLOBALTABLE . " (lang, module, config_name, config_value) VALUES ('sys', 'global', 'allowuserlogin', '1')";
$sql_create_table[] = "INSERT INTO " . NV_CONFIG_GLOBALTABLE . " (lang, module, config_name, config_value) VALUES ('sys', 'global', 'allowuserloginmulti', '0')";
$sql_create_table[] = "INSERT INTO " . NV_CONFIG_GLOBALTABLE . " (lang, module, config_name, config_value) VALUES ('sys', 'global', 'allowloginchange', '0')";
$sql_create_table[] = "INSERT INTO " . NV_CONFIG_GLOBALTABLE . " (lang, module, config_name, config_value) VALUES ('sys', 'global', 'allowquestion', '0')";
$sql_create_table[] = "INSERT INTO " . NV_CONFIG_GLOBALTABLE . " (lang, module, config_name, config_value) VALUES ('sys', 'global', 'allowuserpublic', '0')";
$sql_create_table[] = "INSERT INTO " . NV_CONFIG_GLOBALTABLE . " (lang, module, config_name, config_value) VALUES ('sys', 'global', 'useactivate', '2')";
$sql_create_table[] = "INSERT INTO " . NV_CONFIG_GLOBALTABLE . " (lang, module, config_name, config_value) VALUES ('sys', 'global', 'allowmailchange', '1')";
$sql_create_table[] = "INSERT INTO " . NV_CONFIG_GLOBALTABLE . " (lang, module, config_name, config_value) VALUES ('sys', 'global', 'allow_sitelangs', '" . NV_LANG_DATA . "')";
$sql_create_table[] = "INSERT INTO " . NV_CONFIG_GLOBALTABLE . " (lang, module, config_name, config_value) VALUES ('sys', 'global', 'read_type', '0')";
$sql_create_table[] = "INSERT INTO " . NV_CONFIG_GLOBALTABLE . " (lang, module, config_name, config_value) VALUES ('sys', 'global', 'rewrite_optional', '" . $global_config['rewrite_optional'] . "')";
$sql_create_table[] = "INSERT INTO " . NV_CONFIG_GLOBALTABLE . " (lang, module, config_name, config_value) VALUES ('sys', 'global', 'rewrite_endurl', '" . $global_config['rewrite_endurl'] . "')";
예제 #8
0
for ($i = 5; $i <= 60; ++$i) {
    $xtpl->assign('PER_PAGE_PHOTO', array('key' => $i, 'title' => $i, 'selected' => $i == $photo_config['per_page_photo'] ? ' selected="selected"' : ''));
    $xtpl->parse('main.per_page_photo');
}
$array_structure_image = array();
$array_structure_image[''] = NV_UPLOADS_DIR . '/' . $module_name;
$array_structure_image['Y'] = NV_UPLOADS_DIR . '/' . $module_name . '/' . date('Y');
$array_structure_image['Ym'] = NV_UPLOADS_DIR . '/' . $module_name . '/' . date('Y_m');
$array_structure_image['Y_m'] = NV_UPLOADS_DIR . '/' . $module_name . '/' . date('Y/m');
$array_structure_image['Ym_d'] = NV_UPLOADS_DIR . '/' . $module_name . '/' . date('Y_m/d');
$array_structure_image['Y_m_d'] = NV_UPLOADS_DIR . '/' . $module_name . '/' . date('Y/m/d');
$structure_image_upload = isset($module_config[$module_name]['structure_upload']) ? $module_config[$module_name]['structure_upload'] : "Ym";
// Thu muc uploads
foreach ($array_structure_image as $type => $dir) {
    $xtpl->assign('STRUCTURE_UPLOAD', array('key' => $type, 'title' => $dir . '/' . $lang_module['setting_dir_album'], 'selected' => $type == $structure_image_upload ? ' selected="selected"' : ''));
    $xtpl->parse('main.structure_upload');
}
$sys_max_size = min(nv_converttoBytes(ini_get('upload_max_filesize')), nv_converttoBytes(ini_get('post_max_size')));
$p_size = $sys_max_size / 100;
$xtpl->assign('SYS_MAX_SIZE', nv_convertfromBytes($sys_max_size));
$data_maxupload = min(nv_converttoBytes(ini_get('upload_max_filesize')), nv_converttoBytes(ini_get('post_max_size')), $photo_config['maxupload']);
for ($index = 100; $index > 0; --$index) {
    $size1 = floor($index * $p_size);
    $xtpl->assign('SIZE1', array('key' => $size1, 'title' => nv_convertfromBytes($size1), 'selected' => $data_maxupload == $size1 ? ' selected=\'selected\'' : ''));
    $xtpl->parse('main.size1');
}
$xtpl->parse('main');
$contents = $xtpl->text('main');
include NV_ROOTDIR . '/includes/header.php';
echo nv_admin_theme($contents);
include NV_ROOTDIR . '/includes/footer.php';
예제 #9
0
define('NV_LANGUAGE_GLOBALTABLE', $db_config['prefix'] . '_language');
define('NV_SESSIONS_GLOBALTABLE', $db_config['prefix'] . '_sessions');
define('NV_CRONJOBS_GLOBALTABLE', $db_config['prefix'] . '_cronjobs');
$sql_create_table[] = "CREATE TABLE `" . NV_AUTHORS_GLOBALTABLE . "` (\r\n  `admin_id` int(11) unsigned NOT NULL,\r\n  `editor` varchar(100) NOT NULL,\r\n  `lev` tinyint(1) unsigned NOT NULL DEFAULT '0',\r\n  `files_level` varchar(255) NOT NULL,\r\n  `position` varchar(255) NOT NULL,\r\n  `addtime` int(11) NOT NULL DEFAULT '0',\r\n  `edittime` int(11) NOT NULL DEFAULT '0',\r\n  `is_suspend` tinyint(1) unsigned NOT NULL DEFAULT '0',\r\n  `susp_reason` mediumtext NOT NULL,\r\n  `check_num` varchar(40) NOT NULL,\r\n  `last_login` int(11) unsigned NOT NULL DEFAULT '0',\r\n  `last_ip` varchar(45) NOT NULL,\r\n  `last_agent` varchar(255) NOT NULL,\r\n  PRIMARY KEY (`admin_id`)\r\n) ENGINE=MyISAM";
$sql_create_table[] = "CREATE TABLE `" . NV_AUTHORS_GLOBALTABLE . "_config` (\r\n  `id` int(11) NOT NULL AUTO_INCREMENT,\r\n  `keyname` varchar(32) DEFAULT NULL,\r\n  `mask` tinyint(4) NOT NULL DEFAULT '0',\r\n  `begintime` int(11) DEFAULT NULL,\r\n  `endtime` int(11) DEFAULT NULL,\r\n  `notice` varchar(255) NOT NULL,\r\n  PRIMARY KEY (`id`),\r\n  UNIQUE KEY `keyname` (`keyname`)\r\n) ENGINE=MyISAM";
$sql_create_table[] = "CREATE TABLE `" . NV_USERS_GLOBALTABLE . "_config` (\r\n  `config` varchar(50) NOT NULL,\r\n  `content` mediumtext NOT NULL,\r\n  `edit_time` int(11) NOT NULL DEFAULT '0',\r\n  PRIMARY KEY (`config`)\r\n) ENGINE=MyISAM";
$sql_create_table[] = "CREATE TABLE `" . NV_USERS_GLOBALTABLE . "_question` (\r\n  `qid` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,\r\n  `title` varchar(255) NOT NULL DEFAULT '',\r\n  `lang` varchar(2) NOT NULL DEFAULT '',\r\n  `weight` mediumint(8) unsigned NOT NULL DEFAULT '0',\r\n  `add_time` int(11) unsigned NOT NULL,\r\n  `edit_time` int(11) unsigned NOT NULL,\r\n  PRIMARY KEY (`qid`),\r\n  UNIQUE KEY `title` (`title`,`lang`)\r\n) ENGINE=MyISAM";
$sql_create_table[] = "CREATE TABLE `" . NV_USERS_GLOBALTABLE . "` (\r\n  `userid` int(11) unsigned NOT NULL AUTO_INCREMENT,\r\n  `username` varchar(100) NOT NULL DEFAULT '',\r\n  `md5username` char(32) NOT NULL DEFAULT '',\r\n  `password` varchar(50) NOT NULL DEFAULT '',\r\n  `email` varchar(100) NOT NULL DEFAULT '',\r\n  `full_name` varchar(255) NOT NULL DEFAULT '',\r\n  `gender` varchar(1) NOT NULL,\r\n  `photo` varchar(255) NOT NULL DEFAULT '',\r\n  `birthday` int(11) unsigned NOT NULL,\r\n  `sig` text,\r\n  `regdate` int(11) NOT NULL DEFAULT '0',\r\n  `website` varchar(255) NOT NULL DEFAULT '',\r\n  `location` varchar(255) NOT NULL,\r\n  `yim` varchar(100) NOT NULL DEFAULT '',\r\n  `telephone` varchar(100) NOT NULL DEFAULT '',\r\n  `fax` varchar(100) NOT NULL DEFAULT '',\r\n  `mobile` varchar(100) NOT NULL DEFAULT '',\r\n  `question` varchar(255) NOT NULL,\r\n  `answer` varchar(255) NOT NULL DEFAULT '',\r\n  `passlostkey` varchar(40) NOT NULL DEFAULT '',\r\n  `view_mail` tinyint(1) unsigned NOT NULL DEFAULT '0',\r\n  `remember` tinyint(1) unsigned NOT NULL DEFAULT '0',\r\n  `in_groups` varchar(255) NOT NULL DEFAULT '',\r\n  `active` tinyint(1) unsigned NOT NULL DEFAULT '0',\r\n  `checknum` varchar(40) NOT NULL DEFAULT '',\r\n  `last_login` int(11) unsigned NOT NULL DEFAULT '0',\r\n  `last_ip` varchar(45) NOT NULL DEFAULT '',\r\n  `last_agent` varchar(255) NOT NULL DEFAULT '',\r\n  `last_openid` varchar(255) NOT NULL DEFAULT '',\r\n  PRIMARY KEY (`userid`),\r\n  UNIQUE KEY `username` (`username`),\r\n  UNIQUE KEY `md5username` (`md5username`),\r\n  UNIQUE KEY `email` (`email`)\r\n) ENGINE=MyISAM";
$sql_create_table[] = "CREATE TABLE `" . NV_USERS_GLOBALTABLE . "_reg` (\r\n  `userid` int(11) unsigned NOT NULL AUTO_INCREMENT,\r\n  `username` varchar(100) NOT NULL DEFAULT '',\r\n  `md5username` char(32) NOT NULL DEFAULT '',\r\n  `password` varchar(50) NOT NULL DEFAULT '',\r\n  `email` varchar(100) NOT NULL DEFAULT '',\r\n  `full_name` varchar(255) NOT NULL DEFAULT '',\r\n  `regdate` int(11) unsigned NOT NULL DEFAULT '0',\r\n  `question` varchar(255) NOT NULL,\r\n  `answer` varchar(255) NOT NULL DEFAULT '',\r\n  `checknum` varchar(50) NOT NULL DEFAULT '',\r\n  PRIMARY KEY (`userid`),\r\n  UNIQUE KEY `login` (`username`),\r\n  UNIQUE KEY `md5username` (`md5username`),\r\n  UNIQUE KEY `email` (`email`)\r\n) ENGINE=MyISAM";
$sql_create_table[] = "CREATE TABLE `" . NV_USERS_GLOBALTABLE . "_openid` (\r\n  `userid` mediumint(8) unsigned NOT NULL DEFAULT '0',\r\n  `openid` varchar(255) NOT NULL DEFAULT '',\r\n  `opid` varchar(50) NOT NULL DEFAULT '',\r\n  `email` varchar(100) NOT NULL DEFAULT '',\r\n  PRIMARY KEY (`opid`),\r\n  KEY `userid` (`userid`),\r\n  KEY `email` (`email`)\r\n) ENGINE=MyISAM";
$sql_create_table[] = "CREATE TABLE `" . NV_CONFIG_GLOBALTABLE . "` (\r\n  `lang` varchar(3) NOT NULL DEFAULT 'sys',\r\n  `module` varchar(25) NOT NULL DEFAULT 'global',\r\n  `config_name` varchar(30) NOT NULL DEFAULT '',\r\n  `config_value` varchar(255) NOT NULL DEFAULT '',\r\n  UNIQUE KEY `lang` (`lang`,`module`,`config_name`)\r\n) ENGINE=MyISAM";
$sql_create_table[] = "CREATE TABLE `" . NV_CRONJOBS_GLOBALTABLE . "` (\r\n  `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,\r\n  `start_time` int(11) unsigned NOT NULL DEFAULT '0',\r\n  `interval` int(11) unsigned NOT NULL DEFAULT '0',\r\n  `run_file` varchar(255) NOT NULL,\r\n  `run_func` varchar(255) NOT NULL,\r\n  `params` varchar(255) NOT NULL,\r\n  `del` tinyint(1) unsigned NOT NULL DEFAULT '0',\r\n  `is_sys` tinyint(1) unsigned NOT NULL DEFAULT '0',\r\n  `act` tinyint(1) unsigned NOT NULL DEFAULT '0',\r\n  `last_time` int(11) unsigned NOT NULL DEFAULT '0',\r\n  `last_result` tinyint(1) unsigned NOT NULL DEFAULT '0',\r\n  PRIMARY KEY (`id`),\r\n  KEY `is_sys` (`is_sys`)\r\n) ENGINE=MyISAM";
$sql_create_table[] = "CREATE TABLE `" . NV_GROUPS_GLOBALTABLE . "` (\r\n  `group_id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,\r\n  `title` varchar(255) NOT NULL,\r\n  `content` mediumtext NOT NULL,\r\n  `add_time` int(11) NOT NULL,\r\n  `exp_time` int(11) NOT NULL,\r\n  `users` mediumtext NOT NULL,\r\n  `public` tinyint(1) unsigned NOT NULL DEFAULT '0',\r\n  `act` tinyint(1) unsigned NOT NULL,\r\n  PRIMARY KEY (`group_id`),\r\n  UNIQUE KEY `title` (`title`),\r\n  KEY `exp_time` (`exp_time`)\r\n) ENGINE=MyISAM AUTO_INCREMENT=10";
$sql_create_table[] = "CREATE TABLE `" . NV_LANGUAGE_GLOBALTABLE . "` (\r\n  `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,\r\n  `idfile` mediumint(8) unsigned NOT NULL DEFAULT '0',\r\n  `lang_key` varchar(50) NOT NULL,\r\n  PRIMARY KEY (`id`),\r\n  UNIQUE KEY `filelang` (`idfile`,`lang_key`)\r\n) ENGINE=MyISAM";
$sql_create_table[] = "CREATE TABLE `" . NV_LANGUAGE_GLOBALTABLE . "_file` (\r\n  `idfile` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,\r\n  `module` varchar(50) NOT NULL,\r\n  `admin_file` tinyint(1) NOT NULL DEFAULT '0',\r\n  `langtype` varchar(50) NOT NULL,\r\n  PRIMARY KEY (`idfile`),\r\n  UNIQUE KEY `module` (`module`,`admin_file`)\r\n) ENGINE=MyISAM";
$sql_create_table[] = "CREATE TABLE `" . NV_SESSIONS_GLOBALTABLE . "` (\r\n  `session_id` varchar(50) DEFAULT NULL,\r\n  `uid` mediumint(8) unsigned NOT NULL DEFAULT '0',\r\n  `full_name` varchar(100) NOT NULL,\r\n  `onl_time` int(11) unsigned NOT NULL DEFAULT '0',\r\n  UNIQUE KEY `session_id` (`session_id`),\r\n  KEY `onl_time` (`onl_time`)\r\n) ENGINE=MEMORY";
$sql_create_table[] = "CREATE TABLE `" . $db_config['prefix'] . "_setup` (\r\n  `lang` char(2) NOT NULL,\r\n  `module` varchar(50) NOT NULL,\r\n  `tables` varchar(255) NOT NULL,\r\n  `version` varchar(100) NOT NULL,\r\n  `setup_time` int(11) unsigned NOT NULL DEFAULT '0',\r\n  UNIQUE KEY `lang` (`lang`,`module`)\r\n) ENGINE=MyISAM";
$sql_create_table[] = "CREATE TABLE `" . $db_config['prefix'] . "_setup_language` (\r\n  `lang` char(2) NOT NULL,\r\n  `setup` tinyint(1) NOT NULL DEFAULT '0',\r\n  PRIMARY KEY (`lang`)\r\n) ENGINE=MyISAM";
$sql_create_table[] = "CREATE TABLE `" . $db_config['prefix'] . "_setup_modules` (\r\n  `title` varchar(55) NOT NULL,\r\n  `is_sysmod` tinyint(1) NOT NULL DEFAULT '0',\r\n  `virtual` tinyint(1) NOT NULL DEFAULT '0',\r\n  `module_file` varchar(50) NOT NULL DEFAULT '',\r\n  `module_data` varchar(55) NOT NULL DEFAULT '',\r\n  `mod_version` varchar(50) NOT NULL,\r\n  `addtime` int(11) NOT NULL DEFAULT '0',\r\n  `author` text NOT NULL,\r\n  `note` varchar(255) NOT NULL DEFAULT '',\r\n  PRIMARY KEY (`title`)\r\n) ENGINE=MyISAM";
$sql_create_table[] = "CREATE TABLE `" . $db_config['prefix'] . "_banners_click` (\r\n  `bid` mediumint(8) NOT NULL DEFAULT '0',\r\n  `click_time` int(11) unsigned NOT NULL DEFAULT '0',\r\n  `click_day` int(2) NOT NULL,\r\n  `click_ip` varchar(15) NOT NULL,\r\n  `click_country` varchar(10) NOT NULL,\r\n  `click_browse_key` varchar(100) NOT NULL,\r\n  `click_browse_name` varchar(100) NOT NULL,\r\n  `click_os_key` varchar(100) NOT NULL,\r\n  `click_os_name` varchar(100) NOT NULL,\r\n  `click_ref` varchar(255) NOT NULL,\r\n  KEY `bid` (`bid`),\r\n  KEY `click_day` (`click_day`),\r\n  KEY `click_ip` (`click_ip`),\r\n  KEY `click_country` (`click_country`),\r\n  KEY `click_browse_key` (`click_browse_key`),\r\n  KEY `click_os_key` (`click_os_key`)\r\n) ENGINE=MyISAM";
$sql_create_table[] = "CREATE TABLE `" . $db_config['prefix'] . "_banners_clients` (\r\n`id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,\r\n  `login` varchar(60) NOT NULL,\r\n  `pass` varchar(50) NOT NULL,\r\n  `reg_time` int(11) unsigned NOT NULL DEFAULT '0',\r\n  `full_name` varchar(255) NOT NULL,\r\n  `email` varchar(100) NOT NULL,\r\n  `website` varchar(255) NOT NULL,\r\n  `location` varchar(255) NOT NULL,\r\n  `yim` varchar(100) NOT NULL,\r\n  `phone` varchar(100) NOT NULL,\r\n  `fax` varchar(100) NOT NULL,\r\n  `mobile` varchar(100) NOT NULL,\r\n  `act` tinyint(1) unsigned NOT NULL DEFAULT '0',\r\n  `check_num` varchar(40) NOT NULL,\r\n  `last_login` int(11) unsigned NOT NULL DEFAULT '0',\r\n  `last_ip` varchar(15) NOT NULL,\r\n  `last_agent` varchar(255) NOT NULL,\r\n  `uploadtype` varchar(255) NOT NULL,\r\n  PRIMARY KEY (`id`),\r\n  UNIQUE KEY `login` (`login`),\r\n  UNIQUE KEY `email` (`email`),\r\n  KEY `full_name` (`full_name`)\r\n) ENGINE=MyISAM";
$sql_create_table[] = "CREATE TABLE `" . $db_config['prefix'] . "_banners_plans` (\r\n  `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,\r\n  `blang` char(2) NOT NULL,\r\n  `title` varchar(255) NOT NULL,\r\n  `description` varchar(255) NOT NULL,\r\n  `form` varchar(100) NOT NULL,\r\n  `width` smallint(4) unsigned NOT NULL DEFAULT '0',\r\n  `height` smallint(4) unsigned NOT NULL DEFAULT '0',\r\n  `act` tinyint(1) unsigned NOT NULL DEFAULT '0',\r\n  PRIMARY KEY (`id`),\r\n  KEY `title` (`title`)\r\n) ENGINE=MyISAM";
$sql_create_table[] = "CREATE TABLE `" . $db_config['prefix'] . "_banners_rows` (\r\n  `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,\r\n  `title` varchar(255) NOT NULL,\r\n  `pid` mediumint(8) unsigned NOT NULL DEFAULT '0',\r\n  `clid` mediumint(8) unsigned NOT NULL DEFAULT '0',\r\n  `file_name` varchar(255) NOT NULL,\r\n  `file_ext` varchar(100) NOT NULL,\r\n  `file_mime` varchar(100) NOT NULL,\r\n  `width` int(4) unsigned NOT NULL DEFAULT '0',\r\n  `height` int(4) unsigned NOT NULL DEFAULT '0',\r\n  `file_alt` varchar(255) NOT NULL,\r\n  `click_url` varchar(255) NOT NULL,\r\n  `file_name_tmp` varchar(255) NOT NULL,\r\n  `file_alt_tmp` varchar(255) NOT NULL,\r\n  `click_url_tmp` varchar(255) NOT NULL,\r\n  `add_time` int(11) unsigned NOT NULL DEFAULT '0',\r\n  `publ_time` int(11) unsigned NOT NULL DEFAULT '0',\r\n  `exp_time` int(11) unsigned NOT NULL DEFAULT '0',\r\n  `hits_total` mediumint(8) unsigned NOT NULL DEFAULT '0',\r\n  `act` tinyint(1) unsigned NOT NULL DEFAULT '0',\r\n  PRIMARY KEY (`id`),\r\n  KEY `pid` (`pid`),\r\n  KEY `clid` (`clid`)\r\n) ENGINE=MyISAM";
$sql_create_table[] = "CREATE TABLE `" . $db_config['prefix'] . "_banip` (\r\n  `id` int(11) NOT NULL AUTO_INCREMENT,\r\n  `ip` varchar(32) DEFAULT NULL,\r\n  `mask` tinyint(4) NOT NULL DEFAULT '0',  \r\n  `area` tinyint(3) NOT NULL,\r\n  `begintime` int(11) DEFAULT NULL,\r\n  `endtime` int(11) DEFAULT NULL,\r\n  `notice` varchar(255) NOT NULL,\r\n  PRIMARY KEY (`id`),\r\n  UNIQUE KEY `ip` (`ip`)\r\n) ENGINE=MyISAM";
$sql_create_table[] = "CREATE TABLE `" . $db_config['prefix'] . "_logs` (\r\n\t`id` int(11) NOT NULL AUTO_INCREMENT,\r\n\t`lang` varchar(10) NOT NULL,\r\n\t`module_name` varchar(150) NOT NULL,\r\n\t`name_key` varchar(255) NOT NULL,\r\n\t`note_action` text NOT NULL,\r\n\t`link_acess` varchar(255) NOT NULL,\r\n\t`userid` int(11) NOT NULL,\r\n\t`log_time` int(11) NOT NULL,\r\n\tPRIMARY KEY (`id`)\r\n) ENGINE=MyISAM";
$sql_create_table[] = "INSERT INTO `" . NV_USERS_GLOBALTABLE . "_config` (`config`, `content`, `edit_time`) VALUES\r\n        ('registertype', '1', 1274757036),\r\n        ('deny_email', 'yoursite.com|mysite.com|localhost|xxx', 1274757036),\r\n        ('deny_name', 'anonimo|anonymous|god|linux|nobody|operator|root', 1274757036)";
$sql_create_table[] = "INSERT INTO `" . NV_CONFIG_GLOBALTABLE . "` (`lang`, `module`, `config_name`, `config_value`) VALUES\r\n('sys', 'global', 'site_keywords', 'Nukeviet, portal, mysql, php'),\r\n('sys', 'global', 'site_phone', ''),\r\n('sys', 'global', 'site_lang', '" . NV_LANG_DATA . "'),\r\n('sys', 'global', 'admin_theme', 'admin_default'),\r\n('sys', 'global', 'date_pattern', 'l, d-m-Y'),\r\n('sys', 'global', 'time_pattern', 'H:i'),\r\n('sys', 'global', 'block_admin_ip', '0'),\r\n('sys', 'global', 'admfirewall', '0'),\r\n('sys', 'global', 'online_upd', '1'),\r\n('sys', 'global', 'statistic', '1'),\r\n('sys', 'global', 'dump_autobackup', '1'),\r\n('sys', 'global', 'dump_backup_ext', 'gz'),\r\n('sys', 'global', 'dump_backup_day', '30'),\r\n('sys', 'global', 'gfx_chk', '" . $global_config['gfx_chk'] . "'),\r\n('sys', 'global', 'file_allowed_ext', 'images,flash,documents,archives'),\r\n('sys', 'global', 'forbid_extensions', 'php'),\r\n('sys', 'global', 'forbid_mimes', ''),\r\n('sys', 'global', 'nv_max_size', '" . min(nv_converttoBytes(ini_get('upload_max_filesize')), nv_converttoBytes(ini_get('post_max_size'))) . "'),\r\n('sys', 'global', 'str_referer_blocker', '0'),\r\n('sys', 'global', 'mailer_mode', ''),\r\n('sys', 'global', 'smtp_host', 'smtp.gmail.com'),\r\n('sys', 'global', 'smtp_ssl', '1'),\r\n('sys', 'global', 'smtp_port', '465'),\r\n('sys', 'global', 'smtp_username', '*****@*****.**'),\r\n('sys', 'global', 'smtp_password', 'userpass'),\r\n('sys', 'global', 'allowuserreg', '1'),\r\n('sys', 'global', 'allowuserlogin', '1'),\r\n('sys', 'global', 'allowloginchange', '0'),\r\n('sys', 'global', 'useactivate', '2'),\r\n('sys', 'global', 'allowmailchange', '1'),\r\n('sys', 'global', 'allow_sitelangs', '" . NV_LANG_DATA . "'),\r\n('sys', 'global', 'allow_adminlangs', '" . implode(",", $languageslist) . "'),\r\n('sys', 'global', 'read_type', '0'),\r\n('sys', 'global', 'is_url_rewrite', '" . $global_config['is_url_rewrite'] . "'),\r\n('sys', 'global', 'rewrite_optional', '0'),\r\n('sys', 'global', 'gzip_method', '" . $global_config['gzip_method'] . "'),\r\n('sys', 'global', 'is_user_forum', '0'),\r\n('sys', 'global', 'openid_mode', '1'),\r\n('sys', 'global', 'authors_detail_main', '0'),\r\n('sys', 'global', 'spadmin_add_admin', '1'),\r\n('sys', 'global', 'openid_servers', 'yahoo,google,myopenid'),\r\n('sys', 'global', 'version', '" . $global_config['version'] . "')";
$sql_create_table[] = "INSERT INTO `" . NV_CRONJOBS_GLOBALTABLE . "` (`id`, `start_time`, `interval`, `run_file`, `run_func`, `params`, `del`, `is_sys`, `act`, `last_time`, `last_result`) VALUES\r\n(1, 1262293200, 5, 'online_expired_del.php', 'cron_online_expired_del', '', 0, 1, 1, 1276839725, 1),\r\n(2, 1262293200, 1440, 'dump_autobackup.php', 'cron_dump_autobackup', '', 0, 1, 1, 1276826911, 1),\r\n(3, 1262296800, 60, 'temp_download_destroy.php', 'cron_auto_del_temp_download', '', 0, 1, 1, 1276839725, 1),\r\n(4, 1269657620, 30, 'ip_logs_destroy.php', 'cron_del_ip_logs', '', 0, 1, 1, 1276839725, 1),\r\n(5, 1271004840, 1440, 'error_log_destroy.php', 'cron_auto_del_error_log', '', 0, 1, 1, 1276793791, 1),\r\n(6, 1271004840, 360, 'error_log_sendmail.php', 'cron_auto_sendmail_error_log', '', 0, 1, 0, 1276177733, 0),\r\n(7, 1276281900, 60, 'ref_expired_del.php', 'cron_ref_expired_del', '', 0, 1, 1, 1276839725, 1)";
$sql_create_table[] = "INSERT INTO `" . $db_config['prefix'] . "_setup_modules` (`title`, `is_sysmod`, `virtual`, `module_file`, `module_data`, `mod_version`, `addtime`, `author`, `note`) VALUES\r\n('about', 0, 1, 'about', 'about', '3.0.01 1270400000', 1270997593, 'VINADES (contact@vinades.vn)', ''),\r\n('banners', 1, 0, 'banners', 'banners', '3.0.01 1270400000', 1270997593, 'VINADES (contact@vinades.vn)', ''),\r\n('contact', 0, 1, 'contact', 'contact', '3.0.01 1270400000', 1270997593, 'VINADES (contact@vinades.vn)', ''),\r\n('news', 1, 1, 'news', 'news', '3.0.01 1270400000', 1270990593, 'VINADES (contact@vinades.vn)', ''),\r\n('voting', 0, 0, 'voting', 'voting', '3.0.01 1270400000', 1270997593, 'VINADES (contact@vinades.vn)', ''),\r\n('forum', 0, 0, 'forum', 'forum', '3.0.01 1273225635', 1275351278, 'VINADES (contact@vinades.vn)', ''),\r\n('search', 1, 0, 'search', 'search', '3.0.01 1273225635', 1273474165, 'VINADES (contact@vinades.vn)', ''),\r\n('users', 1, 0, 'users', 'users', '3.0.01 1273225635', 1274080275, 'VINADES (contact@vinades.vn)', ''),\r\n('download', 0, 1, 'download', 'download', '3.0.01 1273225635', 1275965656, 'VINADES (contact@vinades.vn)', ''),\r\n('weblinks', 0, 1, 'weblinks', 'weblinks', '3.0.01 1273225635', 1276228274, 'VINADES (contact@vinades.vn)', ''),\r\n('statistics', 1, 0, 'statistics', 'statistics', '3.0.01 1273225635', 1276785143, 'VINADES (contact@vinades.vn)', '')";
$sql_create_table[] = "INSERT INTO `" . $db_config['prefix'] . "_banners_plans` VALUES\r\n(1, '', 'Quang cao giua trang', '', 'sequential', 510, 100, 1), \r\n(2, '', 'Quang cao trai', '', 'sequential', 190, 500, 1)";
$sql_create_table[] = "INSERT INTO `" . $db_config['prefix'] . "_banners_rows` VALUES\r\n(1, 'Bo ngoai giao', 2, 0, 'uploads/banners/bongoaigiao.jpg', 'jpg', 'image/jpeg', 160, 54, '', 'http://www.mofa.gov.vn', '', '', '', 1275296773, 1275296773, 0, 1, 1), \r\n(2, 'vinades', 2, 0, 'uploads/banners/vinades.jpg', 'jpg', 'image/jpeg', 190, 454, '', 'http://vinades.vn', '', '', '', 1275321220, 1275321220, 0, 0, 1), \r\n(3, 'Quang cao giua trang', 1, 0, 'uploads/banners/vndads___05.jpg', 'jpg', 'image/jpeg', 470, 60, '', 'http://vinades.vn', '', '', '', 1275321716, 1275321716, 0, 0, 1)";