} if ($array_config_global['lang_multi'] == 0) { $array_config_global['rewrite_optional'] = $nv_Request->get_int('rewrite_optional', 'post', 0); $array_config_global['lang_geo'] = 0; } else { $array_config_global['rewrite_optional'] = 0; $array_config_global['lang_geo'] = $nv_Request->get_int('lang_geo', 'post', 0); } foreach ($array_config_global as $config_name => $config_value) { $db->sql_query("REPLACE INTO `" . NV_CONFIG_GLOBALTABLE . "` (`lang`, `module`, `config_name`, `config_value`) VALUES ('sys', 'global', '" . mysql_real_escape_string($config_name) . "', " . $db->dbescape($config_value) . ")"); } nv_save_file_config_global(); if ($global_config['is_url_rewrite'] != $array_config_global['is_url_rewrite'] or $global_config['rewrite_optional'] != $array_config_global['rewrite_optional']) { $array_config_global['rewrite_endurl'] = $global_config['rewrite_endurl']; $array_config_global['rewrite_exturl'] = $global_config['rewrite_exturl']; nv_rewrite_change($array_config_global); } Header('Location: ' . NV_BASE_ADMINURL . 'index.php?' . NV_NAME_VARIABLE . '=' . $module_name . '&' . NV_OP_VARIABLE . '=' . $op . '&rand=' . nv_genpass()); exit; } $page_title = $lang_module['global_config']; $optActive_Modes = array('0' => $lang_module['optActive_no'], '1' => $lang_module['optActive_all'], '2' => $lang_module['optActive_site'], '3' => $lang_module['optActive_admin']); $sql = "SELECT `config_name`, `config_value` FROM `" . NV_CONFIG_GLOBALTABLE . "` WHERE `lang`='sys' AND `module`='global'"; $result = $db->sql_query($sql); while (list($c_config_name, $c_config_value) = $db->sql_fetchrow($result)) { $array_config_global[$c_config_name] = $c_config_value; } $lang_multi = $array_config_global['lang_multi']; $array_config_global['gzip_method'] = $array_config_global['gzip_method'] ? ' checked="checked"' : ''; $array_config_global['lang_multi'] = $array_config_global['lang_multi'] ? ' checked="checked"' : ''; $array_config_global['str_referer_blocker'] = $array_config_global['str_referer_blocker'] ? ' checked="checked"' : '';
$global_config['lang_multi'] = 0; $db->query("UPDATE " . NV_CONFIG_GLOBALTABLE . " SET config_value = '0' WHERE lang='sys' AND module = 'global' AND config_name = 'lang_multi'"); $db->query("UPDATE " . NV_CONFIG_GLOBALTABLE . " SET config_value = '1' WHERE lang='sys' AND module = 'global' AND config_name = 'rewrite_optional'"); $result = $db->query("SELECT COUNT(*) FROM " . $db_config['prefix'] . "_" . NV_LANG_DATA . "_modules where title='news'"); if ($result->fetchColumn()) { $global_config['rewrite_op_mod'] = 'news'; $db->query("UPDATE " . NV_CONFIG_GLOBALTABLE . " SET config_value = 'news' WHERE lang='sys' AND module = 'global' AND config_name = 'rewrite_op_mod'"); } } } catch (PDOException $e) { trigger_error($e->getMessage()); die($e->getMessage()); } nv_save_file_config(); $array_config_rewrite = array('rewrite_optional' => $global_config['rewrite_optional'], 'rewrite_endurl' => $global_config['rewrite_endurl'], 'rewrite_exturl' => $global_config['rewrite_exturl'], 'rewrite_op_mod' => $global_config['rewrite_op_mod'], 'ssl_https' => 0); $rewrite = nv_rewrite_change($array_config_rewrite); if (empty($rewrite[0])) { $error .= sprintf($lang_module['file_not_writable'], $rewrite[1]); } elseif (nv_save_file_config_global()) { ++$step; $nv_Request->set_Session('maxstep', $step); nv_save_file_config(); @rename(NV_ROOTDIR . '/' . $file_config_temp, NV_ROOTDIR . '/' . NV_TEMP_DIR . '/' . NV_CONFIG_FILENAME); if (is_writable(NV_ROOTDIR . '/robots.txt')) { $contents = file_get_contents(NV_ROOTDIR . '/robots.txt'); $check_rewrite_file = nv_check_rewrite_file(); if ($check_rewrite_file) { $content_sitemap = 'Sitemap: ' . NV_MY_DOMAIN . NV_BASE_SITEURL . 'sitemap.xml'; } else { $content_sitemap = 'Sitemap: ' . NV_MY_DOMAIN . NV_BASE_SITEURL . 'index.php/SitemapIndex' . $global_config['rewrite_endurl']; }
$array_config_global['proxy_blocker'] = $nv_Request->get_int('proxy_blocker', 'post'); if (!isset($proxy_blocker_array[$array_config_global['proxy_blocker']])) { $array_config_global['proxy_blocker'] = 0; } $array_config_global['str_referer_blocker'] = $nv_Request->get_int('str_referer_blocker', 'post'); if ($sys_info['supports_rewrite'] !== false) { $array_config_global['is_url_rewrite'] = $nv_Request->get_int('is_url_rewrite', 'post'); if ($array_config_global['lang_multi'] == 0) { $array_config_global['rewrite_optional'] = $nv_Request->get_int('rewrite_optional', 'post'); } else { $array_config_global['rewrite_optional'] = 0; } } if (isset($array_config_global['is_url_rewrite']) and $array_config_global['is_url_rewrite'] == 1) { require_once NV_ROOTDIR . "/includes/rewrite.php"; $errormess = nv_rewrite_change($array_config_global); if (!empty($errormess)) { $array_config_global['is_url_rewrite'] = 0; $array_config_global['rewrite_optional'] = 0; } } foreach ($array_config_global as $config_name => $config_value) { $db->sql_query("UPDATE `" . NV_CONFIG_GLOBALTABLE . "` SET \r\n `config_value`=" . $db->dbescape_string($config_value) . " \r\n WHERE `config_name` = " . $db->dbescape_string($config_name) . " \r\n AND `lang` = 'sys' AND `module`='global' \r\n LIMIT 1"); } nv_save_file_config_global(); if (empty($errormess)) { Header('Location: ' . NV_BASE_ADMINURL . 'index.php?' . NV_NAME_VARIABLE . '=' . $module_name . '&' . NV_OP_VARIABLE . '=' . $op . '&rand=' . nv_genpass()); exit; } else { $sql = $db->constructQuery("SELECT `module`, `config_name`, `config_value` FROM `" . NV_CONFIG_GLOBALTABLE . "` \r\n WHERE `lang`='" . NV_LANG_DATA . "' ORDER BY `module` ASC", NV_LANG_DATA); $result = $db->sql_query($sql);