ShowMsg('您没有选择需要更新的文档!', '-1'); exit; } else { if (is_array($ids)) { foreach ($ids as $aid) { $sg = new sgpage($aid); $sg->SaveToHtml(); $i++; } ShowMsg("成功更新 {$i} 个页面!", '-1'); exit; } } } else { if ($dopost == "view") { if (empty($aid)) { ShowMsg('错误的ID!', 'javascript:;'); exit; } include_once DEDEINC . "/arc.sgpage.class.php"; $sg = new sgpage($aid); $sg->display(); exit; } } } } } } $row = $dsql->GetOne("SELECT * FROM `#@__sgpage` WHERE aid='{$aid}' "); include DEDEADMIN . "/templets/templets_one_edit.htm";
if (empty($dopost)) { $dopost = ""; } if ($dopost == "save") { require_once DEDEINC . "/arc.partview.class.php"; $uptime = time(); $body = str_replace('"', '\\"', $body); $filename = ereg_replace("^/", "", $nfilename); if ($likeid == '') { $likeid = $likeidsel; } $row = $dsql->GetOne("Select filename From `#@__sgpage` where likeid='{$likeid}' And filename like '{$filename}' "); if (is_array($row)) { ShowMsg("已经存在相同的文件名,请更改为其它文件名!", "-1"); exit; } $inQuery = "Insert Into `#@__sgpage`(title,keywords,description,template,likeid,ismake,filename,uptime,body)\r\n\t Values('{$title}','{$keywords}','{$description}','{$template}','{$likeid}','{$ismake}','{$filename}','{$uptime}','{$body}'); "; if (!$dsql->ExecuteNoneQuery($inQuery)) { ShowMsg("增加页面失败,请检内容是否有问题!", "-1"); exit; } $id = $dsql->GetLastID(); include_once DEDEINC . "/arc.sgpage.class.php"; $sg = new sgpage($id); $sg->SaveToHtml(); ShowMsg("成功增加一个页面!", "templets_one.php"); exit; } $row = $dsql->GetOne("Select max(aid) as aid From `#@__sgpage` "); $nowid = is_array($row) ? $row['aid'] + 1 : ''; include_once DEDEADMIN . "/templets/templets_one_add.htm";