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

album_edit.php 6.6KB

1 year ago
2 years ago
2 years ago
2 years ago
1 year ago
1 year ago
1 year ago
2 years ago
1 year ago
2 years ago
2 years ago
2 years ago
2 years ago
1 year ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  1. <?php
  2. /**
  3. * 图片修改
  4. *
  5. * @version $id:album_edit.php 13:52 2010年7月9日 tianya $
  6. * @package DedeBIZ.User
  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. CheckRank(0, 0);
  13. if ($cfg_mb_lit == 'Y') {
  14. ShowMsg("由于系统开启会员空间精简版,您浏览的功能不可用", "-1");
  15. exit();
  16. }
  17. if ($cfg_mb_album == 'N') {
  18. ShowMsg("由于系统关闭了图片功能,您浏览的功能不可用", "-1");
  19. exit();
  20. }
  21. require_once(DEDEINC."/dedetag.class.php");
  22. require_once(DEDEINC."/customfields.func.php");
  23. require_once(DEDEMEMBER."/inc/inc_catalog_options.php");
  24. require_once(DEDEMEMBER."/inc/inc_archives_functions.php");
  25. $channelid = isset($channelid) && is_numeric($channelid) ? $channelid : 2;
  26. $aid = isset($aid) && is_numeric($aid) ? $aid : 0;
  27. $menutype = 'content';
  28. if (empty($formhtml)) $formhtml = 0;
  29. if ($cfg_ml->IsSendLimited()) {
  30. ShowMsg("文档发布失败,投稿已经超出投稿限制次数:{$cfg_ml->M_SendMax}次", "-1", "0", 5000);
  31. exit();
  32. }
  33. /*-------------
  34. function _ShowForm(){ }
  35. --------------*/
  36. if (empty($dopost)) {
  37. //读取归档信息
  38. $arcQuery = "SELECT arc.*,ch.addtable,ch.fieldset,ch.arcsta FROM `#@__archives` arc LEFT JOIN `#@__channeltype` ch ON ch.id=arc.channel WHERE arc.id='$aid' AND arc.mid='".$cfg_ml->M_ID."'; ";
  39. $row = $dsql->GetOne($arcQuery);
  40. if (!is_array($row)) {
  41. ShowMsg("读取文档信息出错", "-1");
  42. exit();
  43. } else if ($row['arcrank'] >= 0) {
  44. $dtime = time();
  45. $maxtime = $cfg_mb_editday * 24 * 3600;
  46. if ($dtime - $row['senddate'] > $maxtime) {
  47. ShowMsg("这篇文档已经锁定,暂时无法修改", "-1");
  48. exit();
  49. }
  50. }
  51. $addRow = $dsql->GetOne("SELECT * FROM `{$row['addtable']}` WHERE aid='$aid'; ");
  52. $dtp = new DedeTagParse();
  53. $dtp->LoadSource($addRow['imgurls']);
  54. $abinfo = $dtp->GetTagByName('pagestyle');
  55. $row = XSSClean($row);
  56. $addRow = XSSClean($addRow);
  57. include(DEDEMEMBER."/templets/album_edit.htm");
  58. exit();
  59. }
  60. /*------------------------------
  61. function _Save(){ }
  62. ------------------------------*/
  63. else if ($dopost == 'save') {
  64. $cInfos = $dsql->GetOne("SELECT * FROM `#@__channeltype` WHERE id='$channelid'; ");
  65. $maxwidth = isset($maxwidth) && is_numeric($maxwidth) ? $maxwidth : 800;
  66. $pagepicnum = isset($pagepicnum) && is_numeric($pagepicnum) ? $pagepicnum : 12;
  67. $ddmaxwidth = isset($ddmaxwidth) && is_numeric($ddmaxwidth) ? $ddmaxwidth : 200;
  68. $prow = isset($prow) && is_numeric($prow) ? $prow : 3;
  69. $pcol = isset($pcol) && is_numeric($pcol) ? $pcol : 3;
  70. $pagestyle = in_array($pagestyle, array('1', '2', '3')) ? $pagestyle : 2;
  71. include(DEDEMEMBER.'/inc/archives_check_edit.php');
  72. $imgurls = "{dede:pagestyle maxwidth='$maxwidth' pagepicnum='$pagepicnum'
  73. ddmaxwidth='$ddmaxwidth' row='$prow' col='$pcol' value='$pagestyle'/}\r\n";
  74. $hasone = false;
  75. $ddisfirst = 1;
  76. //只支持填写地址
  77. for ($i = 1; $i <= 120; $i++) {
  78. if (!isset(${'imgfile'.$i})) {
  79. continue;
  80. }
  81. $f = ${'imgfile'.$i};
  82. $msg = isset(${'imgmsg'.$i}) ? ${'imgmsg'.$i} : "";
  83. if (!empty($f) && filter_var($f, FILTER_VALIDATE_URL)) {
  84. $u = str_replace(array("\"", "'"), "`", $f);
  85. $info = str_replace(array("\"", "'"), "`", $msg);
  86. $imgurls .= "{dede:img ddimg='' text='$info'} $u {/dede:img}\r\n";
  87. }
  88. } //循环结束
  89. $imgurls = addslashes($imgurls);
  90. //分析处理附加表数据
  91. $inadd_f = '';
  92. if (!empty($dede_addonfields)) {
  93. $addonfields = explode(';', $dede_addonfields);
  94. if (is_array($addonfields)) {
  95. foreach ($addonfields as $v) {
  96. if ($v == '') {
  97. continue;
  98. }
  99. $vs = explode(',', $v);
  100. if (!isset(${$vs[0]})) {
  101. ${$vs[0]} = '';
  102. }
  103. ${$vs[0]} = GetFieldValueA(${$vs[0]}, $vs[1], $aid);
  104. $inadd_f .= ','.$vs[0]." ='".${$vs[0]}."' ";
  105. $inadd_m .= ','.$vs[0];
  106. }
  107. }
  108. //这里对前台提交的附加数据进行一次校验
  109. $fontiterm = PrintAutoFieldsAdd(stripslashes($cInfos['fieldset']), 'autofield', FALSE);
  110. if ($fontiterm != $inadd_m) {
  111. ShowMsg("提交表单同系统配置不相符,请重新提交", "-1");
  112. exit();
  113. }
  114. }
  115. $description = HtmlReplace($description, -1);
  116. //更新数据库的SQL语句
  117. //更新数据库的SQL语句
  118. $upQuery = "UPDATE `#@__archives` SET ismake='$ismake',arcrank='$arcrank',typeid='$typeid',title='$title',description='$description',keywords='$keywords',mtype='$mtypesid',flag='$flag' WHERE id='$aid' AND mid='$mid'; ";
  119. if (!$dsql->ExecuteNoneQuery($upQuery)) {
  120. ShowMsg("数据保存到数据库主表`#@__archives`时出错,请联系管理员".$dsql->GetError(), "-1");
  121. exit();
  122. }
  123. $isrm = 0;
  124. if ($addtable != '') {
  125. $query = "UPDATE `$addtable` SET typeid='$typeid',pagestyle='$pagestyle',maxwidth='$maxwidth',ddmaxwidth='$ddmaxwidth',pagepicnum='$pagepicnum',imgurls='$imgurls',`row`='$prow',col='$pcol',userip='$userip',isrm='$isrm' {$inadd_f} WHERE aid='$aid'; ";
  126. if (!$dsql->ExecuteNoneQuery($query)) {
  127. ShowMsg("数据保存到数据库附加表时出错,请联系管理员".$dsql->GetError(), "javascript:;");
  128. exit();
  129. }
  130. }
  131. UpIndexKey($aid, $arcrank, $typeid, $sortrank, $tags);
  132. $artUrl = MakeArt($aid, TRUE);
  133. if ($artUrl == '') $artUrl = $cfg_phpurl."/view.php?aid=$aid";
  134. //返回成功信息
  135. $msg = "请选择您的后续操作:<a href='album_add.php?cid=$typeid' class='btn btn-success btn-sm'>发布新图片</a><a href='archives_do.php?channelid=$channelid&aid=".$aid."&dopost=edit' class='btn btn-success btn-sm'>修改图片</a><a href='$artUrl' target='_blank' class='btn btn-success btn-sm'>查看图片</a><a href='content_list.php?channelid=$channelid' class='btn btn-success btn-sm'>管理图片</a> ";
  136. //提交后返回提交页面
  137. $wintitle = "成功修改图片";
  138. $wecome_info = "图片管理::修改图片";
  139. $win = new OxWindow();
  140. $win->AddTitle("成功修改图片");
  141. $win->AddMsgItem($msg);
  142. $winform = $win->GetWindow("hand", "&nbsp;", false);
  143. $win->Display(DEDEMEMBER."/templets/win_templet.htm");
  144. }
  145. ?>