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

48 lines
1.8KB

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