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

article_article.htm 9.6KB

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