国内流行的内容管理系统(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.

47 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 DedeCMS.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. {
  16. require_once(DEDEINC."/arc.partview.class.php");
  17. $uptime = time();
  18. $body = str_replace('&quot;', '\\"', $body);
  19. $filename = preg_replace("#^\/#", "", $nfilename);
  20. if($likeid=='')
  21. {
  22. $likeid = $likeidsel;
  23. }
  24. $row = $dsql->GetOne("SELECT filename FROM `#@__sgpage` WHERE likeid='$likeid' AND filename LIKE '$filename' ");
  25. if(is_array($row))
  26. {
  27. ShowMsg("已经存在相同的文件名,请更改为其它文件名!","-1");
  28. exit();
  29. }
  30. $inQuery = "INSERT INTO `#@__sgpage`(title,keywords,description,template,likeid,ismake,filename,uptime,body)
  31. VALUES('$title','$keywords','$description','$template','$likeid','$ismake','$filename','$uptime','$body'); ";
  32. if(!$dsql->ExecuteNoneQuery($inQuery))
  33. {
  34. ShowMsg("增加页面失败,请检内容是否有问题!","-1");
  35. exit();
  36. }
  37. $id = $dsql->GetLastID();
  38. include_once(DEDEINC."/arc.sgpage.class.php");
  39. $sg = new sgpage($id);
  40. $sg->SaveToHtml();
  41. ShowMsg("成功增加一个页面!","templets_one.php");
  42. exit();
  43. }
  44. $row = $dsql->GetOne("SELECT MAX(aid) AS aid FROM `#@__sgpage` ");
  45. $nowid = is_array($row) ? $row['aid']+1 : '';
  46. include_once(DEDEADMIN."/templets/templets_one_add.htm");