国内流行的内容管理系统(CMS)多端全媒体解决方案 https://www.dedebiz.com
選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

archives_sg_edit.php 5.3KB

2年前
2年前
2年前
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. <?php
  2. /**
  3. * 单表模型文档编辑
  4. *
  5. * @version $id:archives_sg_edit.php 8:26 2010年7月12日 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. CheckPurview('a_Edit,a_AccEdit,a_MyEdit');
  13. require_once(DEDEINC."/customfields.func.php");
  14. require_once(DEDEADMIN."/inc/inc_archives_functions.php");
  15. if (empty($dopost)) $dopost = '';
  16. if ($dopost != 'save') {
  17. require_once(DEDEADMIN."/inc/inc_catalog_options.php");
  18. require_once(DEDEINC."/dedetag.class.php");
  19. ClearMyAddon();
  20. $aid = intval($aid);
  21. //读取归档信息
  22. $arcQuery = "SELECT ch.*,arc.* FROM `#@__arctiny` arc LEFT JOIN `#@__channeltype` ch on ch.id=arc.channel WHERE arc.id='$aid' ";
  23. $cInfos = $dsql->GetOne($arcQuery);
  24. if (!is_array($cInfos)) {
  25. ShowMsg("读栏目模型信息出错", "-1");
  26. exit();
  27. }
  28. $addtable = $cInfos['addtable'];
  29. $addRow = $dsql->GetOne("SELECT arc.*,ar.membername as rankname FROM `$addtable` arc LEFT JOIN `#@__arcrank` ar on ar.`rank`=arc.arcrank WHERE arc.aid='$aid'");
  30. $channelid = $cInfos['channel'];
  31. $tags = GetTags($aid);
  32. include DedeInclude('templets/archives_sg_edit.htm');
  33. exit();
  34. }
  35. /*--------------------------------
  36. function __save(){ }
  37. -------------------------------*/
  38. else if ($dopost == 'save') {
  39. require_once(DEDEINC.'/image.func.php');
  40. require_once(DEDEINC.'/libraries/oxwindow.class.php');
  41. if ($typeid == 0) {
  42. ShowMsg("请指定文档的栏目", "-1");
  43. exit();
  44. }
  45. if (empty($channelid)) {
  46. ShowMsg("文档为非指定的类型,请检查您发布内容的表单是否合法", "-1");
  47. exit();
  48. }
  49. if (!CheckChannel($typeid, $channelid)) {
  50. ShowMsg("您所选择的栏目与当前模型不相符,请选择白色的选项", "-1");
  51. exit();
  52. }
  53. if (!TestPurview('a_Edit')) {
  54. if (TestPurview('a_AccEdit')) {
  55. CheckCatalog($typeid, "对不起,您没有操作栏目 {$typeid} 的文档权限");
  56. } else {
  57. CheckArcAdmin($id, $cuserLogin->getUserID());
  58. }
  59. }
  60. //对保存的内容进行处理
  61. if (empty($flags)) $flag = '';
  62. else $flag = join(',', $flags);
  63. $title = cn_substrR($title, $cfg_title_maxlen);
  64. $isremote = 0;
  65. $serviterm = empty($serviterm) ? "" : $serviterm;
  66. if (!TestPurview('a_Check,a_AccCheck,a_MyCheck')) $arcrank = -1;
  67. $adminid = $cuserLogin->getUserID();
  68. //处理上传的缩略图
  69. if (empty($ddisremote)) $ddisremote = 0;
  70. $litpic = GetDDImage('none', $picname, $ddisremote);
  71. //分析处理附加表数据
  72. $inadd_f = '';
  73. $inadd_v = '';
  74. if (!empty($dede_addonfields)) {
  75. $addonfields = explode(';', $dede_addonfields);
  76. $inadd_f = '';
  77. $inadd_v = '';
  78. if (is_array($addonfields)) {
  79. foreach ($addonfields as $v) {
  80. if ($v == '') {
  81. continue;
  82. }
  83. $vs = explode(',', $v);
  84. if ($vs[1] == 'htmltext' || $vs[1] == 'textdata') //网页文本特殊处理
  85. {
  86. ${$vs[0]} = AnalyseHtmlBody(${$vs[0]}, $description, $litpic, $keywords, $vs[1]);
  87. } else {
  88. if (!isset(${$vs[0]})) {
  89. ${$vs[0]} = '';
  90. }
  91. ${$vs[0]} = GetFieldValueA(${$vs[0]}, $vs[1], $id);
  92. }
  93. $inadd_f .= ",`{$vs[0]}` = '".${$vs[0]}."'";
  94. }
  95. }
  96. }
  97. //处理图片文档的自定义属性
  98. if ($litpic != '' && !preg_match("#p#", $flag)) {
  99. $flag = ($flag == '' ? 'p' : $flag.',p');
  100. }
  101. $cts = $dsql->GetOne("SELECT addtable FROM `#@__channeltype` WHERE id='$channelid' ");
  102. $addtable = trim($cts['addtable']);
  103. if ($addtable != '') {
  104. $iquery = "UPDATE `$addtable` SET typeid='$typeid',arcrank='$arcrank',title='$title',flag='$flag',litpic='$litpic'{$inadd_f} WHERE aid='$id' ";
  105. if (!$dsql->ExecuteNoneQuery($iquery)) {
  106. ShowMsg("数据保存到数据库附加表时出错,请检查数据库字段", "javascript:;");
  107. exit();
  108. }
  109. }
  110. //生成网页
  111. UpIndexKey($id, $arcrank, $typeid, $sortrank, '');
  112. $artUrl = MakeArt($id, TRUE, TRUE, $isremote);
  113. if ($artUrl == '') $artUrl = $cfg_phpurl."/view.php?aid=$id";
  114. ClearMyAddon($id, $title);
  115. //返回成功信息
  116. $msg = "请选择您的后续操作:<a href='archives_sg_add.php?cid=$typeid' class='btn btn-success btn-sm'>发布新分类</a><a href='archives_do.php?aid=".$id."&dopost=editArchives' class='btn btn-success btn-sm'>修改分类</a><a href='$artUrl' target='_blank' class='btn btn-success btn-sm'>查看分类</a><a href='catalog_do.php?cid=$typeid&channelid={$channelid}&dopost=listArchives' class='btn btn-success btn-sm'>管理分类</a><a href='catalog_main.php' class='btn btn-success btn-sm'>网站栏目管理</a>";
  117. $wintitle = "成功修改分类";
  118. $wecome_info = "文档管理::修改分类";
  119. $win = new OxWindow();
  120. $win->AddTitle("成功修改分类");
  121. $win->AddMsgItem($msg);
  122. $winform = $win->GetWindow("hand", "&nbsp;", false);
  123. $win->Display();
  124. }
  125. ?>