} } $uptp = $val['tpif'] ? "update" : "insert into"; $upbp = $val['tpif'] ? "where id='{$val['id']}'" : ""; if ($uptp == "insert into") { if ($val[module] == 0) { $val[foldername] = null; } } $query = "{$uptp} {$met_column} set\n\t\t\t\tname = '{$val['name']}',\n\t\t\t\tout_url = '{$val['out_url']}',\n\t\t\t\tno_order = '{$val['no_order']}',\n\t\t\t\tbigclass = '{$val['bigclass']}',\n\t\t\t\tnav = '{$val['nav']}',\n\t\t\t\tif_in = '{$val['if_in']}',\n\t\t\t\tfoldername = '{$val['foldername']}',\n\t\t\t\tmodule = '{$val['module']}',\n\t\t\t\tindex_num = '{$val['index_num']}',\t\t\t\t\t \n\t\t\t\tclasstype = '{$val['classtype']}',\t\t\t\t\t \n\t\t\t\treleclass = '{$val['releclass']}',\t\t\t\t\t \n\t\t\t\taccess \t = '{$val['access']}',\n\t\t\t\tlang\t\t\t = '{$lang}'\n\t\t\t{$upbp}"; $db->query($query); $upid = $val['tpif'] ? $val[id] : mysql_insert_id(); if (($val['classtype'] == 1 || $val['releclass']) && !$val['tpif']) { $metinfo_admin_pop1 .= 'c' . $upid . '-'; } column_copyconfig($val['foldername'], $val['module'], $upid); $column_id = $db->get_one("select * from {$met_column} where name='{$val['name']}' and lang='{$lang}'"); if ($val[module] > 1000) { establish_appmodule($val[foldername], $val[module]); $module_Information = $db->get_one("select * from {$met_ifcolumn} where no='{$val['module']}'"); if ($module_Information[memberleft] == 1) { if ($uptp == "insert into") { $query = "insert into {$met_ifmember_left} set no='{$val['module']}',columnid='{$column_id['id']}',title='{$column_id['name']}',foldername='{$val['foldername']}',filename='index.php'"; $db->query($query); } } } } if ($metinfo_admin_pop1 != '') { if ($metinfo_admin_pop != "metinfo") { $metinfo_admin_pop1 = $metinfo_admin_pop . $metinfo_admin_pop1;
$classold1 = $classold2 = "class{$movenow['classtype']}={$movenow['id']}"; $classtypenext = $movenow['classtype'] + 1; if ($classtypenext < 4) { $classold1 .= " and class{$classtypenext}=0"; } if ($classto == 0) { /*移动为顶级栏目*/ $filedir = "../../" . metdetrim($foldername); if (!file_exists($filedir)) { @mkdir($filedir, 0777); } if (!file_exists($filedir)) { metsave('../column/index.php?anyid=' . $anyid . '&lang=' . $lang, $lang_modFiledir); } if ($movenow['module'] != 8 && $movenow['module'] != 7) { column_copyconfig($foldername, $movenow['module'], $movenow['id']); } $query = "update {$met_column} set classtype=1,bigclass=0,foldername='{$foldername}',releclass=0 where id='{$id}'"; $db->query($query); if ($metinfo_admin_pop != "metinfo") { $metinfo_admin_pop .= $id . '-'; $query = "update {$met_admin_table} SET admin_type = '{$metinfo_admin_pop}' where id='{$admin_list['id']}'"; $db->query($query); } $query = "update {$table} set class1={$movenow['id']},class2=0,class3=0 where {$classold1}"; $db->query($query); $query = "select * from {$met_column} where bigclass='{$movenow['id']}'"; $moveclass3 = $db->get_all($query); foreach ($moveclass3 as $key => $val) { $classtypenext = $movenow['classtype'] + 1; $classold2 .= " and class{$classtypenext}={$val['id']}";
} if (is_numeric($filename) && $filename != $id && $met_pseudo) { $filenameok1 = $db->get_one("SELECT * FROM {$met_column} WHERE id='{$filename}' and foldername='{$foldername}'"); if ($filenameok1) { metsave('-1', $lang_jsx30); } } } $filedir = "../../" . $foldername; if (!file_exists($filedir)) { @mkdir($filedir, 0777); } if (!file_exists($filedir)) { metsave('-1', $lang_modFiledir); } column_copyconfig($foldername, $module, $id); if ($met_member_use) { require_once 'check.php'; } $query = "update {$met_column} SET \n\t\t\t\t name = '{$name}',\n\t\t\t\t namemark = '{$namemark}',\n\t\t\t\t out_url = '',\n\t\t\t\t keywords = '{$keywords}',\n\t\t\t\t description = '{$description}',\n\t\t\t\t no_order = '{$no_order}',\n\t\t\t\t wap_ok = '{$wap_ok}',\n\t\t\t\t list_order = '{$list_order}',\n\t\t\t\t new_windows = '{$new_windows}', \n\t\t\t\t bigclass = '{$bigclass}',\n\t\t\t\t releclass = '{$releclass}',\n\t\t\t\t nav = '{$nav}',\n\t\t\t\t ctitle = '{$ctitle}',\n\t\t\t\t if_in = '{$if_in}',\n\t\t\t\t filename = '{$filename}',\n\t\t\t\t foldername = '{$foldername}',\n\t\t\t\t module = '{$module}',\n\t\t\t\t index_num = '{$index_num}',\t\t\t\t\t \n\t\t\t\t classtype = '{$classtype}',\t\t\t\t\t \n\t\t\t\t access \t\t = '{$access}',\n\t\t\t\t indeximg\t\t\t = '{$indeximg}',\n\t\t\t\t columnimg\t\t\t = '{$columnimg}',\n\t\t\t\t display = '{$displays}',\n\t\t\t\t lang\t\t\t = '{$lang}',"; if ($module >= 2 && $module <= 5) { $query .= "content = '{$content}',"; } $query .= "isshow\t\t\t = {$isshow}\n\t\t\t\t where id='{$id}'"; $db->query($query); foreach ($met_class2[$id] as $val) { //控制下级栏目随上级栏目设置是否在前台显示 $query = "update {$met_column} SET \n\t\t\t\t\tdisplay= {$displays}\n\t\t\t\t\twhere id={$val['id']}"; $db->query($query); foreach ($met_class3[$val[id]] as $val1) { $query = "update {$met_column} SET \n\t\t\t\t\tdisplay= {$displays}\n\t\t\t\t\twhere id={$val1['id']}";
$column[ctitle] = str_replace('\'', '\'\'', $column[ctitle]); $column[keywords] = str_replace('\'', '\'\'', $column[keywords]); $column[content] = str_replace('\'', '\'\'', $column[content]); $column[new_windows] = str_replace('\'', '\'\'', $column[new_windows]); $query = "INSERT INTO {$met_column} set \n\t\t\tname ='{$column['name']}',\n\t\t\tfoldername ='{$column['foldername_copy']}',\n\t\t\tfilename ='',\n\t\t\tbigclass ='',\n\t\t\tsamefile ='',\n\t\t\tmodule ='{$column['module']}',\n\t\t\tno_order ='{$column['no_order']}',\n\t\t\twap_ok ='{$column['wap_ok']}',\n\t\t\tif_in ='{$column['if_in']}',\n\t\t\tnav ='{$column['nav']}',\n\t\t\tctitle ='{$column['ctitle']}',\n\t\t\tkeywords ='{$column['keywords']}',\n\t\t\tcontent ='{$column['content']}',\n\t\t\tdescription ='{$column['description']}',\n\t\t\tlist_order ='{$column['list_order']}',\n\t\t\tnew_windows ='{$column['new_windows']}',\n\t\t\tclasstype ='{$column['classtype']}',\n\t\t\tout_url ='{$column['out_url']}',\n\t\t\tindex_num ='{$column['index_num']}',\n\t\t\taccess ='{$column['access']}',\n\t\t\tindeximg ='{$column['indeximg']}',\n\t\t\tcolumnimg ='{$column['columnimg']}',\n\t\t\tisshow ='{$column['isshow']}',\n\t\t\tlang ='{$copylang}',\n\t\t\tnamemark ='{$column['namemark']}',\n\t\t\treleclass ='{$column['releclass']}'\n\t"; $db->query($query); $insert_id = $db->insert_id(); $cpoy_list_id[$column[id]] = $insert_id; $cpoy_bigclass_id[$insert_id] = $column[bigclass]; $cpoy_insert_id[$insert_id] = 1; if ($column[classtype] == 1 || $column[releclass] != 0) { $content_class1_tmp[id] = $column[id]; $content_class1_tmp[module] = $column[module]; $content_class1[] = $content_class1_tmp; if ($column[module] != 6) { column_copyconfig($column[foldername_copy], $column[module], $insert_id); } if ($column[module] == 6 || $column[module] == 7 || $column[module] == 8) { $query = "select * from {$met_config} where columnid='{$column['id']}' and flashid='0'"; $config_para = $db->get_all($query); foreach ($config_para as $key => $val) { $para_name = $val[name]; $query = "update {$met_config} set value='{$val['value']}' where columnid='{$insert_id}' and flashid='0' and name='{$para_name}'"; $db->query($query); } } if ($column[module] == 3 || $column[module] == 4 || $column[module] == 5 || $column[module] == 6 || $column[module] == 8) { $query = "select * from {$met_parameter} where (class1='0' or class1='{$column['id']}') and module='{$column['module']}' and lang='{$lang_now}'"; $para_list = $db->get_all($query); foreach ($para_list as $key => $val) { $val[name] = str_replace('\'', '\'\'', $val[name]);
sql_execute($sql, 0, $dosubmit1); $fileid++; save_met_cookie(); metsave($rurls . "&pre=" . $pre . "&fileid=" . $fileid . "&dosubmit=1&adminmodify=1&database_met=1", "{$lang_setdbDBFile} {$filename} {$lang_setdbImportOK}{$lang_setdbImportcen}", $depth, '', '', 1); } else { require_once '../../column/global.func.php'; $query = "select * from {$met_column} where ((module<=5 and module>0) or (module=8)) and (classtype=1 or releclass!=0)"; $result = $db->get_all($query); sitemap_robots(); $sysflie = array(1 => 'about', 2 => 'news', 3 => 'product', 4 => 'download', 5 => 'img', 6 => 'job', 7 => 'message', 8 => 'feedback'); foreach ($result as $key => $val) { if (array_search($val[foldername], $sysflie) === false) { if (!file_exists(ROOTPATH . $val['foldername'])) { @mkdir(ROOTPATH . $val['foldername'], 0777); } column_copyconfig($val['foldername'], $val['module'], $val['id']); } } deltree(ROOTPATH . 'cache'); $adminfile = $url_array[count($url_array) - 2]; if ($met_adminfile != "" && $met_adminfile != $adminfile) { $oldname = '../../../' . $adminfile; $newname = '../../../' . $met_adminfile; if (rename($oldname, $newname)) { echo "<script type='text/javascript'> alert('{$lang_setdbDBRestoreOK}'); document.write('{$lang_authTip12}'); top.location.href='{$newname}'; </script>"; die; } else { echo "<script type='text/javascript'> alert('{$lang_setdbDBRestoreOK}.{$lang_adminwenjian}'); top.location.reload(); </script>"; die; } }