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

61 lines
2.2KB

  1. <?php
  2. /**
  3. * 编辑自由列表
  4. *
  5. * @version $Id: freelist_edit.php 1 8:48 2010年7月13日Z tianya $
  6. * @package DedeCMS.Administrator
  7. * @copyright Copyright (c) 2007 - 2018, DesDev, Inc.
  8. * @copyright Copyright (c) 2020, DedeBIZ.COM
  9. * @license https://www.dedebiz.com/license/v6
  10. * @link https://www.dedebiz.com
  11. */
  12. require_once(dirname(__FILE__)."/config.php");
  13. if(empty($dopost))
  14. {
  15. require_once DEDEINC.'/typelink.class.php';
  16. require_once DEDEINC.'/dedetag.class.php';
  17. $aid = isset($aid) && is_numeric($aid) ? $aid : 0;
  18. $row = $dsql->GetOne("Select * From `#@__freelist` where aid='$aid' ");
  19. $dtp = new DedeTagParse();
  20. $dtp->SetNameSpace("dede","{","}");
  21. $dtp->LoadSource("--".$row['listtag']."--");
  22. $ctag = $dtp->GetTag('list');
  23. include DedeInclude('templets/freelist_edit.htm');
  24. exit();
  25. }
  26. else if( $dopost=='save' )
  27. {
  28. if(!isset($types)) $types = '';
  29. if(!isset($nodefault)) $nodefault = '0';
  30. $atts = " pagesize='$pagesize' col='$col' titlelen='$titlelen' orderby='$orderby' orderway='$order' \r\n";
  31. $ntype = '';
  32. $edtime = time();
  33. if(is_array($types))
  34. {
  35. foreach($types as $v) $ntype .= $v.' ';
  36. }
  37. if($ntype!='') $atts .= " type='".trim($ntype)."' ";
  38. if(!empty($typeid)) $atts .= " typeid='$typeid' ";
  39. if(!empty($channel)) $atts .= " channel='$channel' ";
  40. if(!empty($subday)) $atts .= " subday='$subday' ";
  41. if(!empty($keywordarc)) $atts .= " keyword='$keywordarc' ";
  42. if(!empty($att)) $atts .= " att='$att' ";
  43. $innertext = trim($innertext);
  44. if(!empty($innertext)) $innertext = stripslashes($innertext);
  45. $listTag = "{dede:list $atts}$innertext{/dede:list}";
  46. $listTag = addslashes($listTag);
  47. $inquery = "
  48. UPDATE `#@__freelist` set
  49. title='$title', namerule='$namerule',
  50. listdir='$listdir', defaultpage='$defaultpage',
  51. nodefault='$nodefault', templet='$templet',
  52. edtime='$edtime', `maxpage`='$maxpage', listtag='$listTag', keywords='$keywords',
  53. description='$description' WHERE aid='$aid';
  54. ";
  55. $dsql->ExecuteNoneQuery($inquery);
  56. ShowMsg("成功更改一个自由列表!","freelist_main.php");
  57. exit();
  58. }