国内流行的内容管理系统(CMS)多端全媒体解决方案 https://www.dedebiz.com
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

45 lines
1.7KB

  1. <?php
  2. /**
  3. * 添加一个模板
  4. *
  5. * @version $Id: templets_one_add.php 1 23:07 2010年7月20日Z tianya $
  6. * @package DedeBIZ.Administrator
  7. * @copyright Copyright (c) 2020, DedeBIZ.COM
  8. * @license https://www.dedebiz.com/license
  9. * @link https://www.dedebiz.com
  10. */
  11. require(dirname(__FILE__) . "/config.php");
  12. CheckPurview('temp_One');
  13. if (empty($dopost)) $dopost = "";
  14. if ($dopost == "save") {
  15. require_once(DEDEINC . "/arc.partview.class.php");
  16. $uptime = time();
  17. $body = str_replace('&quot;', '\\"', $body);
  18. $filename = preg_replace("#^\/#", "", $nfilename);
  19. if ($likeid == '') {
  20. $likeid = $likeidsel;
  21. }
  22. $row = $dsql->GetOne("SELECT filename FROM `#@__sgpage` WHERE likeid='$likeid' AND filename LIKE '$filename' ");
  23. if (is_array($row)) {
  24. ShowMsg("已经存在相同的文件名,请更改为其它文件名!", "-1");
  25. exit();
  26. }
  27. $inQuery = "INSERT INTO `#@__sgpage`(title,keywords,description,template,likeid,ismake,filename,uptime,body)
  28. VALUES('$title','$keywords','$description','$template','$likeid','$ismake','$filename','$uptime','$body'); ";
  29. if (!$dsql->ExecuteNoneQuery($inQuery)) {
  30. ShowMsg("增加页面失败,请检内容是否有问题!", "-1");
  31. exit();
  32. }
  33. $id = $dsql->GetLastID();
  34. include_once(DEDEINC . "/arc.sgpage.class.php");
  35. $sg = new sgpage($id);
  36. $sg->SaveToHtml();
  37. ShowMsg("成功增加一个页面!", "templets_one.php");
  38. exit();
  39. }
  40. $row = $dsql->GetOne("SELECT MAX(aid) AS aid FROM `#@__sgpage` ");
  41. $nowid = is_array($row) ? $row['aid'] + 1 : '';
  42. include_once(DEDEADMIN . "/templets/templets_one_add.htm");