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

255 lines
9.9KB

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