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

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