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

58 lines
2.2KB

  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) 2020, 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.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 (is_array($types)) {
  30. foreach ($types as $v) $ntype .= $v . ' ';
  31. }
  32. if ($ntype != '') $atts .= " type='" . trim($ntype) . "' ";
  33. if (!empty($typeid)) $atts .= " typeid='$typeid' ";
  34. if (!empty($channel)) $atts .= " channel='$channel' ";
  35. if (!empty($subday)) $atts .= " subday='$subday' ";
  36. if (!empty($keywordarc)) $atts .= " keyword='$keywordarc' ";
  37. if (!empty($att)) $atts .= " att='$att' ";
  38. $innertext = trim($innertext);
  39. if (!empty($innertext)) $innertext = stripslashes($innertext);
  40. $listTag = "{dede:list $atts}$innertext{/dede:list}";
  41. $listTag = addslashes($listTag);
  42. $inquery = "
  43. UPDATE `#@__freelist` set
  44. title='$title', namerule='$namerule',
  45. listdir='$listdir', defaultpage='$defaultpage',
  46. nodefault='$nodefault', templet='$templet',
  47. edtime='$edtime', `maxpage`='$maxpage', listtag='$listTag', keywords='$keywords',
  48. description='$description' WHERE aid='$aid';
  49. ";
  50. $dsql->ExecuteNoneQuery($inquery);
  51. ShowMsg("成功更改一个自由列表!", "freelist_main.php");
  52. exit();
  53. }