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

60 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 - 2019, DesDev, Inc.
  8. * @license http://help.dedecms.com/usersguide/license.html
  9. * @link http://www.dedecms.com
  10. */
  11. require_once(dirname(__FILE__)."/config.php");
  12. if(empty($dopost))
  13. {
  14. require_once DEDEINC.'/typelink.class.php';
  15. require_once DEDEINC.'/dedetag.class.php';
  16. $aid = isset($aid) && is_numeric($aid) ? $aid : 0;
  17. $row = $dsql->GetOne("Select * From `#@__freelist` where aid='$aid' ");
  18. $dtp = new DedeTagParse();
  19. $dtp->SetNameSpace("dede","{","}");
  20. $dtp->LoadSource("--".$row['listtag']."--");
  21. $ctag = $dtp->GetTag('list');
  22. include DedeInclude('templets/freelist_edit.htm');
  23. exit();
  24. }
  25. else if( $dopost=='save' )
  26. {
  27. if(!isset($types)) $types = '';
  28. if(!isset($nodefault)) $nodefault = '0';
  29. $atts = " pagesize='$pagesize' col='$col' titlelen='$titlelen' orderby='$orderby' orderway='$order' \r\n";
  30. $ntype = '';
  31. $edtime = time();
  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. UPDATE `#@__freelist` set
  48. title='$title', namerule='$namerule',
  49. listdir='$listdir', defaultpage='$defaultpage',
  50. nodefault='$nodefault', templet='$templet',
  51. edtime='$edtime', `maxpage`='$maxpage', listtag='$listTag', keywords='$keywords',
  52. description='$description' WHERE aid='$aid';
  53. ";
  54. $dsql->ExecuteNoneQuery($inquery);
  55. ShowMsg("成功更改一个自由列表!","freelist_main.php");
  56. exit();
  57. }