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

55 lines
2.3KB

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