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

487 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 class="border my-3">
  30. <tr>
  31. <td 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="390"><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> {$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 width="620"><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="660">
  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="60">编辑:</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 href="javascript: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 href="javascript: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. <?php }?>
  163. <tr>
  164. <td class="admin-td">
  165. <table>
  166. <tr>
  167. <td width="120">关键词:</td>
  168. <td><input type="text" name="keywords" id="keywords" value="<?php echo $arcRow['keywords']?>" class="admin-input-lg"></td>
  169. </tr>
  170. </table>
  171. </td>
  172. </tr>
  173. <tr>
  174. <td class="admin-td">
  175. <table>
  176. <tr>
  177. <td width="120">描述:</td>
  178. <td><textarea name="description" id="description" class="admin-textarea-sm"><?php echo $arcRow['description']?></textarea></td>
  179. </tr>
  180. </table>
  181. </td>
  182. </tr>
  183. <tr>
  184. <td class="admin-td">
  185. <table>
  186. <tr>
  187. <td width="120">附加选项:</td>
  188. <td>
  189. <label><input type="checkbox" name="remote" id="remote" value="1" <?php if ($cfg_rm_remote=='Y') echo 'checked';?>> 下载远程图片和资源</label>
  190. <label><input type="checkbox" name="autolitpic" id="autolitpic" value="1" <?php if ($cfg_arc_autopic=='Y') echo 'checked';?>> 提取第一个图片为缩略图</label>
  191. </td>
  192. </tr>
  193. </table>
  194. </td>
  195. </tr>
  196. <tr>
  197. <td class="admin-td">
  198. <table>
  199. <tr>
  200. <td width="120">表现方式:</td>
  201. <td>
  202. <label><input type="radio" name="pagestyle" id="pagestyle1" onclick="checkMuList();" value="1" <?php if ($pagestyle==1) echo 'checked';?>> <img src="/static/web/img/alb2.jpg" title="单页多图样式"></label>
  203. <label><input type="radio" name="pagestyle" id="pagestyle2" onclick="checkMuList();" value="2" <?php if ($pagestyle==2) echo 'checked';?>> <img src="/static/web/img/alb1.jpg" title="幻灯片样式"></label>
  204. <label><input type="radio" name="pagestyle" id="pagestyle3" onclick="checkMuList();" value="3" <?php if ($pagestyle==3) echo 'checked';?>> <img src="/static/web/img/alb3.jpg" title="多缩略图样式"></label>
  205. </td>
  206. </tr>
  207. </table>
  208. </td>
  209. </tr>
  210. <tr id="cfgmulist" style="<?php if ($pagestyle!=3) echo 'display:none';?>">
  211. <td class="admin-td">
  212. <table>
  213. <tr>
  214. <td width="120">多列式参数:</td>
  215. <td>
  216. <label>行 <input type="text" name="row" id="row" value="<?php echo $irow;?>" class="admin-input-sm"></label>
  217. <label>列 <input type="text" name="col" id="col" value="<?php echo $icol;?>" class="admin-input-sm"></label>
  218. <label>缩略图宽度限制:<input type="text" name="ddmaxwidth" id="ddmaxwidth" value="<?php echo $ddmaxwidth;?>" class="admin-input-sm"> 像素</label>
  219. <span>(每页输出行x列张图片,实现需自行控制样式表)</span>
  220. </td>
  221. </tr>
  222. </table>
  223. </td>
  224. </tr>
  225. <tr id="spagelist" style="<?php if ($pagestyle!=1) echo 'display:none';?>">
  226. <td class="admin-td">
  227. <table>
  228. <tr>
  229. <td width="120">每页图片数:</td>
  230. <td>
  231. <input name="pagepicnum" id="pagpicnum" class="admin-input-sm" value="<?php echo $pagepicnum;?>">
  232. <span>(单页多图显示需要设置此参数,这种模式下系统不会为每张图单独生成缩略图)</span>
  233. </td>
  234. </tr>
  235. </table>
  236. </td>
  237. </tr>
  238. <tr style="display:none">
  239. <td class="admin-td">
  240. <table>
  241. <tr>
  242. <td width="120">限制宽度:</td>
  243. <td>
  244. <input type="text" name="maxwidth" id="maxwidth" class="admin-input-sm" value="<?php echo $maxwidth?>">
  245. <span>(防止图片太宽在模板页中溢出)</span>
  246. </td>
  247. </tr>
  248. </table>
  249. </td>
  250. </tr>
  251. <tr>
  252. <td class="admin-td">
  253. <table>
  254. <tr>
  255. <td>
  256. <div id="galleryedit">
  257. <?php
  258. $j = 1;
  259. if ($imgurls!=""){
  260. $dtp = new DedeTagParse();
  261. $dtp->LoadSource($imgurls);
  262. if (is_array($dtp->CTags)) {
  263. foreach($dtp->CTags as $ctag)
  264. {
  265. if ($ctag->GetName()=="img") {
  266. $bigimg = trim($ctag->GetInnerText());
  267. if ($ctag->GetAtt('ddimg') != $bigimg && $ctag->GetAtt('ddimg')!='') {
  268. $litimg = $ctag->GetAtt('ddimg');
  269. } else {
  270. if (preg_match("#^(http|https):\/\/#i", $bigimg)) $litimg = $bigimg;
  271. else $litimg = 'swfupload.php?dopost=ddimg&img='.$bigimg;
  272. }
  273. $fhtml = '';
  274. $fhtml .= "<div class='atlas' id='albold{$j}'>";
  275. $fhtml .= "<input type='hidden' name='imgurl{$j}' value='{$bigimg}'>";
  276. $fhtml .= "<input type='hidden' name='imgddurl{$j}' value='{$litimg}'>";
  277. $fhtml .= "<div class='atlas-head'><img src='{$litimg}' id='lit{$j}'></div>";
  278. $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>";
  279. $fhtml .= "<div class='atlas-foot'><input type='text' name='imgmsg{$j}' value='".$ctag->GetAtt('text')."' class='atlas-input' placeholder='请输入图片注释'></div>";
  280. $fhtml .= "</div>";
  281. echo $fhtml;
  282. $j++;
  283. }
  284. }
  285. }
  286. $dtp->Clear();
  287. }
  288. ?>
  289. </div>
  290. </td>
  291. </tr>
  292. </table>
  293. </td>
  294. </tr>
  295. <tr>
  296. <td class="admin-td">
  297. <table>
  298. <tr>
  299. <td width="120">本地上传:</td>
  300. <td><span class="btn btn-success btn-sm fileinput-button">上传多图<input type="file" name="files[]" id="iptAlbumImages" multiple></span></td>
  301. </tr>
  302. </table>
  303. </td>
  304. </tr>
  305. <tr>
  306. <td class="admin-td">
  307. <table>
  308. <tr>
  309. <td>
  310. <div id="gallery"></div>
  311. </td>
  312. </tr>
  313. </table>
  314. </td>
  315. </tr>
  316. <?php PrintAutoFieldsEdit(stripslashes($cInfos['fieldset']),$addRow,'autofield');?>
  317. <tr>
  318. <td class="admin-td"><?php GetEditor('body',$body,350,'Diy');?></td>
  319. </tr>
  320. <tr>
  321. <td class="admin-td">
  322. <table>
  323. <tr>
  324. <td width="120">评论选项:</td>
  325. <td width="360">
  326. <label><input type="radio" name="notpost" value="0" <?php if ($arcRow['notpost']==0) echo 'checked';?>> 允许评论</label>
  327. <label><input type="radio" name="notpost" value="1" <?php if ($arcRow['notpost']==1) echo 'checked';?>> 禁止评论</label>
  328. </td>
  329. <td width="120">发布选项:</td>
  330. <td>
  331. <label><input type="radio" name="ishtml" value="1" <?php if ($arcRow["ismake"]!=-1) echo 'checked';?>> 生成网页</label>
  332. <label><input type="radio" name="ishtml" value="0" <?php if ($arcRow["ismake"]==-1) echo 'checked';?>> 仅动态浏览</label>
  333. </td>
  334. </tr>
  335. </table>
  336. </td>
  337. </tr>
  338. <tr>
  339. <td class="admin-td">
  340. <table>
  341. <tr>
  342. <td width="120">文档排序:</td>
  343. <td width="360">
  344. <select name="sortup" id="sortup" class="admin-input-sm">
  345. <?php
  346. $subday = SubDay($arcRow["sortrank"],$arcRow["pubdate"]);
  347. echo "<option value='0'>正常排序</option>";
  348. if ($subday>0) echo "<option value='$subday' selected>置顶".$subday."天</option>";
  349. ?>
  350. <option value="7">置顶一周</option>
  351. <option value="30">置顶一个月</option>
  352. <option value="90">置顶三个月</option>
  353. <option value="180">置顶半年</option>
  354. <option value="360">置顶一年</option>
  355. </select>
  356. </td>
  357. <td width="120">标题颜色:</td>
  358. <td>
  359. <input type="text" name="color" id="color" value="<?php echo $arcRow['color']?>" class="admin-input-sm">
  360. <button type="button" name="modcolor" id="modcolor" class="btn btn-success btn-sm" onclick="ShowColor(event,this)">选择</button>
  361. </td>
  362. </tr>
  363. </table>
  364. </td>
  365. </tr>
  366. <tr>
  367. <td class="admin-td">
  368. <table>
  369. <tr>
  370. <td width="120">浏览权限:</td>
  371. <td width="360">
  372. <select name="arcrank" id="arcrank" class="admin-input-sm">
  373. <option value="<?php echo $arcRow['arcrank']?>"><?php echo $arcRow["rankname"]?></option>
  374. <?php
  375. $urank = $cuserLogin->getUserRank();
  376. $dsql->SetQuery("SELECT * FROM #@__arcrank where adminrank<='$urank' ORDER BY `rank` ASC");
  377. $dsql->Execute();
  378. while($row = $dsql->GetObject()){
  379. echo "<option value='".$row->rank."'>".$row->membername."</option>";
  380. }
  381. ?>
  382. </select>
  383. <span>(暂不支持静态)</span>
  384. </td>
  385. <td width="120">文件名称:</td>
  386. <td>
  387. <input type="text" name="filename" id="filename" value="<?php echo $arcRow['filename']?>" class="admin-input-sm">
  388. <span>(不包括后缀名,如:.html)</span>
  389. </td>
  390. </tr>
  391. </table>
  392. </td>
  393. </tr>
  394. <tr>
  395. <td class="admin-td">
  396. <table>
  397. <tr>
  398. <td width="120">发布时间:</td>
  399. <td width="360">
  400. <?php
  401. $nowtime = GetDateTimeMk(time());
  402. echo "<input type='text' name='pubdate' value='$nowtime' id='pubdate' class='datepicker admin-input-sm'>";
  403. ?>
  404. </td>
  405. <td width="120">浏览次数:</td>
  406. <td><input type="text" name="click" value="<?php echo $arcRow['click'];?>" class="admin-input-sm"></td>
  407. </tr>
  408. </table>
  409. </td>
  410. </tr>
  411. <tr>
  412. <td align="center" class="admin-td">
  413. <button type="submit" class="btn btn-success btn-sm">保存</button>
  414. <button type="button" class="btn btn-outline-success btn-sm" onclick="location.reload();">重置</button>
  415. </td>
  416. </tr>
  417. </table>
  418. </form>
  419. <script>
  420. function checkSubmit() {
  421. if (document.form1.title.value == "") {
  422. ShowMsg("文档标题不能为空");
  423. document.form1.title.focus();
  424. return false;
  425. }
  426. }
  427. </script>
  428. <script>
  429. var swfu = null;
  430. var vcc = 0;
  431. var albums = [];
  432. $(".atlasedit").change(function(val) {
  433. var formData = new FormData();
  434. var fileData = val.target.files[0];
  435. formData.append('file', fileData);
  436. $.ajax({
  437. url: 'api.php?action=upload_image',
  438. type: 'POST',
  439. data: formData,
  440. processData: false,
  441. contentType: false,
  442. success: function(result) {
  443. if (result.code === 0) {
  444. let idx = val.target.getAttribute("for").replace("item","");
  445. $(`input[name='imgurl${idx}']`).val(result.data);
  446. $(`input[name='imgddurl${idx}']`).val(result.data);
  447. $("#lit"+idx).attr('src', result.data);
  448. } else {
  449. ShowMsg(result.error.message);
  450. }
  451. },
  452. error: function(xhr, status, error) {
  453. ShowMsg(error); //处理上传失败后的回调
  454. }
  455. });
  456. });
  457. $("#iptAlbumImages").change(function(val) {
  458. for (let i = 0; i < val.target.files.length; i++) {
  459. const f = val.target.files[i];
  460. var formData = new FormData();
  461. var fileData = f;
  462. formData.append('file', fileData);
  463. $.ajax({
  464. url: 'api.php?action=upload_image',
  465. type: 'POST',
  466. data: formData,
  467. processData: false,
  468. contentType: false,
  469. success: function(result) {
  470. if (result.code === 0) {
  471. // console.log(result)
  472. addImage(result.data, 0);
  473. $("#iptAlbumImages").val('');
  474. } else {
  475. ShowMsg(result.error.message);
  476. }
  477. },
  478. error: function(xhr, status, error) {
  479. ShowMsg(error); //处理上传失败后的回调
  480. }
  481. });
  482. }
  483. });
  484. </script>
  485. <script>InitPage();</script>
  486. </body>
  487. </html>