国内流行的内容管理系统(CMS)多端全媒体解决方案 https://www.dedebiz.com
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

318 rindas
12KB

  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no">
  6. <title>{dede:field.title/}-{dede:global.cfg_webname/}</title>
  7. <meta name="keywords" content="{dede:field.keywords/}">
  8. <meta name="description" content="{dede:field.description function='html2text(@me)'/}">
  9. <link rel="stylesheet" href="/static/web/css/font-awesome.min.css">
  10. <link rel="stylesheet" href="/static/web/css/bootstrap.min.css">
  11. <link rel="stylesheet" href="/static/web/css/style.css">
  12. <script>
  13. var shortname = "{dede:global.art_shortname/}";
  14. var npage = parseInt("{dede:field name = 'nowpage'/}");
  15. var totalpage = parseInt("{dede:field name = 'totalpage'/}");
  16. var namehand = "{dede:field name='namehand'/}";
  17. var displaytype = "{dede:field name='displaytype'/}";
  18. var gtimer = null;
  19. //大图
  20. function dPlayBig() {
  21. var imgObj = document.getElementById("bigimg");
  22. window.open(imgObj.src);
  23. }
  24. //停止幻灯
  25. function dStopPlay() {
  26. if (gtimer) clearTimeout(gtimer);
  27. else dPlayNext();
  28. }
  29. //开始幻灯
  30. function dStartPlay() {
  31. if (npage != totalpage) {
  32. gtimer = setTimeout("dPlayNext()", 1000);
  33. }
  34. }
  35. //上一张
  36. function dPlayPre() {
  37. if (npage < 2) {
  38. ShowMsg("这是第一页");
  39. } else {
  40. if (npage == 2) {
  41. if (namehand != '') location.href = namehand + shortname;
  42. else location.href = "{dede:global.cfg_phpurl/}/view.php?aid={dede:field.id/}";
  43. } else if (displaytype == 'st' && namehand != '') {
  44. location.href = namehand + "-" + (npage - 1) + shortname;
  45. } else {
  46. location.href = "{dede:global.cfg_phpurl/}/view.php?aid={dede:field.id/}&pageno=" + (npage - 1);
  47. }
  48. }
  49. }
  50. //下一张
  51. function dPlayNext() {
  52. if (npage == totalpage) {
  53. ShowMsg("没有了哦");
  54. } else {
  55. if (displaytype == 'st' && namehand != '') location.href = namehand + "-" + (npage + 1) + shortname;
  56. else location.href = "{dede:global.cfg_phpurl/}/view.php?aid={dede:field.id/}&pageno=" + (npage + 1);
  57. }
  58. }
  59. </script>
  60. </head>
  61. <body>
  62. {dede:include filename='top.htm'/}
  63. {dede:include filename='head.htm'/}
  64. <div class="container py-3">
  65. <nav aria-label="breadcrumb">
  66. <ol class="breadcrumb mb-0">
  67. <li class="breadcrumb-item">当前位置</li>
  68. {dede:field name='position'/}
  69. </ol>
  70. </nav>
  71. </div>
  72. <main class="container py-3">
  73. <div class="row">
  74. <div class="col-md-9">
  75. <article class="article-main bg-white shadow-sm rounded p-3">
  76. <div class="title">
  77. <h1>{dede:field.title/}</h1>
  78. </div>
  79. <div class="meta py-3">
  80. <a href="{dede:field.userurl/}"><span><img src="{dede:field.face/}" class="user-img-xs mr-1">{dede:field.uname/}</span></a>
  81. <span><i class="fa fa-calendar mr-1"></i>{dede:field.pubdate function="MyDate('Y-m-d',@me)"/}</span>
  82. <span><i class="fa fa-globe mr-1"></i>{dede:field.source/}</span>
  83. <span><i class="fa fa-user mr-1"></i>{dede:field.writer/}</span>
  84. <span><i class="fa fa-eye mr-1"></i><script src="{dede:global.cfg_phpurl/}/count.php?view=yes&aid={dede:field.id/}&mid={dede:field name='mid'/}"></script>次</span>
  85. </div>
  86. <div class="picbox py-3">
  87. {dede:field name='pagestyle' alt='输出不同的图片头信息' runphp='yes'}
  88. if (@me==3) {
  89. @me = '<div class="row">';
  90. } else if (@me==2) {
  91. @me = "<div class='text-center mb-3'>
  92. <a href='javascript:dPlayBig();' class='btn btn-success btn-sm'>原图片</a>
  93. <a href='javascript:dPlayPre();' class='btn btn-success btn-sm'>上一张</a>
  94. <a href='javascript:dPlayNext();' class='btn btn-success btn-sm'>下一张</a>
  95. <a href='javascript:dStopPlay();' class='btn btn-success btn-sm'>自动/暂停播放</a>
  96. </div>";
  97. } else {
  98. @me = '';
  99. }
  100. {/dede:field}
  101. <!--如果使用多页单图模式,把href里链接改为javascript:dPlayNext();表示查看下页-->
  102. {dede:field name='imgurls' alt='输出不同的图片信息'}
  103. [field:pagestyle runphp='yes'] @me= (@me==3 ? '<div class="col-4">' : '');[/field:pagestyle]
  104. <p><a href='[field:linkurl/]'><img src='[field:imgsrc/]' [field:imgwidth/] id='bigimg' alt='[field:alttext/]' title='[field:alttext/]'></a></p>
  105. <p class='text-center'><a href='[field:linkurl/]'>([field:alttext/])</a></p>
  106. [field:pagestyle runphp='yes'] @me = (@me==3 ? '</div>' : ''); [/field:pagestyle]
  107. {/dede:field}
  108. {dede:field name='pagestyle' alt='输出不同的图片尾信息' runphp='yes'}
  109. if (@me==3) {
  110. @me = '</div>';
  111. } else if (@me==2) {
  112. @me = "<script>dStartPlay();</script>";
  113. } else {
  114. @me = '';
  115. }
  116. {/dede:field}
  117. </div>
  118. <div class="body py-3">{dede:field.body/}</div>
  119. <div class="edit py-3">责任编辑:{dede:adminname/}</div>
  120. <div class="page py-3 row">
  121. <div class="col-md-4 prenext">
  122. <div class="pagination-previous mb-3">{dede:prenext get='pre'/}</div>
  123. <div class="pagination-next">{dede:prenext get='next'/}</div>
  124. </div>
  125. <div class="col-md-8">
  126. <div class="row actbox">
  127. <ul>
  128. <li><i class="fa fa-star-o mr-2"></i><a href="{dede:global.cfg_phpurl/}/stow.php?aid={dede:field.id/}">收藏</a></li>
  129. <li><i class="fa fa-bug mr-2"></i><a href="javascript:ErrorAddSave({dede:field.id/}, '{dede:field.title/}');">挑错</a></li>
  130. <li><i class="fa fa-thumbs-o-up mr-2"></i><a href="{dede:global.cfg_phpurl/}/recommend.php?aid={dede:field.id/}">推荐</a></li>
  131. <li><i class="fa fa-print mr-2"></i><a href="javascript:;" onclick="window.print();">打印</a></li>
  132. </ul>
  133. </div>
  134. </div>
  135. </div>
  136. {dede:include filename='widget_article_likes.htm'/}
  137. {dede:include filename='widget_article_feedback.htm'/}
  138. </article>
  139. </div>
  140. <aside class="col-md-3">
  141. <div class="pb-3">{dede:include filename='widget_search.htm'/}</div>
  142. <div class="pb-3">{dede:include filename='widget_menu.htm'/}</div>
  143. <div class="pb-3">{dede:include filename='widget_hot.htm'/}</div>
  144. </aside>
  145. </div>
  146. </main>
  147. <script>const PHPURL = '{dede:global.cfg_phpurl/}';</script>
  148. {dede:include filename='foot.htm'/}
  149. <script>
  150. //获取顶踩数据
  151. function GetDigg(aid,cid) {
  152. let url = `{dede:global.cfg_phpurl/}/digg_ajax.php?id=${aid}&cid=${cid}&format=json`;
  153. $.get(url, function(data) {
  154. let reval = JSON.parse(data);
  155. if (reval.code === 200) {
  156. $("#goodpost").html(reval.data.goodpost);
  157. $("#badpost").html(reval.data.badpost);
  158. $("#goodper").css("width", `${reval.data.goodper}%`)
  159. $("#badper").css("width", `${reval.data.badper}%`)
  160. }
  161. })
  162. }
  163. function PostDigg(ftype, aid) {
  164. var saveid = GetCookie('diggid');
  165. if (saveid != null) {
  166. var saveids = saveid.split(',');
  167. var hasid = false;
  168. saveid = '';
  169. j = 1;
  170. for (i = saveids.length - 1; i >= 0; i--) {
  171. if (saveids[i] == aid && hasid) continue;
  172. else {
  173. if (saveids[i] == aid && !hasid) hasid = true;
  174. saveid += (saveid == '' ? saveids[i] : ',' + saveids[i]);
  175. j++;
  176. if (j == 20 && hasid) break;
  177. if (j == 19 && !hasid) break;
  178. }
  179. }
  180. if (hasid) { ShowMsg("您已经顶过该帖,请不要重复顶帖"); return; }
  181. else saveid += ',' + aid;
  182. SetCookie('diggid', saveid, 1);
  183. } else {
  184. SetCookie('diggid', aid, 1);
  185. }
  186. let url = "{dede:global.cfg_phpurl/}/digg_ajax.php?action=" + ftype + "&id=" + aid + "&format=json&cid={dede:field.channel/}";
  187. $.get(url, function(data) {
  188. let reval = JSON.parse(data);
  189. if (reval.code === 200) {
  190. $("#goodpost").html(reval.data.goodpost);
  191. $("#badpost").html(reval.data.badpost);
  192. $("#goodper").css("width", `${reval.data.goodper}%`)
  193. $("#badper").css("width", `${reval.data.badper}%`)
  194. }
  195. });
  196. }
  197. GetDigg("{dede:field.id/}", "{dede:field.channel/}");
  198. //发表评论
  199. function SendFeedback() {
  200. let feedback = {
  201. action: "send",
  202. comtype: "comments",
  203. aid: "{dede:field.id/}",
  204. msg: $("#iptMsg").val(),
  205. username: $("#iptUsername").val(),
  206. validate: $("#iptValidate").val(),
  207. notuser: $("#iptAny").is(":checked") ? "1" : "",
  208. };
  209. $.post("{dede:global.cfg_phpurl/}/feedback.php", feedback, function(data) {
  210. let result = JSON.parse(data);
  211. if (result.code === 200) {
  212. ShowAlert("#feedback-alert", result.msg, "success");
  213. $("#iptMsg").val("");
  214. $("#iptValidate").val("");
  215. ($("#iptUsername").attr("disabled") !== "disabled") && $("#iptUsername").val("");
  216. $("#validateimg").attr("src", '{dede:global.cfg_phpurl/}/vdimgck.php?' + new Date().getTime() + Math.round(Math.random() * 10000));
  217. } else {
  218. ShowAlert("#feedback-alert", `评论失败:${result.msg}`, "danger");
  219. $("#validateimg").attr("src", '{dede:global.cfg_phpurl/}/vdimgck.php?' + new Date().getTime() + Math.round(Math.random() * 10000));
  220. }
  221. });
  222. }
  223. //进行回复,回复必须登录
  224. function SendReplyFeedback(fid) {
  225. let content = $(`._feedback_reply[for="${fid}"]`).find(".iptReplyContent").val();
  226. let reply = {
  227. action : "send",
  228. comtype : "reply",
  229. fid : fid,
  230. aid : "{dede:field.id/}",
  231. msg : content,
  232. }
  233. $.post("{dede:global.cfg_phpurl/}/feedback.php", reply, function(data) {
  234. let result = JSON.parse(data);
  235. if (result.code === 200) {
  236. ShowAlert(`._feedback_reply[for="${fid}"]`, result.msg, "success");
  237. } else {
  238. ShowAlert(`._feedback_reply[for="${fid}"]`, `评论失败:${result.msg}`, "danger");
  239. }
  240. })
  241. $(`._feedback_reply[for="${fid}"]`).find(".btn-send").attr("disabled", "disabled");
  242. }
  243. //回复某个评论
  244. function ReplyFeedback(fid) {
  245. let replyPannel = `<div class="form-group">
  246. <div class="input-group">
  247. <input type="text" class="form-control iptReplyContent">
  248. <div class="input-group-append"><button type="button" class="btn btn-success btn-send" onclick='SendReplyFeedback(${fid})'>评论</button></div>
  249. </div>
  250. </div>`;
  251. $.get("{dede:global.cfg_memberurl/}/api.php?format=json", function(result) {
  252. if (result.code !== 200) {
  253. $(`._feedback_reply`).html("");
  254. ShowAlert(`._feedback_reply[for="${fid}"]`, '回复需要登录会员中心,您可以<a href="{dede:global.cfg_memberurl/}/login.php">点击登录</a>后再来回复', 'warning', 3000);
  255. } else {
  256. $(`._feedback_reply`).html("");
  257. $(`._feedback_reply[for="${fid}"]`).html(replyPannel);
  258. }
  259. });
  260. $(`._feedback_reply[for="${fid}"]`).html('<i class="fa fa-spinner"></i>');
  261. }
  262. //加载回复评论
  263. function LoadReplyFeedbacks(fid) {
  264. $(`.feedback_replies[for="${fid}"]`).html('<i class="fa fa-spinner"></i>');
  265. $.get("{dede:global.cfg_phpurl/}/feedback.php", {
  266. "aid" : "{dede:field.id/}",
  267. "fid" : fid,
  268. }, function(data) {
  269. let result = JSON.parse(data);
  270. let tpl = `<div class="media py-3">
  271. <img src="~face~" class="face mr-3">
  272. <div class="media-body">
  273. <div class="feedback-infos pb-3">
  274. <div class="feedback-basic">
  275. <span>~username~</span>
  276. <span>~dtimestr~</span>
  277. </div>
  278. <div class="feedback-action">
  279. <a href="javascript:GoodFeedback(~id~, ~good~)">
  280. <i class="fa fa-thumbs-up"></i>
  281. <i id="feedbackGood~id~">~good~</i>
  282. </a>
  283. </div>
  284. </div>
  285. <div class="feedback-content">~msg~</div>
  286. </div>
  287. </div>`;
  288. if (result.code === 200) {
  289. $(`.feedback_replies[for="${fid}"]`).html("");
  290. for (let i = 0; i < result.data.length; i++) {
  291. const feedback = result.data[i];
  292. let rs = tpl;
  293. for (const key in feedback) {
  294. if (feedback.hasOwnProperty(key)) {
  295. rs = rs.replace(new RegExp(`~${key}~`,"gm"), feedback[key])
  296. }
  297. }
  298. $(`.feedback_replies[for="${fid}"]`).append(rs);
  299. }
  300. }
  301. })
  302. }
  303. //赞
  304. function GoodFeedback(fid, g) {
  305. let good = {
  306. action : "send",
  307. feedbacktype : "good",
  308. good : g,
  309. fid : fid,
  310. }
  311. $.post("{dede:global.cfg_phpurl/}/feedback.php", good, function(data) {
  312. let result = JSON.parse(data);
  313. $(`#feedbackGood${fid}`).html(result.data);
  314. })
  315. }
  316. </script>
  317. </body>
  318. </html>