国内流行的内容管理系统(CMS)多端全媒体解决方案 https://www.dedebiz.com
Du kannst nicht mehr als 25 Themen auswählen Themen müssen entweder mit einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

245 Zeilen
9.5KB

  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. <link rel="stylesheet" href="/static/ckeditor/plugins/codesnippet/lib/highlight/styles/default.css">
  13. </head>
  14. <body>
  15. {dede:include filename='top.htm'/}
  16. {dede:include filename='head.htm'/}
  17. <div class="container py-3">
  18. <nav aria-label="breadcrumb">
  19. <ol class="breadcrumb mb-0">
  20. <li class="breadcrumb-item">当前位置</li>
  21. {dede:field name='position'/}
  22. </ol>
  23. </nav>
  24. </div>
  25. <main class="container py-3">
  26. <div class="row">
  27. <div class="col-md-9">
  28. <article class="article-main bg-white shadow-sm rounded p-3">
  29. <div class="title">
  30. <h1>{dede:field.title/}</h1>
  31. </div>
  32. <div class="meta py-3">
  33. <a href="{dede:field.userurl/}"><span><img src="{dede:field.face/}" class="user-img-xs mr-1">{dede:field.uname/}</span></a>
  34. <span><i class="fa fa-calendar mr-1"></i>{dede:field.pubdate function="MyDate('Y-m-d',@me)"/}</span>
  35. <span><i class="fa fa-globe mr-1"></i>{dede:field.source/}</span>
  36. <span><i class="fa fa-user mr-1"></i>{dede:field.writer/}</span>
  37. <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>
  38. </div>
  39. <div class="column py-3">{dede:pagetitle/}</div>
  40. <div class="body py-3">{dede:field.body/}</div>
  41. <div class="edit py-3">责任编辑:{dede:adminname/}</div>
  42. <nav class="column-page py-3">
  43. <ul class="pagination justify-content-center">{dede:pagebreak/}</ul>
  44. </nav>
  45. <div class="page py-3 row">
  46. <div class="col-md-4 prenext">
  47. <div class="pagination-previous mb-3">{dede:prenext get='pre'/}</div>
  48. <div class="pagination-next">{dede:prenext get='next'/}</div>
  49. </div>
  50. <div class="col-md-8">
  51. <div class="row actbox">
  52. <ul>
  53. <li><i class="fa fa-star-o mr-2"></i><a href="{dede:global.cfg_phpurl/}/stow.php?aid={dede:field.id/}">收藏</a></li>
  54. <li><i class="fa fa-bug mr-2"></i><a href="javascript:ErrorAddSave({dede:field.id/}, '{dede:field.title/}');">挑错</a></li>
  55. <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>
  56. <li><i class="fa fa-print mr-2"></i><a href="javascript:;" onclick="window.print();">打印</a></li>
  57. </ul>
  58. </div>
  59. </div>
  60. </div>
  61. {dede:include filename='widget_article_likes.htm'/}
  62. {dede:include filename='widget_article_feedback.htm'/}
  63. </article>
  64. </div>
  65. <aside class="col-md-3">
  66. <div class="pb-3">{dede:include filename='widget_search.htm'/}</div>
  67. <div class="pb-3">{dede:include filename='widget_menu.htm'/}</div>
  68. <div class="pb-3">{dede:include filename='widget_hot.htm'/}</div>
  69. </aside>
  70. </div>
  71. </main>
  72. <script>const PHPURL = '{dede:global.cfg_phpurl/}';</script>
  73. {dede:include filename='foot.htm'/}
  74. <script src="/static/ckeditor/plugins/codesnippet/lib/highlight/highlight.pack.js"></script>
  75. <script>hljs.initHighlightingOnLoad();</script>
  76. <script>
  77. //获取顶踩数据
  78. function GetDigg(aid,cid) {
  79. let url = `{dede:global.cfg_phpurl/}/digg_ajax.php?id=${aid}&cid=${cid}&format=json`;
  80. $.get(url, function(data) {
  81. let reval = JSON.parse(data);
  82. if (reval.code === 200) {
  83. $("#goodpost").html(reval.data.goodpost);
  84. $("#badpost").html(reval.data.badpost);
  85. $("#goodper").css("width", `${reval.data.goodper}%`)
  86. $("#badper").css("width", `${reval.data.badper}%`)
  87. }
  88. })
  89. }
  90. function PostDigg(ftype, aid) {
  91. var saveid = GetCookie('diggid');
  92. if (saveid != null) {
  93. var saveids = saveid.split(',');
  94. var hasid = false;
  95. saveid = '';
  96. j = 1;
  97. for (i = saveids.length - 1; i >= 0; i--) {
  98. if (saveids[i] == aid && hasid) continue;
  99. else {
  100. if (saveids[i] == aid && !hasid) hasid = true;
  101. saveid += (saveid == '' ? saveids[i] : ',' + saveids[i]);
  102. j++;
  103. if (j == 20 && hasid) break;
  104. if (j == 19 && !hasid) break;
  105. }
  106. }
  107. if (hasid) { ShowMsg("您已经顶过该帖,请不要重复顶帖"); return; }
  108. else saveid += ',' + aid;
  109. SetCookie('diggid', saveid, 1);
  110. } else {
  111. SetCookie('diggid', aid, 1);
  112. }
  113. let url = "{dede:global.cfg_phpurl/}/digg_ajax.php?action=" + ftype + "&id=" + aid + "&format=json&cid={dede:field.channel/}";
  114. $.get(url, function(data) {
  115. let reval = JSON.parse(data);
  116. if (reval.code === 200) {
  117. $("#goodpost").html(reval.data.goodpost);
  118. $("#badpost").html(reval.data.badpost);
  119. $("#goodper").css("width", `${reval.data.goodper}%`)
  120. $("#badper").css("width", `${reval.data.badper}%`)
  121. }
  122. });
  123. }
  124. GetDigg("{dede:field.id/}", "{dede:field.channel/}");
  125. //发表评论
  126. function SendFeedback() {
  127. let feedback = {
  128. action: "send",
  129. comtype: "comments",
  130. aid: "{dede:field.id/}",
  131. msg: $("#iptMsg").val(),
  132. username: $("#iptUsername").val(),
  133. validate: $("#iptValidate").val(),
  134. notuser: $("#iptAny").is(":checked") ? "1" : "",
  135. };
  136. $.post("{dede:global.cfg_phpurl/}/feedback.php", feedback, function(data) {
  137. let result = JSON.parse(data);
  138. if (result.code === 200) {
  139. ShowAlert("#feedback-alert", result.msg, "success");
  140. $("#iptMsg").val("");
  141. $("#iptValidate").val("");
  142. ($("#iptUsername").attr("disabled") !== "disabled") && $("#iptUsername").val("");
  143. $("#validateimg").attr("src", '{dede:global.cfg_phpurl/}/vdimgck.php?' + new Date().getTime() + Math.round(Math.random() * 10000));
  144. } else {
  145. ShowAlert("#feedback-alert", `评论失败:${result.msg}`, "danger");
  146. $("#validateimg").attr("src", '{dede:global.cfg_phpurl/}/vdimgck.php?' + new Date().getTime() + Math.round(Math.random() * 10000));
  147. }
  148. });
  149. }
  150. //进行回复,回复必须登录
  151. function SendReplyFeedback(fid) {
  152. let content = $(`._feedback_reply[for="${fid}"]`).find(".iptReplyContent").val();
  153. let reply = {
  154. action : "send",
  155. comtype : "reply",
  156. fid : fid,
  157. aid : "{dede:field.id/}",
  158. msg : content,
  159. }
  160. $.post("{dede:global.cfg_phpurl/}/feedback.php", reply, function(data) {
  161. let result = JSON.parse(data);
  162. if (result.code === 200) {
  163. ShowAlert(`._feedback_reply[for="${fid}"]`, result.msg, "success");
  164. } else {
  165. ShowAlert(`._feedback_reply[for="${fid}"]`, `评论失败:${result.msg}`, "danger");
  166. }
  167. })
  168. $(`._feedback_reply[for="${fid}"]`).find(".btn-send").attr("disabled", "disabled");
  169. }
  170. //回复某个评论
  171. function ReplyFeedback(fid) {
  172. let replyPannel = `<div class="form-group">
  173. <div class="input-group">
  174. <input type="text" class="form-control iptReplyContent">
  175. <div class="input-group-append"><button type="button" class="btn btn-success btn-send" onclick='SendReplyFeedback(${fid})'>评论</button></div>
  176. </div>
  177. </div>`;
  178. $.get("{dede:global.cfg_memberurl/}/api.php?format=json", function(result) {
  179. if (result.code !== 200) {
  180. $(`._feedback_reply`).html("");
  181. ShowAlert(`._feedback_reply[for="${fid}"]`, '回复需要登录会员中心,您可以<a href="{dede:global.cfg_memberurl/}/login.php">点击登录</a>后再来回复', 'warning', 3000);
  182. } else {
  183. $(`._feedback_reply`).html("");
  184. $(`._feedback_reply[for="${fid}"]`).html(replyPannel);
  185. }
  186. });
  187. $(`._feedback_reply[for="${fid}"]`).html('<i class="fa fa-spinner"></i>');
  188. }
  189. //加载回复评论
  190. function LoadReplyFeedbacks(fid) {
  191. $(`.feedback_replies[for="${fid}"]`).html('<i class="fa fa-spinner"></i>');
  192. $.get("{dede:global.cfg_phpurl/}/feedback.php", {
  193. "aid" : "{dede:field.id/}",
  194. "fid" : fid,
  195. }, function(data) {
  196. let result = JSON.parse(data);
  197. let tpl = `<div class="media py-3">
  198. <img src="~face~" class="face mr-3">
  199. <div class="media-body">
  200. <div class="feedback-infos pb-3">
  201. <div class="feedback-basic">
  202. <span>~username~</span>
  203. <span>~dtimestr~</span>
  204. </div>
  205. <div class="feedback-action">
  206. <a href="javascript:GoodFeedback(~id~, ~good~)">
  207. <i class="fa fa-thumbs-up"></i>
  208. <i id="feedbackGood~id~">~good~</i>
  209. </a>
  210. </div>
  211. </div>
  212. <div class="feedback-content">~msg~</div>
  213. </div>
  214. </div>`;
  215. if (result.code === 200) {
  216. $(`.feedback_replies[for="${fid}"]`).html("");
  217. for (let i = 0; i < result.data.length; i++) {
  218. const feedback = result.data[i];
  219. let rs = tpl;
  220. for (const key in feedback) {
  221. if (feedback.hasOwnProperty(key)) {
  222. rs = rs.replace(new RegExp(`~${key}~`,"gm"), feedback[key])
  223. }
  224. }
  225. $(`.feedback_replies[for="${fid}"]`).append(rs);
  226. }
  227. }
  228. })
  229. }
  230. //赞
  231. function GoodFeedback(fid, g) {
  232. let good = {
  233. action : "send",
  234. feedbacktype : "good",
  235. good : g,
  236. fid : fid,
  237. }
  238. $.post("{dede:global.cfg_phpurl/}/feedback.php", good, function(data) {
  239. let result = JSON.parse(data);
  240. $(`#feedbackGood${fid}`).html(result.data);
  241. })
  242. }
  243. </script>
  244. </body>
  245. </html>