function flist_option($array, $top = '0', $mu = '', $optgroup = "0") { if ($optgroup == "1") { $mu = ""; } foreach ($array as $key => $value) { if ($value['type_live'] == $top) { if ($mu != '') { $muu = $mu . "├"; } if ($value['type_live'] == '0' && $optgroup == '1') { $host .= "<optgroup label='{$value['type_subject']}'>"; } else { $host .= "<option value='{$value['type_id']}'>{$muu}{$value['type_subject']}</option>"; } unset($array[$key]); $host .= flist_option($array, $value['type_id'], $mu . " "); if ($value['type_live'] == '0' && $optgroup == '1') { $host .= "</optgroup>"; } } } return $host; }
$GETSQL->fInsert("`{$ODBC['tablepre']}class`", $cQuery, $cData); } if (is_array($_POST['type_id'])) { foreach ($_POST['type_id'] as $v) { $GETSQL->fUpdate("`{$ODBC['tablepre']}class`", "`type_subject`='{$_POST['type_subject'][$v]}',`type_live`='{$_POST['type_live'][$v]}',`type_sp`='{$_POST['type_sp'][$v]}'", "`type_id`='{$v}' AND `type_id`!='{$_POST['type_live'][$v]}'"); } } $sql_class = $GETSQL->fSql("*", "`{$ODBC['tablepre']}class`", "", "ORDER BY `type_sp`,`type_id` DESC"); foreach ($sql_class as $vale) { $configtxt .= "classtf[{$vale['type_id']}]='{$vale['type_live']}';classvf[{$vale['type_id']}]='{$vale['type_subject']}';\n"; } ffile(R_P . "lang/class.js", $configtxt); die(gb2utf8("后台组件操作完成")); } $sql_about = $GETSQL->fSql("*", "`{$ODBC['tablepre']}class`", "", "ORDER BY `type_sp`,`type_id` DESC"); $soptions = "<option value='0'>系统根组</option>" . flist_option($sql_about); $smarty->assign('showtext', flist_top($sql_about, '0', $soptions)); $smarty->assign('sql_about', $sql_about); $smarty->assign('soptions', $soptions); $smarty->display("classification.htm"); } if ($option == 'del') { $sql_class = $GETSQL->fSql("*", "`{$ODBC['tablepre']}class`", "`type_live`='{$id}'", "", "", "", "U_B"); if ($sql_class['type_id'] > 0) { die(gb2utf8("请先删除分类下的子类")); } else { $GETSQL->fDelete("`{$ODBC['tablepre']}class`", "`type_id`='{$id}'", "1"); die(gb2utf8("删除成功")); } } function flist_top($array, $top = '0', $more)
if ($_POST['blog_title'] != '' && $_POST['blog_body'] != '') { if ($_POST['bid'] != '') { $GETSQL->fUpdate("`{$ODBC['tablepre']}about`", "`about_subject`='{$_POST['blog_title']}',\n\t\t\t`about_content`='{$_POST['blog_body']}'", "`about_id`='{$_POST['bid']}'"); header("Location: update.php?action=add&title=" . urlencode("{$_POST['blog_title']}修改成功") . "&a={$action}&p={$option}&id={$_POST['bid']}&u=admin"); } else { $cQuery = array("`about_id`", "`about_subject`", "`about_content`"); $cData = array($nowtime, $_POST['blog_title'], $_POST['blog_body']); $GETSQL->fInsert("`{$ODBC['tablepre']}about`", $cQuery, $cData); header("Location: update.php?action=add&title=" . urlencode("{$_POST['blog_title']}发表成功") . "&a={$action}&p={$option}&id={$nowtime}&u=admin"); } exit; } if ($id != '') { $sql_about = $GETSQL->fSql("*", "`{$ODBC['tablepre']}about`", "`about_id`='{$id}'", "", "", "", "U_B"); $ncontent = str_replace("\\", "\\\\", $sql_about['about_content']); $ncontent = str_replace("\n", "\\n", $ncontent); $ncontent = str_replace("\r", "\\r", $ncontent); $ncontent = str_replace("\"", "\\\"", $ncontent); $smarty->assign('sql_about', $sql_about); $smarty->assign('ncontent', $ncontent); } else { $showoption = flist_option($sql_newsclass); } $smarty->assign('showoption', $showoption); $smarty->assign('nowtitle', date("Y") . "年" . date("m") . "月" . date("d") . "日"); $smarty->display("aboutedit.htm"); } if ($option == 'del') { $GETSQL->fDelete("`{$ODBC['tablepre']}about`", "`about_id`='{$id}'", "1"); die(gb2utf8("ok 删除成功")); }
header("Location: update.php?action=edit&title=" . urlencode("{$_POST['blog_title']}修改成功")); } else { $cQuery = array("`new_id`", "`new_type`", "`new_subject`", "`new_quote`", "`new_content`", "`new_date`"); $cData = array($nowtime, $_POST['blog_class'], $_POST['blog_title'], $_POST['blog_quote'], $_POST['blog_body'], fgetdate()); $GETSQL->fInsert("`{$ODBC['tablepre']}info`", $cQuery, $cData); header("Location: update.php?action=add&title=" . urlencode("{$_POST['blog_title']}发表成功") . "&a={$action}&p={$option}&id={$nowtime}&u=admin"); } exit; } $sql_newsclass = $GETSQL->fSql("*", "`{$ODBC['tablepre']}class`", "", "ORDER BY `type_sp`,`type_id` DESC"); if ($id != '') { $sql_news = $GETSQL->fSql("*", "`{$ODBC['tablepre']}info`", "`new_id`='{$id}'", "", "", "", "U_B"); $soptions = flist_option($sql_newsclass, 0, '', 1); $showoption = preg_replace("/value='{$sql_news['new_type']}'/is", "value='{$sql_news['new_type']}' selected", $soptions); $ncontent = str_replace("\\", "\\\\", $sql_news['new_content']); $ncontent = str_replace("\n", "\\n", $ncontent); $ncontent = str_replace("\r", "\\r", $ncontent); $ncontent = str_replace("\"", "\\\"", $ncontent); $smarty->assign('sql_news', $sql_news); $smarty->assign('ncontent', $ncontent); } else { $showoption = flist_option($sql_newsclass, 0, '', 1); } $smarty->assign('showoption', $showoption); $smarty->assign('nowtitle', date("Y") . "年" . date("m") . "月" . date("d") . "日"); $smarty->display("infoedit.htm"); } if ($option == 'del') { $GETSQL->fDelete("`{$ODBC['tablepre']}info`", "`new_id`='{$id}'", "1"); die(gb2utf8("ok 删除成功")); }