function doseteditor() { global $_M; $met_weburl = $_M['form']['met_weburl']; if (substr($met_weburl, -1, 1) != "/") { $met_weburl .= "/"; } if (!strstr($met_weburl, "http://")) { $met_weburl = "http://" . $met_weburl; } $_M['form']['met_weburl'] = $met_weburl; $configlist = array(); $configlist[] = 'met_webname'; $configlist[] = 'met_logo'; $configlist[] = 'met_weburl'; $configlist[] = 'met_keywords'; $configlist[] = 'met_description'; $configlist[] = 'met_footright'; $configlist[] = 'met_footaddress'; $configlist[] = 'met_foottel'; $configlist[] = 'met_footother'; configsave($configlist); /*保存系统配置*/ if ($_M['form']['met_weburl'] != $_M['config']['met_weburl']) { //当首页网址变更时 /*重新验证授权*/ $query = "UPDATE {$_M['table']['otherinfo']} SET info1='',info2='' where id=1"; DB::query($query); /*语言网址修改*/ $query = "UPDATE {$_M['table']['lang']} SET met_weburl = '{$_M['form']['met_weburl']}' where lang='{$_M['lang']}'"; DB::query($query); /*重新生成404*/ $gent = "{$_M['url']['site']}include/404.php?lang={$_M[config][met_index_type]}&metinfonow={$_M['config']['met_member_force']}"; $gent = urlencode($gent); /*重新生成robots.txt*/ $sitemaptype = $_M['config']['met_sitemap_xml'] ? 'xml' : ($_M['config']['met_sitemap_txt'] ? 'txt' : 0); sitemap_robots($sitemaptype); } turnover("{$_M[url][own_form]}a=doindex&gent={$gent}", $_M['word']['jsok']); }
if ($action == 'modify') { if ($cs == 1) { $met_weburl = ereg_replace(" ", "", $met_weburl); if (substr($met_weburl, -1, 1) != "/") { $met_weburl .= "/"; } if (!strstr($met_weburl, "http://")) { $met_weburl = "http://" . $met_weburl; } } require_once $depth . '../include/config.php'; if ($cs == 1) { $query = "update {$met_lang} SET met_weburl = '{$met_weburl}' where lang='{$lang}'"; $db->query($query); } sitemap_robots(); $db->query("update {$met_otherinfo} set info1='',info2='' where id=1"); $gent = '../../include/404.php?lang=' . $lang . '&metinfonow=' . $met_member_force; metsave('../system/basic.php?anyid=' . $anyid . '&lang=' . $lang . '&cs=' . $cs . '&linkapi=1', '', '', '', $gent); } else { $localurl = "http://"; $localurl .= $_SERVER['HTTP_HOST'] . $_SERVER["PHP_SELF"]; $localurl_a = explode("/", $localurl); $localurl_count = count($localurl_a); $localurl_admin = $localurl_a[$localurl_count - 3]; $localurl_admin = $localurl_admin . "/system/basic"; $localurl_real = explode($localurl_admin, $localurl); $localurl = $localurl_real[0]; if ($met_weburl == "") { $met_weburl = $localurl; }
function dositemapeditor() { global $_M; $configlist = array(); $configlist[] = 'met_sitemap_auto'; $configlist[] = 'met_sitemap_not1'; $configlist[] = 'met_sitemap_not2'; $configlist[] = 'met_sitemap_lang'; $configlist[] = 'met_sitemap_xml'; $configlist[] = 'met_sitemap_txt'; configsave($configlist); /*保存系统配置*/ load::sys_func('file'); /*验证读写权限*/ function yanquan($fname) { global $_M; $r = false; if (!file_exists(PATH_WEB . $fname)) { file_put_contents(PATH_WEB . $fname, 'metinfo'); $str = 'metinfo'; } else { $str = file_get_contents(PATH_WEB . $fname); } if (!file_put_contents(PATH_WEB . $fname, $str)) { $r = true; } return $r; } $err = false; if (!$_M['form']['met_sitemap_xml']) { delfile(PATH_WEB . "/sitemap.xml"); } else { $err = yanquan('sitemap.xml'); } if (!$_M['form']['met_sitemap_txt']) { delfile(PATH_WEB . "/sitemap.txt"); } else { $err = yanquan('sitemap.txt'); } if ($err) { turnover("{$_M[url][own_form]}a=dositemap", $_M['form']['otherinfocache2']); } else { $sitemaptype = $_M['form']['met_sitemap_xml'] ? 'xml' : ($_M['form']['met_sitemap_txt'] ? 'txt' : 0); sitemap_robots($sitemaptype); if ($_M['form']['met_sitemap_xml'] || $_M['form']['met_sitemap_txt']) { $gent = "sitemap/index.php?lang={$_M[lang]}&htmsitemap={$_M['config']['met_member_force']}"; $curl = load::sys_class('curl', 'new'); $curl->set('host', $_M['url']['site']); $curl->set('file', $gent); $post = array('post' => ''); $curl->curl_post($post); } turnover("{$_M[url][own_form]}a=dositemap"); } }