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

477 lines
18KB

  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1">
  6. <title>修改图片模型</title>
  7. <link rel="stylesheet" href="../static/web/font/css/font-awesome.min.css">
  8. <link rel="stylesheet" href="../static/web/css/bootstrap.min.css">
  9. <link rel="stylesheet" href="../static/web/css/admin.css">
  10. <link rel="stylesheet" href="../static/web/css/daterangepicker.css">
  11. <link rel="stylesheet" href="../static/web/css/cropper.min.css">
  12. <link rel="stylesheet" href="css/albumupload.min.css">
  13. <script>const cfg_uplitpic_cut = '<?php echo $cfg_uplitpic_cut;?>';</script>
  14. <script src="../static/web/js/jquery.min.js"></script>
  15. <script src="../static/web/js/bootstrap.min.js"></script>
  16. <script src="../static/web/js/webajax.js"></script>
  17. <script src="../static/web/js/moment.min.js"></script>
  18. <script src="../static/web/js/daterangepicker.js"></script>
  19. <script src="js/main.js"></script>
  20. <script src="js/album.js"></script>
  21. <script src="js/handlers.js"></script>
  22. <script src="../static/web/js/cropper.min.js"></script>
  23. </head>
  24. <body>
  25. <form name="form1" action="album_edit.php" enctype="multipart/form-data" method="post" onSubmit="return checkSubmitAlb();">
  26. <input type="hidden" name="channelid" value="<?php echo $channelid?>">
  27. <input type="hidden" name="id" value="<?php echo $aid?>">
  28. <input type="hidden" name="imagebody" value="">
  29. <input type="hidden" name="dopost" value="save">
  30. <input type="hidden" id="albums" name="albums" value="">
  31. <table width="98%" align="center" id="needset" class="admin-border my-3">
  32. <tr bgcolor="#f5f5f5">
  33. <td class="admin-td">修改图片文档</td>
  34. </tr>
  35. <tr>
  36. <td class="admin-td">
  37. <table>
  38. <tr>
  39. <td width="90">图片标题:</td>
  40. <td width="400"><input type="text" name="title" id="title" value="<?php echo $arcRow['title'];?>" class="admin-input-lg"></td>
  41. <td width="90">简略标题:</td>
  42. <td><input type="text" name="shorttitle" id="shorttitle" value="<?php echo $arcRow['shorttitle'];?>" class="admin-input-sm"></td>
  43. </tr>
  44. </table>
  45. </td>
  46. </tr>
  47. <tr>
  48. <td class="admin-td">
  49. <table>
  50. <tr>
  51. <td width="90">自定义属性:</td>
  52. <td>
  53. <?php
  54. $dsql->SetQuery("SELECT * FROM `#@__arcatt` ORDER BY sortid ASC");
  55. $dsql->Execute();
  56. while($trow = $dsql->GetObject())
  57. {
  58. if ($trow->att=='j') $jumpclick = " onclick='ShowUrlTr()'";
  59. else $jumpclick = '';
  60. if (preg_match("#".$trow->att."#", $arcRow['flag']))
  61. echo "<label class='mr-2'><input type='checkbox' name='flags[]' id='flags{$trow->att}' value='{$trow->att}' {$jumpclick} checked='checked'> {$trow->attname}[{$trow->att}]</label>";
  62. else
  63. echo "<label class='mr-2'><input type='checkbox' name='flags[]' id='flags{$trow->att}' value='{$trow->att}'{$jumpclick} /> {$trow->attname}[{$trow->att}]</label>";
  64. }
  65. ?>
  66. </td>
  67. </tr>
  68. </table>
  69. </td>
  70. </tr>
  71. <tr>
  72. <td class="admin-td" id="redirecturltr" style="display:<?php echo (empty($addRow['redirecturl']) ? 'none' : 'block');?>">
  73. <table>
  74. <tr>
  75. <td width="90">跳转网址:</td>
  76. <td><input type="text" name="redirecturl" id="redirecturl" value="<?php echo $addRow['redirecturl']?>" class="admin-input-lg"></td>
  77. </tr>
  78. </table>
  79. </td>
  80. </tr>
  81. <tr>
  82. <td class="admin-td">
  83. <table>
  84. <tr>
  85. <td width="90">标签:</td>
  86. <td><input type="text" name="tags" id="tags" value="<?php echo $tags;?>" class="admin-input-lg">(英文逗号分开,如“DedeBIZ,得德”)</td>
  87. <td width="60">权重:</td>
  88. <td><input type="text" name="weight" id="weight" value="<?php echo $arcRow['weight'];?>" class="admin-input-sm">(越小越靠前)</td>
  89. </tr>
  90. </table>
  91. </td>
  92. </tr>
  93. <tr id="pictable">
  94. <td class="admin-td">
  95. <table>
  96. <tr>
  97. <td width="90">缩略图:</td>
  98. <td width="620">
  99. <input type="text" name="picname" id="picname" value="<?php echo $arcRow['litpic']?>" class="admin-input-lg">
  100. <label><input type="checkbox" name="ddisremote" value="1" id="ddisremote" class="l-height-28"> 远程</label>
  101. <span class="btn btn-success btn-sm fileinput-button">上传图片<input type="file" name="files[]" id="iptAddImages"></span>
  102. <button type="button" name="Submit" onclick="SelectImage('form1.picname','');" class="btn btn-success btn-sm">选择图片</button>
  103. <button type="button" id="btnClearAll" class="btn btn-success btn-sm">清空</button>
  104. </td>
  105. <td><img src="<?php if ($arcRow['litpic']!='') echo $arcRow['litpic']; else echo '../static/web/img/thumbnail.jpg';?>" id="litPic" class="thumbnail-md"></td>
  106. </tr>
  107. </table>
  108. </td>
  109. </tr>
  110. <tr>
  111. <td class="admin-td">
  112. <table>
  113. <tr>
  114. <td width="90">来源:</td>
  115. <td width="260">
  116. <input type="text" name="source" id="source" value="<?php echo $arcRow['source']?>" class="admin-input-sm">
  117. <button type="button" name="selsource" id="selsource" class="btn btn-success btn-sm">选择</button>
  118. </td>
  119. <td width="90">作者:</td>
  120. <td>
  121. <input type="text" name="writer" id="writer" value="<?php echo $arcRow['writer']?>" class="admin-input-sm">
  122. <button type="button" name="selwriter" id="selwriter" class="btn btn-success btn-sm">选择</button>
  123. </td>
  124. </tr>
  125. </table>
  126. </td>
  127. </tr>
  128. <tr>
  129. <td class="admin-td">
  130. <table>
  131. <tr>
  132. <td width="90">发布栏目:</td>
  133. <td width="360">
  134. <?php
  135. $typeOptions = GetOptionList($arcRow['typeid'],$cuserLogin->getUserChannel(),$channelid);
  136. echo "<select name='typeid' id='typeid' class='admin-input-sm'>";
  137. if ($arcRow['typeid']=='0') echo "<option value='0' selected>请选择主分类</option>";
  138. echo $typeOptions;
  139. echo '</select>';
  140. ?>
  141. <i class="btn btn-sm fa fa-search" onclick="ShowCatMap(event,this,<?php echo $channelid;?>,'typeid','<?php echo $arcRow['typeid'];?>')" title="快捷选择"></i>
  142. </td>
  143. <td width="90">需要金币:</td>
  144. <td><input type="text" name="money" id="money" value="<?php echo $arcRow['money']?>" class="admin-input-sm"></td>
  145. </tr>
  146. </table>
  147. </td>
  148. </tr>
  149. <?php if ($cfg_need_typeid2=='Y') {?>
  150. <tr>
  151. <td class="admin-td">
  152. <table>
  153. <tr>
  154. <td width="90">副栏目:</td>
  155. <td>
  156. <span id="typeid2ct"></span>
  157. <input type="text" name="typeid2" id="typeid2" value="<?php echo ($arcRow['typeid2']=='0' ? '' : $arcRow['typeid2']);?>" class="admin-input-sm">
  158. <i class="btn btn-sm fa fa-search" onclick="ShowCatMap(event,this,<?php echo $channelid;?>,'typeid2','<?php echo $arcRow['typeid2'];?>')" title="选择副栏目"></i>
  159. </td>
  160. </tr>
  161. </table>
  162. </td>
  163. </tr>
  164. <tr>
  165. <td class="admin-td">
  166. <table>
  167. <tr>
  168. <td width="90">关键词:</td>
  169. <td><input type="text" name="keywords" id="keywords" value="<?php echo $arcRow['keywords']?>" class="admin-input-lg"></td>
  170. </tr>
  171. </table>
  172. </td>
  173. </tr>
  174. <tr>
  175. <td class="admin-td">
  176. <table>
  177. <tr>
  178. <td width="90">描述:</td>
  179. <td><textarea name="description" id="description" class="admin-textarea-sm"><?php echo $arcRow['description']?></textarea></td>
  180. </tr>
  181. </table>
  182. </td>
  183. </tr>
  184. <?php }?>
  185. <?php PrintAutoFieldsEdit(stripslashes($cInfos['fieldset']),$addRow,'autofield');?>
  186. <tr>
  187. <td class="admin-td">
  188. <table>
  189. <tr>
  190. <td width="90">表现方式:</td>
  191. <td>
  192. <label><input type="radio" name="pagestyle" id="pagestyle1" onclick="checkMuList()" value="1" <?php if ($pagestyle==1) echo " checked='checked'";?>> <img src="../static/web/img/alb2.jpg" title="单页多图样式"></label>
  193. <label><input type="radio" name="pagestyle" id="pagestyle2" onclick="checkMuList()" value="2" <?php if ($pagestyle==2) echo " checked='checked'";?>> <img src="../static/web/img/alb1.jpg" title="幻灯片样式"></label>
  194. <label><input type="radio" name="pagestyle" id="pagestyle3" onclick="checkMuList()" value="3" <?php if ($pagestyle==3) echo " checked='checked'";?>> <img src="../static/web/img/alb3.jpg" title="多缩略图样式"></label>
  195. </td>
  196. </tr>
  197. </table>
  198. </td>
  199. </tr>
  200. <tr id="cfgmulist" style="<?php if ($pagestyle!=3) echo 'display:none';?>">
  201. <td class="admin-td">
  202. <table>
  203. <tr>
  204. <td width="90">多列式参数:</td>
  205. <td>
  206. <label>行 <input type="text" name="row" id="row" value="<?php echo $irow;?>" class="admin-input-sm"></label>
  207. <label>列 <input type="text" name="col" id="col" value="<?php echo $icol;?>" class="admin-input-sm"></label>
  208. <label>缩略图宽度限制:<input type="text" name="ddmaxwidth" id="ddmaxwidth" value="<?php echo $ddmaxwidth;?>" class="admin-input-sm"> 像素</label>
  209. <span>(系统仅是每页输出&quot;行x列&quot;张图片,实现需自行控制样式表)</span>
  210. </td>
  211. </tr>
  212. </table>
  213. </td>
  214. </tr>
  215. <tr id="spagelist" style="<?php if ($pagestyle!=1) echo 'display:none';?>">
  216. <td class="admin-td">
  217. <table>
  218. <tr>
  219. <td width="90">每页图片数:</td>
  220. <td>
  221. <input name="pagepicnum" id="pagpicnum" class="admin-input-sm" value="<?php echo $pagepicnum;?>">
  222. <span>(单页多图显示需要设置此参数,这种模式下系统不会为每张图单独生成缩略图)</span>
  223. </td>
  224. </tr>
  225. </table>
  226. </td>
  227. </tr>
  228. <tr style="display:none">
  229. <td class="admin-td">
  230. <table>
  231. <tr>
  232. <td width="90">限制宽度:</td>
  233. <td>
  234. <input type="text" name="maxwidth" id="maxwidth" class="admin-input-sm" value="<?php echo $maxwidth?>">
  235. <span>(防止图片太宽在模板页中溢出)</span>
  236. </td>
  237. </tr>
  238. </table>
  239. </td>
  240. </tr>
  241. <tr>
  242. <td class="admin-td">
  243. <table>
  244. <tr>
  245. <td>
  246. <div id="thumbnailsEdit">
  247. <?php
  248. $j = 1;
  249. if ($imgurls!=""){
  250. $dtp = new DedeTagParse();
  251. $dtp->LoadSource($imgurls);
  252. if (is_array($dtp->CTags)) {
  253. foreach($dtp->CTags as $ctag)
  254. {
  255. if ($ctag->GetName()=="img") {
  256. $bigimg = trim($ctag->GetInnerText());
  257. if ($ctag->GetAtt('ddimg') != $bigimg && $ctag->GetAtt('ddimg')!='') {
  258. $litimg = $ctag->GetAtt('ddimg');
  259. } else {
  260. if (preg_match("#^(http|https):\/\/#i", $bigimg)) $litimg = $bigimg;
  261. else $litimg = 'swfupload.php?dopost=ddimg&img='.$bigimg;
  262. }
  263. $fhtml = '';
  264. $fhtml .= "<div class='albCt albEdit' id='albold{$j}'>";
  265. $fhtml .= "<input type='hidden' name='imgurl{$j}' value='{$bigimg}'>";
  266. $fhtml .= "<input type='hidden' name='imgddurl{$j}' value='{$litimg}'>";
  267. $fhtml .= "<img src='{$litimg}' id='lit{$j}'>";
  268. $fhtml .= "<div class='my-2'>标题:<input type='text' name='imgmsg{$j}' value='".$ctag->GetAtt('text')."' class='admin-input-sm'></div>";
  269. $fhtml .= "<div><span class='btn btn-success btn-sm fileinput-button'>更换<input type='file' name='imgfile{$j}' for='item{$j}' class='btnEdit'></span><a href=\"javascript:delAlbPicOld('$bigimg',$j)\" class=\"btn btn-success btn-sm\">删除</a></div>";
  270. $fhtml .= "</div>";
  271. echo $fhtml;
  272. $j++;
  273. }
  274. }
  275. }
  276. $dtp->Clear();
  277. }
  278. ?>
  279. </div>
  280. </td>
  281. </tr>
  282. </table>
  283. </td>
  284. </tr>
  285. <tr>
  286. <td class="admin-td">
  287. <table>
  288. <tr>
  289. <td width="90">添加图片:</td>
  290. <td><span class="btn btn-success btn-sm fileinput-button">上传图片(支持多选)<input type="file" name="files[]" id="iptAlbumImages" multiple></span></td>
  291. </tr>
  292. </table>
  293. </td>
  294. </tr>
  295. <tr>
  296. <td class="admin-td">
  297. <table width="100%">
  298. <tr>
  299. <td>
  300. <div id="divFileProgressContainer"></div>
  301. <div id="thumbnails"></div>
  302. </td>
  303. </tr>
  304. </table>
  305. </td>
  306. </tr>
  307. <tr>
  308. <td class="admin-td">
  309. <table>
  310. <tr>
  311. <td width="90">图片文档:</td>
  312. <td><?php GetEditor("body",$body,400,"Diy");?></td>
  313. </tr>
  314. </table>
  315. </td>
  316. </tr>
  317. <tr>
  318. <td class="admin-td">
  319. <table>
  320. <tr>
  321. <td width="90">评论选项:</td>
  322. <td width="260">
  323. <label><input type="radio" name="notpost" value="0" <?php if ($arcRow['notpost']==0) echo "checked='1'";?>> 允许评论</label>
  324. <label><input type="radio" name="notpost" value="1" <?php if ($arcRow['notpost']==1) echo "checked='1'";?>> 禁止评论</label>
  325. </td>
  326. <td width="90">发布选项:</td>
  327. <td>
  328. <label><input type="radio" name="ishtml" value="1" <?php if ($arcRow["ismake"]!=-1) echo "checked";?>> 生成网页</label>
  329. <label><input type="radio" name="ishtml" value="0" <?php if ($arcRow["ismake"]==-1) echo "checked";?>> 仅动态浏览</label>
  330. </td>
  331. </tr>
  332. </table>
  333. </td>
  334. </tr>
  335. <tr>
  336. <td class="admin-td">
  337. <table>
  338. <tr>
  339. <td width="90">文档排序:</td>
  340. <td width="260">
  341. <select name="sortup" id="sortup" class="admin-input-sm">
  342. <?php
  343. $subday = SubDay($arcRow["sortrank"],$arcRow["pubdate"]);
  344. echo "<option value='0'>正常排序</option>";
  345. if ($subday>0) echo "<option value='$subday' selected>置顶<span class='text-primary'>$subday</span>天</option>";
  346. ?>
  347. <option value="7">置顶一周</option>
  348. <option value="30">置顶一个月</option>
  349. <option value="90">置顶三个月</option>
  350. <option value="180">置顶半年</option>
  351. <option value="360">置顶一年</option>
  352. </select>
  353. </td>
  354. <td width="90">标题颜色:</td>
  355. <td>
  356. <input type="text" name="color" id="color" value="<?php echo $arcRow['color']?>" class="admin-input-sm">
  357. <button type="button" name="modcolor" id="modcolor" class="btn btn-success btn-sm" onclick="ShowColor(event,this)">选取</button>
  358. </td>
  359. </tr>
  360. </table>
  361. </td>
  362. </tr>
  363. <tr>
  364. <td class="admin-td">
  365. <table>
  366. <tr>
  367. <td width="90">阅读权限:</td>
  368. <td width="260">
  369. <select name="arcrank" id="arcrank" class="admin-input-sm">
  370. <option value="<?php echo $arcRow['arcrank']?>"><?php echo $arcRow["rankname"]?></option>
  371. <?php
  372. $urank = $cuserLogin->getUserRank();
  373. $dsql->SetQuery("SELECT * FROM #@__arcrank where adminrank<='$urank'");
  374. $dsql->Execute();
  375. while($row = $dsql->GetObject()){
  376. echo "<option value='".$row->rank."'>".$row->membername."</option>";
  377. }
  378. ?>
  379. </select>
  380. </td>
  381. <td width="90">文件名称:</td>
  382. <td><input type="text" name="filename" id="filename" value="<?php echo $arcRow['filename']?>" class="admin-input-sm">(不包括后缀名如.html等)
  383. </td>
  384. </tr>
  385. </table>
  386. </td>
  387. </tr>
  388. <tr>
  389. <td class="admin-td">
  390. <table>
  391. <tr>
  392. <td width="90">发布时间:</td>
  393. <td width="260">
  394. <?php
  395. $nowtime = GetDateTimeMk(time());
  396. echo "<input type='text' name='pubdate' value='$nowtime' id='pubdate' class='datepicker admin-input-sm'>";
  397. ?>
  398. </td>
  399. <td width="90">浏览次数:</td>
  400. <td><input type="text" name="click" value="<?php echo $arcRow['click'];?>" class="admin-input-sm"></td>
  401. </tr>
  402. </table>
  403. </td>
  404. </tr>
  405. <tr bgcolor="#f5f5f5">
  406. <td align="center" class="admin-td">
  407. <button type="submit" class="btn btn-success btn-sm">保存</button>
  408. <button type="button" class="btn btn-outline-success btn-sm" onclick="location.reload();">重置</button>
  409. </td>
  410. </tr>
  411. </table>
  412. </form>
  413. <script>
  414. var swfu = null;
  415. var vcc = 0;
  416. var albums = [];
  417. function checkSubmit() {
  418. if (document.form1.title.value == "") {
  419. ShowMsg("请输入文档标题");
  420. document.form1.title.focus();
  421. return false;
  422. }
  423. }
  424. </script>
  425. <script>
  426. $(".btnEdit").change(function(val){
  427. var formData = new FormData();
  428. var fileData = val.target.files[0];
  429. formData.append('file', fileData);
  430. $.ajax({
  431. url: 'api.php?action=upload_image',
  432. type: 'POST',
  433. data: formData,
  434. processData: false,
  435. contentType: false,
  436. success: function (result) {
  437. if (result.code === 0) {
  438. let idx = val.target.getAttribute("for").replace("item","");
  439. $(`input[name='imgurl${idx}']`).val(result.data);
  440. $(`input[name='imgddurl${idx}']`).val(result.data);
  441. $("#lit"+idx).attr('src', result.data);
  442. }
  443. },
  444. error: function (xhr, status, error) {
  445. alert(error); //处理上传失败后的回调
  446. }
  447. });
  448. })
  449. $("#iptAlbumImages").change(function(val){
  450. for (let i = 0; i < val.target.files.length; i++) {
  451. const f = val.target.files[i];
  452. var formData = new FormData();
  453. var fileData = f;
  454. formData.append('file', fileData);
  455. $.ajax({
  456. url: 'api.php?action=upload_image',
  457. type: 'POST',
  458. data: formData,
  459. processData: false,
  460. contentType: false,
  461. success: function (result) {
  462. if (result.code === 0) {
  463. // console.log(result)
  464. addImage(result.data, 0);
  465. $("#iptAlbumImages").val('');
  466. }
  467. },
  468. error: function (xhr, status, error) {
  469. alert(error); //处理上传失败后的回调
  470. }
  471. });
  472. }
  473. })
  474. </script>
  475. <script>InitPage();</script>
  476. </body>
  477. </html>