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

56 lines
2.1KB

  1. <?php
  2. /**
  3. * 增加自由列表
  4. *
  5. * @version $Id: freelist_add.php 1 8:48 2010年7月13日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_once(dirname(__FILE__)."/config.php");
  13. CheckPurview('c_FreeList');
  14. if(empty($dopost))
  15. {
  16. require_once DEDEINC.'/typelink.class.php';
  17. include DedeInclude('templets/freelist_add.htm');
  18. exit();
  19. }
  20. else if($dopost=='save')
  21. {
  22. if(!isset($types)) $types = '';
  23. if(!isset($nodefault)) $nodefault = '0';
  24. $atts = " pagesize='$pagesize' col='$col' titlelen='$titlelen' orderby='$orderby' orderway='$order' ";
  25. $ntype = '';
  26. $edtime = time();
  27. if(empty($channel))
  28. {
  29. showmsg('频道类型不能为空','-1');
  30. exit();
  31. }
  32. if(is_array($types))
  33. {
  34. foreach($types as $v) $ntype .= $v.' ';
  35. }
  36. if($ntype!='') $atts .= " type='".trim($ntype)."' ";
  37. if(!empty($typeid)) $atts .= " typeid='$typeid' ";
  38. if(!empty($channel)) $atts .= " channel='$channel' ";
  39. if(!empty($subday)) $atts .= " subday='$subday' ";
  40. if(!empty($keywordarc)) $atts .= " keyword='$keywordarc' ";
  41. if(!empty($att)) $atts .= " att='$att' ";
  42. $innertext = trim($innertext);
  43. if(!empty($innertext)) $innertext = stripslashes($innertext);
  44. $listTag = "{dede:list $atts}$innertext{/dede:list}";
  45. $listTag = addslashes($listTag);
  46. $inquery = "
  47. INSERT INTO `#@__freelist`(`title` , `namerule` , `listdir` , `defaultpage` , `nodefault` , `templet` , `edtime`, `maxpage` , `click` , `listtag` , `keywords` , `description`)
  48. VALUES ('$title','$namerule','$listdir','$defaultpage','$nodefault','$templet','$edtime', '$maxpage','0','$listTag','$keywords','$description');
  49. ";
  50. $dsql->ExecuteNoneQuery($inquery);
  51. ShowMsg("成功增加一个自由列表!", "freelist_main.php");
  52. exit();
  53. }