$tpl_id = $_POST['tpl_id']; if (is_array($_POST['tpl_id']) && count($_POST['tpl_id']) > 0) { for ($i = 0; $i < count($_POST['tpl_id']); $i++) { $setsqlarr['tpl_name'] = trim($_POST['tpl_name'][$i]); $setsqlarr['tpl_display'] = intval($_POST['tpl_display'][$i]); $setsqlarr['tpl_val'] = intval($_POST['tpl_val'][$i]); !$db->updatetable(table('tpl'), $setsqlarr, " tpl_id=" . intval($_POST['tpl_id'][$i])) ? adminmsg("保存加失败!", 0) : ""; } } adminmsg("保存成功!", 2); } elseif ($act == 'refresh_tpl') { check_token(); $type = intval($_GET['type']); $tpl_dir = trim($_GET['tpl_dir']); $tab_dir = get_user_tpl_dir($type); $dirs = getsubdirs('../templates/' . $tpl_dir); foreach ($dirs as $str) { if (!in_array($str, $tab_dir)) { $info = get_templates_info("../templates/" . $tpl_dir . "/" . $str . "/info.txt"); $db->query("INSERT INTO " . table('tpl') . " (tpl_name,tpl_dir,tpl_type) VALUES ('{$info['name']}','{$str}','{$type}')"); } $dararray[] = " tpl_dir!='{$str}' "; } if (!empty($dararray)) { $db->query("Delete from " . table('tpl') . " WHERE " . implode(" and ", $dararray) . " AND tpl_type='{$type}'"); } adminmsg('刷新成功', 2); } elseif ($act == 'resume_tpl') { get_token(); check_permissions($_SESSION['admin_purview'], "tpl_resume"); $smarty->assign('pageheader', "模板设置");
$type = "FLASH"; break; case 5: $type = "浮动"; break; case 6: $type = "视频"; break; default: $type = "文字"; break; } $smarty->assign('type', $type); } $smarty->assign('ad_category', $ad_category); $dirs = getsubdirs('../templates'); unset($dirs[array_search("tpl_company", $dirs)]); unset($dirs[array_search("tpl_resume", $dirs)]); unset($dirs[array_search("tpl_hunter", $dirs)]); unset($dirs[array_search("tpl_train", $dirs)]); unset($dirs[array_search("tpl_shop", $dirs)]); unset($dirs[array_search("tpl_campus", $dirs)]); unset($dirs[array_search("tpl_evaluation", $dirs)]); $list = array(); foreach ($dirs as $k => $val) { $list[$k]['dir'] = $val; $list[$k]['info'] = get_templates_info("../templates/" . $val . "/info.txt"); } $smarty->assign('list', $list); $smarty->assign('pageheader', "广告管理"); get_token();