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

soft_edit.php 9.9KB

2 anni fa
1 anno fa
2 anni fa
2 anni fa
2 anni fa
2 anni fa
2 anni fa
2 anni fa
2 anni fa
2 anni fa
2 anni fa
2 anni fa
2 anni fa
1 anno fa
2 anni fa
2 anni fa
2 anni fa
2 anni fa
2 anni fa
2 anni fa
2 anni fa
1 anno fa
2 anni fa
2 anni fa
2 anni fa
2 anni fa
2 anni fa
2 anni fa
2 anni fa
2 anni fa
2 anni fa
2 anni fa
2 anni fa
2 anni fa
2 anni fa
2 anni fa
2 anni fa
2 anni fa
2 anni fa
2 anni fa
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224
  1. <?php
  2. /**
  3. * 软件修改
  4. *
  5. * @version $id:soft_edit.php 16:09 2010年7月20日 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 = preg_replace("#[^0-9]#", '', $aid);
  21. $channelid = "3";
  22. //读取归档信息
  23. $arcQuery = "SELECT `#@__channeltype`.typename as channelname, `#@__arcrank`.membername as rankname, `#@__archives`.* FROM `#@__archives` LEFT JOIN `#@__channeltype` ON `#@__channeltype`.id=`#@__archives`.channel LEFT JOIN `#@__arcrank` ON `#@__arcrank`.`rank`=`#@__archives`.arcrank WHERE `#@__archives`.id='$aid'";
  24. $dsql->SetQuery($arcQuery);
  25. $arcRow = $dsql->GetOne($arcQuery);
  26. if (!is_array($arcRow)) {
  27. ShowMsg("读取文档基本信息出错", "-1");
  28. exit();
  29. }
  30. $query = "SELECT * FROM `#@__channeltype` WHERE id='".$arcRow['channel']."'";
  31. $cInfos = $dsql->GetOne($query);
  32. if (!is_array($cInfos)) {
  33. ShowMsg("读取栏目配置信息出错", "javascript:;");
  34. exit();
  35. }
  36. $addtable = $cInfos['addtable'];
  37. $addQuery = "SELECT * FROM `$addtable` WHERE aid='$aid'";
  38. $addRow = $dsql->GetOne($addQuery);
  39. $newRowStart = 1;
  40. $nForm = '';
  41. $daccess = $addRow['daccess'];
  42. $needmoney = $addRow['needmoney'];
  43. if ($addRow['softlinks'] != '') {
  44. $dtp = new DedeTagParse();
  45. $dtp->LoadSource($addRow['softlinks']);
  46. if (is_array($dtp->CTags)) {
  47. foreach ($dtp->CTags as $ctag) {
  48. if ($ctag->GetName() == 'link') {
  49. $islocal = $ctag->GetAtt('islocal');
  50. if ($islocal != 1) $needmsg = "<label><input type='checkbox' name='del{$newRowStart}' value='1'> 删除</label>";
  51. else $needmsg = '<button name="sel1" class="btn btn-success btn-sm" type="button" id="sel1" onClick="SelectSoft(\'form1.softurl'.$newRowStart.'\')">选取</button>';
  52. $nForm .= "<div class='py-2'>软件地址{$newRowStart}:<input type='text' name='softurl{$newRowStart}' value='".trim($ctag->GetInnerText())."' class='admin-input-md'> 服务器名称:<input type='text' name='servermsg{$newRowStart}' value='".$ctag->GetAtt("text")."' class='admin-input-sm'>
  53. <input type='hidden' name='islocal{$newRowStart}' value='{$islocal}'>
  54. $needmsg
  55. </div>\r\n";
  56. $newRowStart++;
  57. }
  58. }
  59. }
  60. $dtp->Clear();
  61. }
  62. $channelid = $arcRow['channel'];
  63. $tags = GetTags($aid);
  64. $arcRow = XSSClean($arcRow);
  65. $addRow = XSSClean($addRow);
  66. include DedeInclude("templets/soft_edit.htm");
  67. exit();
  68. }
  69. /*--------------------------------
  70. function __save(){ }
  71. -------------------------------*/
  72. else if ($dopost == 'save') {
  73. require_once(DEDEINC.'/image.func.php');
  74. require_once(DEDEINC.'/libraries/oxwindow.class.php');
  75. $flag = isset($flags) ? join(',', $flags) : '';
  76. $notpost = isset($notpost) && $notpost == 1 ? 1 : 0;
  77. if (empty($typeid2)) $typeid2 = 0;
  78. if (!isset($autokey)) $autokey = 0;
  79. if (!isset($remote)) $remote = 0;
  80. if (!isset($dellink)) $dellink = 0;
  81. if (!isset($autolitpic)) $autolitpic = 0;
  82. if ($typeid == 0) {
  83. ShowMsg("请指定文档的栏目", "-1");
  84. exit();
  85. }
  86. if (empty($channelid)) {
  87. ShowMsg("文档为非指定的类型,请检查您发布文档的表单是否合法", "-1");
  88. exit();
  89. }
  90. if (!CheckChannel($typeid, $channelid)) {
  91. ShowMsg("您所选择的栏目与当前模型不相符,请重新选择", "-1");
  92. exit();
  93. }
  94. if (!TestPurview('a_Edit')) {
  95. CheckCatalog($typeid, "您没有操作栏目<span class='text-primary'>{$typeid}</span>文档权限");
  96. }
  97. //对保存的文档进行处理
  98. $pubdate = GetMkTime($pubdate);
  99. $senddate = time();
  100. $sortrank = AddDay($pubdate, $sortup);
  101. if ($ishtml == 0) {
  102. $ismake = -1;
  103. } else {
  104. $ismake = 0;
  105. }
  106. $title = cn_substrR($title, $cfg_title_maxlen);
  107. $shorttitle = cn_substrR($shorttitle, 36);
  108. $color = cn_substrR($color, 7);
  109. $writer = cn_substrR($writer, 20);
  110. $source = cn_substrR($source, 30);
  111. $description = cn_substrR($description, $cfg_auot_description);
  112. $keywords = cn_substrR($keywords, 60);
  113. $filename = trim(cn_substrR($filename, 40));
  114. $isremote = 0;
  115. $serviterm = empty($serviterm) ? "" : $serviterm;
  116. if (!TestPurview('a_Check,a_AccCheck,a_MyCheck')) {
  117. $arcrank = -1;
  118. }
  119. $adminid = $cuserLogin->getUserID();
  120. //处理上传的缩略图
  121. if (empty($ddisremote)) {
  122. $ddisremote = 0;
  123. }
  124. $litpic = GetDDImage('litpic', $picname, $ddisremote);
  125. //分析处理附加表数据
  126. $inadd_f = '';
  127. $inadd_v = '';
  128. if (!empty($dede_addonfields)) {
  129. $addonfields = explode(';', $dede_addonfields);
  130. $inadd_f = '';
  131. $inadd_v = '';
  132. if (is_array($addonfields)) {
  133. foreach ($addonfields as $v) {
  134. if ($v == '') {
  135. continue;
  136. }
  137. $vs = explode(',', $v);
  138. if ($vs[1] == 'htmltext' || $vs[1] == 'textdata') //网页文本特殊处理
  139. {
  140. ${$vs[0]} = AnalyseHtmlBody(${$vs[0]}, $description, $litpic, $keywords, $vs[1]);
  141. } else {
  142. if (!isset(${$vs[0]})) {
  143. ${$vs[0]} = '';
  144. }
  145. ${$vs[0]} = GetFieldValueA(${$vs[0]}, $vs[1], $id);
  146. }
  147. $inadd_f .= ",`{$vs[0]}` = '".${$vs[0]}."'";
  148. }
  149. }
  150. }
  151. //处理图片文档的自定义属性
  152. if ($litpic != '' && !preg_match('#p#', $flag)) {
  153. $flag = ($flag == '' ? 'p' : $flag.',p');
  154. }
  155. if ($redirecturl != '' && !preg_match('#j#', $flag)) {
  156. $flag = ($flag == '' ? 'j' : $flag.',j');
  157. }
  158. //跳转网址的文档强制为动态
  159. if (preg_match('#j#', $flag)) $ismake = -1;
  160. //修改主文档表
  161. $inQuery = "UPDATE `#@__archives` SET typeid='$typeid',typeid2='$typeid2',sortrank='$sortrank',flag='$flag',click='$click',ismake='$ismake',arcrank='$arcrank',`money`='$money',title='$title',color='$color',source='$source',writer='$writer',litpic='$litpic',pubdate='$pubdate',notpost='$notpost',description='$description',keywords='$keywords',shorttitle='$shorttitle',filename='$filename',dutyadmin='$adminid',weight='$weight' WHERE id='$id'; ";
  162. if (!$dsql->ExecuteNoneQuery($inQuery)) {
  163. ShowMsg("数据保存到数据库主表`#@__archives`时出错,请检查数据库字段", "-1");
  164. exit();
  165. }
  166. //软件链接列表
  167. $urls = '';
  168. for ($i = 1; $i <= 30; $i++) {
  169. if (!empty(${'softurl'.$i})) {
  170. $islocal = empty(${'islocal'.$i}) ? '' : 1;
  171. $isneed = empty(${'del'.$i}) ? true : false;
  172. $servermsg = str_replace("'", '', stripslashes(${'servermsg'.$i}));
  173. $softurl = stripslashes(${'softurl'.$i});
  174. if ($servermsg == '') {
  175. $servermsg = '下载地址'.$i;
  176. }
  177. if ($softurl != 'http://') {
  178. if ($islocal == 1) $urls .= "{dede:link islocal='$islocal' text='{$servermsg}'} $softurl {/dede:link}\r\n";
  179. else if ($isneed) $urls .= "{dede:link text='$servermsg'} $softurl {/dede:link}\r\n";
  180. else continue;
  181. }
  182. }
  183. }
  184. $urls = addslashes($urls);
  185. //更新附加表
  186. $cts = $dsql->GetOne("SELECT addtable FROM `#@__channeltype` WHERE id='$channelid' ");
  187. $addtable = trim($cts['addtable']);
  188. if ($addtable != '') {
  189. $useip = GetIP();
  190. $inQuery = "UPDATE `$addtable` SET typeid='$typeid',filetype='$filetype',language='$language',softtype='$softtype',accredit='$accredit',os='$os',softrank='$softrank',officialUrl ='$officialUrl',officialDemo ='$officialDemo',softsize='$softsize',softlinks='$urls',redirecturl='$redirecturl',userip='$useip',daccess='$daccess',needmoney='$needmoney',introduce='$body' {$inadd_f} WHERE aid='$id';";
  191. if (!$dsql->ExecuteNoneQuery($inQuery)) {
  192. ShowMsg("数据保存到数据库附加表时出错,请检查数据库字段", "-1");
  193. exit();
  194. }
  195. }
  196. //生成网页
  197. UpIndexKey($id, $arcrank, $typeid, $sortrank, $tags);
  198. $arcUrl = MakeArt($id, TRUE, TRUE, $isremote);
  199. if ($arcUrl == "") {
  200. $arcUrl = $cfg_phpurl."/view.php?aid=$id";
  201. }
  202. ClearMyAddon($id, $title);
  203. //自动更新关联文档
  204. if (is_array($automake)) {
  205. foreach ($automake as $key => $value) {
  206. if (isset(${$key}) && !empty(${$key})) {
  207. $ids = explode(",", ${$key});
  208. foreach ($ids as $id) {
  209. MakeArt($id, true, true, $isremote);
  210. }
  211. }
  212. }
  213. }
  214. //返回成功信息
  215. $msg = "请选择您的后续操作:<a href='soft_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='$arcUrl' target='_blank' class='btn btn-success btn-sm'>查看软件</a><a href='catalog_do.php?cid=$typeid&dopost=listArchives' class='btn btn-success btn-sm'>已发布软件管理</a><a href='catalog_main.php' class='btn btn-success btn-sm'>网站栏目管理</a>";
  216. $wintitle = "成功修改一个软件";
  217. $wecome_info = "文档管理::修改软件";
  218. $win = new OxWindow();
  219. $win->AddTitle("成功修改软件");
  220. $win->AddMsgItem($msg);
  221. $winform = $win->GetWindow("hand", "&nbsp;", FALSE);
  222. $win->Display();
  223. }
  224. ?>