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

46 lines
2.0KB

  1. <?php
  2. /**
  3. * 编辑自由列表
  4. *
  5. * @version $Id: freelist_edit.php 1 8:48 2010年7月13日Z 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. use DedeBIZ\Template\DedeTagParse;
  12. require_once(dirname(__FILE__)."/config.php");
  13. if (empty($dopost)) {
  14. $aid = isset($aid) && is_numeric($aid) ? $aid : 0;
  15. $row = $dsql->GetOne("SELECT * FROM `#@__freelist` WHERE aid='$aid'");
  16. $dtp = new DedeTagParse();
  17. $dtp->SetNameSpace("dede", "{", "}");
  18. $dtp->LoadSource("--".$row['listtag']."--");
  19. $ctag = $dtp->GetTag('list');
  20. include DedeInclude('templets/freelist_edit.htm');
  21. exit();
  22. } else if ($dopost == 'save') {
  23. if (!isset($types)) $types = '';
  24. if (!isset($nodefault)) $nodefault = '0';
  25. $atts = " pagesize='$pagesize' col='$col' titlelen='$titlelen' orderby='$orderby' orderway='$order' \r\n";
  26. $ntype = '';
  27. $edtime = time();
  28. if (is_array($types)) {
  29. foreach ($types as $v) $ntype .= $v.' ';
  30. }
  31. if ($ntype != '') $atts .= " type='".trim($ntype)."' ";
  32. if (!empty($typeid)) $atts .= " typeid='$typeid' ";
  33. if (!empty($channel)) $atts .= " channel='$channel' ";
  34. if (!empty($subday)) $atts .= " subday='$subday' ";
  35. if (!empty($keywordarc)) $atts .= " keyword='$keywordarc' ";
  36. if (!empty($att)) $atts .= " att='$att' ";
  37. $innertext = trim($innertext);
  38. if (!empty($innertext)) $innertext = stripslashes($innertext);
  39. $listTag = "{dede:list $atts}$innertext{/dede:list}";
  40. $listTag = addslashes($listTag);
  41. $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';";
  42. $dsql->ExecuteNoneQuery($inquery);
  43. ShowMsg(Lang("freelist_edit_success"), "freelist_main.php");
  44. exit();
  45. }
  46. ?>