public function doin() { global $_M; if ($_M['form']['temname'] && $_M['form']['temname'] != '') { $query = "INSERT INTO {$_M['table']['skin_table']} SET skin_name='{$_M['form']['temname']}',skin_file='{$_M['form']['temname']}',skin_info='',devices='{$_M['form']['devices']}'"; DB::query($query); } else { turnover("{$_M[url][own_name]}c=temtool&a=dotemlist", '操作失败!请填写模板文件夹名称!'); die; } if (file_exists(PATH_WEB . "templates/{$_M['form']['temname']}/install/install.class.php")) { copy(PATH_WEB . "templates/{$_M['form']['temname']}/install/install.class.php", PATH_OWN_FILE . 'tmp/install.class.php'); $ini = load::own_class('admin/tmp/install', 'new'); $file = $_M['form']['temname']; $re = $ini->dosql(); $query = "DELETE FROM {$_M['table']['templates']} WHERE no='{$file}'"; DB::query($query); foreach ($_M['langlist']['web'] as $key => $val) { foreach ($re['sql'] as $ksql => $vsql) { $query = "INSERT INTO {$_M['table']['templates']} SET no='{$file}',lang='{$key}',{$vsql}"; DB::query($query); } } } else { if (file_exists(PATH_WEB . "templates/{$_M['form']['temname']}/lang/language_cn.ini")) { $ini = load::own_class('admin/class/inc', 'new'); $ini->ini($_M['form']['temname']); } } turnover("{$_M[url][own_name]}c=temtool&a=dotemlist"); }