| @@ -12,9 +12,6 @@ | |||
| <link rel="stylesheet" href="{dede:global.cfg_cmsurl/}/static/web/css/style.css"> | |||
| <link rel="shortcut icon" href="{dede:global.cfg_cmsurl/}/static/web/img/favicon.ico"> | |||
| <link rel="stylesheet" href="{dede:global.cfg_cmsurl/}/static/ckeditor/plugins/codesnippet/lib/highlight/styles/default.css"> | |||
| <script>const PHPURL = '{dede:field name="phpurl"/}';</script> | |||
| <script src="{dede:global.cfg_cmsurl/}/static/web/js/jquery.min.js"></script> | |||
| <script src="{dede:global.cfg_cmsurl/}/static/ckeditor/plugins/codesnippet/lib/highlight/highlight.pack.js"></script> | |||
| </head> | |||
| <body class="body-bg"> | |||
| {dede:include filename='top.htm'/} | |||
| @@ -75,7 +72,178 @@ | |||
| </div> | |||
| </div> | |||
| </main> | |||
| <script>const PHPURL = '{dede:field name="phpurl"/}';</script> | |||
| {dede:include filename='foot.htm'/} | |||
| <script src="{dede:global.cfg_cmsurl/}/static/ckeditor/plugins/codesnippet/lib/highlight/highlight.pack.js"></script> | |||
| <script>hljs.initHighlightingOnLoad();</script> | |||
| <script> | |||
| //获取顶踩数据 | |||
| function GetDigg(aid,cid) { | |||
| let url = `{dede:global.cfg_phpurl/}/digg_ajax.php?id=${aid}&cid=${cid}&format=json`; | |||
| $.get(url, function (data) { | |||
| let reval = JSON.parse(data); | |||
| if (reval.code === 200) { | |||
| $("#goodpost").html(reval.data.goodpost); | |||
| $("#badpost").html(reval.data.badpost); | |||
| $("#goodper").css("width", `${reval.data.goodper}%`) | |||
| $("#badper").css("width", `${reval.data.badper}%`) | |||
| } | |||
| }) | |||
| } | |||
| function PostDigg(ftype, aid) { | |||
| var saveid = GetCookie('diggid'); | |||
| if (saveid != null) { | |||
| var saveids = saveid.split(','); | |||
| var hasid = false; | |||
| saveid = ''; | |||
| j = 1; | |||
| for (i = saveids.length - 1; i >= 0; i--) { | |||
| if (saveids[i] == aid && hasid) continue; | |||
| else { | |||
| if (saveids[i] == aid && !hasid) hasid = true; | |||
| saveid += (saveid == '' ? saveids[i] : ',' + saveids[i]); | |||
| j++; | |||
| if (j == 20 && hasid) break; | |||
| if (j == 19 && !hasid) break; | |||
| } | |||
| } | |||
| if (hasid) { ShowMsg("您已经顶过该帖,请不要重复顶帖 "); return; } | |||
| else saveid += ',' + aid; | |||
| SetCookie('diggid', saveid, 1); | |||
| } | |||
| else { | |||
| SetCookie('diggid', aid, 1); | |||
| } | |||
| let url = "{dede:global.cfg_phpurl/}/digg_ajax.php?action=" + ftype + "&id=" + aid + "&format=json&cid={dede:field.channel/}"; | |||
| $.get(url, function (data) { | |||
| let reval = JSON.parse(data); | |||
| if (reval.code === 200) { | |||
| $("#goodpost").html(reval.data.goodpost); | |||
| $("#badpost").html(reval.data.badpost); | |||
| $("#goodper").css("width", `${reval.data.goodper}%`) | |||
| $("#badper").css("width", `${reval.data.badper}%`) | |||
| } | |||
| }); | |||
| } | |||
| GetDigg("{dede:field.id/}", "{dede:field.channel/}"); | |||
| //发表评论 | |||
| function SendFeedback() { | |||
| let feedback = { | |||
| action: "send", | |||
| comtype: "comments", | |||
| aid: "{dede:field name='id'/}", | |||
| msg: $("#iptMsg").val(), | |||
| username: $("#iptUsername").val(), | |||
| validate: $("#iptValidate").val(), | |||
| notuser: $("#iptAny").is(":checked") ? "1" : "", | |||
| }; | |||
| $.post("{dede:field name='phpurl'/}/feedback.php", feedback, function (data) { | |||
| let result = JSON.parse(data); | |||
| if (result.code === 200) { | |||
| ShowAlert("#feedback-alert", result.msg, "success"); | |||
| $("#iptMsg").val(""); | |||
| $("#iptValidate").val(""); | |||
| ($("#iptUsername").attr("disabled") !== "disabled") && $("#iptUsername").val(""); | |||
| $("#validateimg").attr("src", '{dede:global.cfg_cmspath/}/apps/vdimgck.php?' + new Date().getTime() + Math.round(Math.random() * 10000)); | |||
| } else { | |||
| ShowAlert("#feedback-alert", `评论失败:${result.msg}`, "danger"); | |||
| $("#validateimg").attr("src", '{dede:global.cfg_cmspath/}/apps/vdimgck.php?' + new Date().getTime() + Math.round(Math.random() * 10000)); | |||
| } | |||
| }); | |||
| } | |||
| //进行回复,回复必须登录 | |||
| function SendReplyFeedback(fid) { | |||
| let content = $(`._feedback_reply[for="${fid}"]`).find(".iptReplyContent").val(); | |||
| let reply = { | |||
| action : "send", | |||
| comtype : "reply", | |||
| fid : fid, | |||
| aid : "{dede:field name='id'/}", | |||
| msg : content, | |||
| } | |||
| $.post("{dede:field name='phpurl'/}/feedback.php", reply, function (data) { | |||
| let result = JSON.parse(data); | |||
| if (result.code === 200) { | |||
| ShowAlert(`._feedback_reply[for="${fid}"]`, result.msg, "success"); | |||
| } else { | |||
| ShowAlert(`._feedback_reply[for="${fid}"]`, `评论失败:${result.msg}`, "danger"); | |||
| } | |||
| }) | |||
| $(`._feedback_reply[for="${fid}"]`).find(".btn-send").attr("disabled", "disabled"); | |||
| } | |||
| //回复某个评论 | |||
| function ReplyFeedback(fid) { | |||
| let replyPannel = `<div class="form-group"> | |||
| <div class="input-group"> | |||
| <input type="text" class="form-control iptReplyContent"> | |||
| <button type="button" class="btn btn-success btn-send" onclick='SendReplyFeedback(${fid})'>评论</button> | |||
| </div> | |||
| </div>`; | |||
| $.get("{dede:global.cfg_cmsurl/}/user/api.php?format=json", function(result) { | |||
| if (result.code !== 200) { | |||
| $(`._feedback_reply`).html(""); | |||
| ShowAlert(`._feedback_reply[for="${fid}"]`, '回复需要登录会员中心,您可以<a href="{dede:global.cfg_cmsurl/}/user/login.php">点击登录</a>后再来回复', 'warning', 5000); | |||
| } else { | |||
| $(`._feedback_reply`).html(""); | |||
| $(`._feedback_reply[for="${fid}"]`).html(replyPannel); | |||
| } | |||
| }); | |||
| $(`._feedback_reply[for="${fid}"]`).html('<i class="fa fa-spinner"></i>'); | |||
| } | |||
| //加载回复评论 | |||
| function LoadReplyFeedbacks(fid) { | |||
| $(`.feedback_replies[for="${fid}"]`).html('<i class="fa fa-spinner"></i>'); | |||
| $.get("{dede:field name='phpurl'/}/feedback.php", { | |||
| "aid" : "{dede:field name='id'/}", | |||
| "fid" : fid, | |||
| }, function (data) { | |||
| let result = JSON.parse(data); | |||
| let tpl = `<div class="media py-3"> | |||
| <img src="~face~" class="face mr-3"> | |||
| <div class="media-body"> | |||
| <div class="feedback-infos pb-3"> | |||
| <div class="feedback-basic"> | |||
| <span>~username~</span> | |||
| <span>~dtimestr~</span> | |||
| </div> | |||
| <div class="feedback-action"> | |||
| <a href="javascript:GoodFeedback(~id~, ~good~)"> | |||
| <i class="fa fa-thumbs-up"></i> | |||
| <i id="feedbackGood~id~">~good~</i> | |||
| </a> | |||
| </div> | |||
| </div> | |||
| <div class="feedback-content">~msg~</div> | |||
| </div> | |||
| </div>`; | |||
| if (result.code === 200) { | |||
| $(`.feedback_replies[for="${fid}"]`).html(""); | |||
| for (let i = 0; i < result.data.length; i++) { | |||
| const feedback = result.data[i]; | |||
| let rs = tpl; | |||
| for (const key in feedback) { | |||
| if (feedback.hasOwnProperty(key)) { | |||
| rs = rs.replace(new RegExp(`~${key}~`,"gm"), feedback[key]) | |||
| } | |||
| } | |||
| $(`.feedback_replies[for="${fid}"]`).append(rs); | |||
| } | |||
| } | |||
| }) | |||
| } | |||
| //赞 | |||
| function GoodFeedback(fid, g) { | |||
| let good = { | |||
| action : "send", | |||
| feedbacktype : "good", | |||
| good : g, | |||
| fid : fid, | |||
| } | |||
| $.post("{dede:field name='phpurl'/}/feedback.php", good, function (data) { | |||
| let result = JSON.parse(data); | |||
| $(`#feedbackGood${fid}`).html(result.data); | |||
| }) | |||
| } | |||
| </script> | |||
| </body> | |||
| </html> | |||
| @@ -11,9 +11,6 @@ | |||
| <link rel="stylesheet" href="{dede:global.cfg_cmsurl/}/static/web/css/bootstrap.min.css"> | |||
| <link rel="stylesheet" href="{dede:global.cfg_cmsurl/}/static/web/css/style.css"> | |||
| <link rel="shortcut icon" href="{dede:global.cfg_cmsurl/}/static/web/img/favicon.ico"> | |||
| <script>const PHPURL = '{dede:field name="phpurl"/}';</script> | |||
| <script src="{dede:global.cfg_cmsurl/}/static/web/js/jquery.min.js"></script> | |||
| <script src="{dede:global.cfg_cmsurl/}/static/web/js/bootstrap.min.js"></script> | |||
| </head> | |||
| <body class="body-bg"> | |||
| {dede:include filename='top.htm'/} | |||
| @@ -86,6 +83,176 @@ | |||
| </div> | |||
| </div> | |||
| </main> | |||
| <script>const PHPURL = '{dede:field name="phpurl"/}';</script> | |||
| {dede:include filename='foot.htm'/} | |||
| <script> | |||
| //获取顶踩数据 | |||
| function GetDigg(aid,cid) { | |||
| let url = `{dede:global.cfg_phpurl/}/digg_ajax.php?id=${aid}&cid=${cid}&format=json`; | |||
| $.get(url, function (data) { | |||
| let reval = JSON.parse(data); | |||
| if (reval.code === 200) { | |||
| $("#goodpost").html(reval.data.goodpost); | |||
| $("#badpost").html(reval.data.badpost); | |||
| $("#goodper").css("width", `${reval.data.goodper}%`) | |||
| $("#badper").css("width", `${reval.data.badper}%`) | |||
| } | |||
| }) | |||
| } | |||
| function PostDigg(ftype, aid) { | |||
| var saveid = GetCookie('diggid'); | |||
| if (saveid != null) { | |||
| var saveids = saveid.split(','); | |||
| var hasid = false; | |||
| saveid = ''; | |||
| j = 1; | |||
| for (i = saveids.length - 1; i >= 0; i--) { | |||
| if (saveids[i] == aid && hasid) continue; | |||
| else { | |||
| if (saveids[i] == aid && !hasid) hasid = true; | |||
| saveid += (saveid == '' ? saveids[i] : ',' + saveids[i]); | |||
| j++; | |||
| if (j == 20 && hasid) break; | |||
| if (j == 19 && !hasid) break; | |||
| } | |||
| } | |||
| if (hasid) { ShowMsg("您已经顶过该帖,请不要重复顶帖 "); return; } | |||
| else saveid += ',' + aid; | |||
| SetCookie('diggid', saveid, 1); | |||
| } | |||
| else { | |||
| SetCookie('diggid', aid, 1); | |||
| } | |||
| let url = "{dede:global.cfg_phpurl/}/digg_ajax.php?action=" + ftype + "&id=" + aid + "&format=json&cid={dede:field.channel/}"; | |||
| $.get(url, function (data) { | |||
| let reval = JSON.parse(data); | |||
| if (reval.code === 200) { | |||
| $("#goodpost").html(reval.data.goodpost); | |||
| $("#badpost").html(reval.data.badpost); | |||
| $("#goodper").css("width", `${reval.data.goodper}%`) | |||
| $("#badper").css("width", `${reval.data.badper}%`) | |||
| } | |||
| }); | |||
| } | |||
| GetDigg("{dede:field.id/}", "{dede:field.channel/}"); | |||
| //发表评论 | |||
| function SendFeedback() { | |||
| let feedback = { | |||
| action: "send", | |||
| comtype: "comments", | |||
| aid: "{dede:field name='id'/}", | |||
| msg: $("#iptMsg").val(), | |||
| username: $("#iptUsername").val(), | |||
| validate: $("#iptValidate").val(), | |||
| notuser: $("#iptAny").is(":checked") ? "1" : "", | |||
| }; | |||
| $.post("{dede:field name='phpurl'/}/feedback.php", feedback, function (data) { | |||
| let result = JSON.parse(data); | |||
| if (result.code === 200) { | |||
| ShowAlert("#feedback-alert", result.msg, "success"); | |||
| $("#iptMsg").val(""); | |||
| $("#iptValidate").val(""); | |||
| ($("#iptUsername").attr("disabled") !== "disabled") && $("#iptUsername").val(""); | |||
| $("#validateimg").attr("src", '{dede:global.cfg_cmspath/}/apps/vdimgck.php?' + new Date().getTime() + Math.round(Math.random() * 10000)); | |||
| } else { | |||
| ShowAlert("#feedback-alert", `评论失败:${result.msg}`, "danger"); | |||
| $("#validateimg").attr("src", '{dede:global.cfg_cmspath/}/apps/vdimgck.php?' + new Date().getTime() + Math.round(Math.random() * 10000)); | |||
| } | |||
| }); | |||
| } | |||
| //进行回复,回复必须登录 | |||
| function SendReplyFeedback(fid) { | |||
| let content = $(`._feedback_reply[for="${fid}"]`).find(".iptReplyContent").val(); | |||
| let reply = { | |||
| action : "send", | |||
| comtype : "reply", | |||
| fid : fid, | |||
| aid : "{dede:field name='id'/}", | |||
| msg : content, | |||
| } | |||
| $.post("{dede:field name='phpurl'/}/feedback.php", reply, function (data) { | |||
| let result = JSON.parse(data); | |||
| if (result.code === 200) { | |||
| ShowAlert(`._feedback_reply[for="${fid}"]`, result.msg, "success"); | |||
| } else { | |||
| ShowAlert(`._feedback_reply[for="${fid}"]`, `评论失败:${result.msg}`, "danger"); | |||
| } | |||
| }) | |||
| $(`._feedback_reply[for="${fid}"]`).find(".btn-send").attr("disabled", "disabled"); | |||
| } | |||
| //回复某个评论 | |||
| function ReplyFeedback(fid) { | |||
| let replyPannel = `<div class="form-group"> | |||
| <div class="input-group"> | |||
| <input type="text" class="form-control iptReplyContent"> | |||
| <button type="button" class="btn btn-success btn-send" onclick='SendReplyFeedback(${fid})'>评论</button> | |||
| </div> | |||
| </div>`; | |||
| $.get("{dede:global.cfg_cmsurl/}/user/api.php?format=json", function(result) { | |||
| if (result.code !== 200) { | |||
| $(`._feedback_reply`).html(""); | |||
| ShowAlert(`._feedback_reply[for="${fid}"]`, '回复需要登录会员中心,您可以<a href="{dede:global.cfg_cmsurl/}/user/login.php">点击登录</a>后再来回复', 'warning', 5000); | |||
| } else { | |||
| $(`._feedback_reply`).html(""); | |||
| $(`._feedback_reply[for="${fid}"]`).html(replyPannel); | |||
| } | |||
| }); | |||
| $(`._feedback_reply[for="${fid}"]`).html('<i class="fa fa-spinner"></i>'); | |||
| } | |||
| //加载回复评论 | |||
| function LoadReplyFeedbacks(fid) { | |||
| $(`.feedback_replies[for="${fid}"]`).html('<i class="fa fa-spinner"></i>'); | |||
| $.get("{dede:field name='phpurl'/}/feedback.php", { | |||
| "aid" : "{dede:field name='id'/}", | |||
| "fid" : fid, | |||
| }, function (data) { | |||
| let result = JSON.parse(data); | |||
| let tpl = `<div class="media py-3"> | |||
| <img src="~face~" class="face mr-3"> | |||
| <div class="media-body"> | |||
| <div class="feedback-infos pb-3"> | |||
| <div class="feedback-basic"> | |||
| <span>~username~</span> | |||
| <span>~dtimestr~</span> | |||
| </div> | |||
| <div class="feedback-action"> | |||
| <a href="javascript:GoodFeedback(~id~, ~good~)"> | |||
| <i class="fa fa-thumbs-up"></i> | |||
| <i id="feedbackGood~id~">~good~</i> | |||
| </a> | |||
| </div> | |||
| </div> | |||
| <div class="feedback-content">~msg~</div> | |||
| </div> | |||
| </div>`; | |||
| if (result.code === 200) { | |||
| $(`.feedback_replies[for="${fid}"]`).html(""); | |||
| for (let i = 0; i < result.data.length; i++) { | |||
| const feedback = result.data[i]; | |||
| let rs = tpl; | |||
| for (const key in feedback) { | |||
| if (feedback.hasOwnProperty(key)) { | |||
| rs = rs.replace(new RegExp(`~${key}~`,"gm"), feedback[key]) | |||
| } | |||
| } | |||
| $(`.feedback_replies[for="${fid}"]`).append(rs); | |||
| } | |||
| } | |||
| }) | |||
| } | |||
| //赞 | |||
| function GoodFeedback(fid, g) { | |||
| let good = { | |||
| action : "send", | |||
| feedbacktype : "good", | |||
| good : g, | |||
| fid : fid, | |||
| } | |||
| $.post("{dede:field name='phpurl'/}/feedback.php", good, function (data) { | |||
| let result = JSON.parse(data); | |||
| $(`#feedbackGood${fid}`).html(result.data); | |||
| }) | |||
| } | |||
| </script> | |||
| </body> | |||
| </html> | |||
| @@ -12,10 +12,6 @@ | |||
| <link rel="stylesheet" href="{dede:global.cfg_cmsurl/}/static/web/css/style.css"> | |||
| <link rel="shortcut icon" href="{dede:global.cfg_cmsurl/}/static/web/img/favicon.ico"> | |||
| <link rel="stylesheet" href="{dede:global.cfg_cmsurl/}/static/ckeditor/plugins/codesnippet/lib/highlight/styles/default.css"> | |||
| <script>const PHPURL = '{dede:field name="phpurl"/}';</script> | |||
| <script src="{dede:global.cfg_cmsurl/}/static/web/js/jquery.min.js"></script> | |||
| <script src="{dede:global.cfg_cmsurl/}/static/web/js/bootstrap.min.js"></script> | |||
| <script src="{dede:global.cfg_cmsurl/}/static/ckeditor/plugins/codesnippet/lib/highlight/highlight.pack.js"></script> | |||
| </head> | |||
| <body class="body-bg"> | |||
| {dede:include filename='top.htm'/} | |||
| @@ -88,7 +84,178 @@ | |||
| </div> | |||
| </div> | |||
| </main> | |||
| <script>const PHPURL = '{dede:field name="phpurl"/}';</script> | |||
| {dede:include filename='foot.htm'/} | |||
| <script src="{dede:global.cfg_cmsurl/}/static/ckeditor/plugins/codesnippet/lib/highlight/highlight.pack.js"></script> | |||
| <script>hljs.initHighlightingOnLoad();</script> | |||
| <script> | |||
| //获取顶踩数据 | |||
| function GetDigg(aid,cid) { | |||
| let url = `{dede:global.cfg_phpurl/}/digg_ajax.php?id=${aid}&cid=${cid}&format=json`; | |||
| $.get(url, function (data) { | |||
| let reval = JSON.parse(data); | |||
| if (reval.code === 200) { | |||
| $("#goodpost").html(reval.data.goodpost); | |||
| $("#badpost").html(reval.data.badpost); | |||
| $("#goodper").css("width", `${reval.data.goodper}%`) | |||
| $("#badper").css("width", `${reval.data.badper}%`) | |||
| } | |||
| }) | |||
| } | |||
| function PostDigg(ftype, aid) { | |||
| var saveid = GetCookie('diggid'); | |||
| if (saveid != null) { | |||
| var saveids = saveid.split(','); | |||
| var hasid = false; | |||
| saveid = ''; | |||
| j = 1; | |||
| for (i = saveids.length - 1; i >= 0; i--) { | |||
| if (saveids[i] == aid && hasid) continue; | |||
| else { | |||
| if (saveids[i] == aid && !hasid) hasid = true; | |||
| saveid += (saveid == '' ? saveids[i] : ',' + saveids[i]); | |||
| j++; | |||
| if (j == 20 && hasid) break; | |||
| if (j == 19 && !hasid) break; | |||
| } | |||
| } | |||
| if (hasid) { ShowMsg("您已经顶过该帖,请不要重复顶帖 "); return; } | |||
| else saveid += ',' + aid; | |||
| SetCookie('diggid', saveid, 1); | |||
| } | |||
| else { | |||
| SetCookie('diggid', aid, 1); | |||
| } | |||
| let url = "{dede:global.cfg_phpurl/}/digg_ajax.php?action=" + ftype + "&id=" + aid + "&format=json&cid={dede:field.channel/}"; | |||
| $.get(url, function (data) { | |||
| let reval = JSON.parse(data); | |||
| if (reval.code === 200) { | |||
| $("#goodpost").html(reval.data.goodpost); | |||
| $("#badpost").html(reval.data.badpost); | |||
| $("#goodper").css("width", `${reval.data.goodper}%`) | |||
| $("#badper").css("width", `${reval.data.badper}%`) | |||
| } | |||
| }); | |||
| } | |||
| GetDigg("{dede:field.id/}", "{dede:field.channel/}"); | |||
| //发表评论 | |||
| function SendFeedback() { | |||
| let feedback = { | |||
| action: "send", | |||
| comtype: "comments", | |||
| aid: "{dede:field name='id'/}", | |||
| msg: $("#iptMsg").val(), | |||
| username: $("#iptUsername").val(), | |||
| validate: $("#iptValidate").val(), | |||
| notuser: $("#iptAny").is(":checked") ? "1" : "", | |||
| }; | |||
| $.post("{dede:field name='phpurl'/}/feedback.php", feedback, function (data) { | |||
| let result = JSON.parse(data); | |||
| if (result.code === 200) { | |||
| ShowAlert("#feedback-alert", result.msg, "success"); | |||
| $("#iptMsg").val(""); | |||
| $("#iptValidate").val(""); | |||
| ($("#iptUsername").attr("disabled") !== "disabled") && $("#iptUsername").val(""); | |||
| $("#validateimg").attr("src", '{dede:global.cfg_cmspath/}/apps/vdimgck.php?' + new Date().getTime() + Math.round(Math.random() * 10000)); | |||
| } else { | |||
| ShowAlert("#feedback-alert", `评论失败:${result.msg}`, "danger"); | |||
| $("#validateimg").attr("src", '{dede:global.cfg_cmspath/}/apps/vdimgck.php?' + new Date().getTime() + Math.round(Math.random() * 10000)); | |||
| } | |||
| }); | |||
| } | |||
| //进行回复,回复必须登录 | |||
| function SendReplyFeedback(fid) { | |||
| let content = $(`._feedback_reply[for="${fid}"]`).find(".iptReplyContent").val(); | |||
| let reply = { | |||
| action : "send", | |||
| comtype : "reply", | |||
| fid : fid, | |||
| aid : "{dede:field name='id'/}", | |||
| msg : content, | |||
| } | |||
| $.post("{dede:field name='phpurl'/}/feedback.php", reply, function (data) { | |||
| let result = JSON.parse(data); | |||
| if (result.code === 200) { | |||
| ShowAlert(`._feedback_reply[for="${fid}"]`, result.msg, "success"); | |||
| } else { | |||
| ShowAlert(`._feedback_reply[for="${fid}"]`, `评论失败:${result.msg}`, "danger"); | |||
| } | |||
| }) | |||
| $(`._feedback_reply[for="${fid}"]`).find(".btn-send").attr("disabled", "disabled"); | |||
| } | |||
| //回复某个评论 | |||
| function ReplyFeedback(fid) { | |||
| let replyPannel = `<div class="form-group"> | |||
| <div class="input-group"> | |||
| <input type="text" class="form-control iptReplyContent"> | |||
| <button type="button" class="btn btn-success btn-send" onclick='SendReplyFeedback(${fid})'>评论</button> | |||
| </div> | |||
| </div>`; | |||
| $.get("{dede:global.cfg_cmsurl/}/user/api.php?format=json", function(result) { | |||
| if (result.code !== 200) { | |||
| $(`._feedback_reply`).html(""); | |||
| ShowAlert(`._feedback_reply[for="${fid}"]`, '回复需要登录会员中心,您可以<a href="{dede:global.cfg_cmsurl/}/user/login.php">点击登录</a>后再来回复', 'warning', 5000); | |||
| } else { | |||
| $(`._feedback_reply`).html(""); | |||
| $(`._feedback_reply[for="${fid}"]`).html(replyPannel); | |||
| } | |||
| }); | |||
| $(`._feedback_reply[for="${fid}"]`).html('<i class="fa fa-spinner"></i>'); | |||
| } | |||
| //加载回复评论 | |||
| function LoadReplyFeedbacks(fid) { | |||
| $(`.feedback_replies[for="${fid}"]`).html('<i class="fa fa-spinner"></i>'); | |||
| $.get("{dede:field name='phpurl'/}/feedback.php", { | |||
| "aid" : "{dede:field name='id'/}", | |||
| "fid" : fid, | |||
| }, function (data) { | |||
| let result = JSON.parse(data); | |||
| let tpl = `<div class="media py-3"> | |||
| <img src="~face~" class="face mr-3"> | |||
| <div class="media-body"> | |||
| <div class="feedback-infos pb-3"> | |||
| <div class="feedback-basic"> | |||
| <span>~username~</span> | |||
| <span>~dtimestr~</span> | |||
| </div> | |||
| <div class="feedback-action"> | |||
| <a href="javascript:GoodFeedback(~id~, ~good~)"> | |||
| <i class="fa fa-thumbs-up"></i> | |||
| <i id="feedbackGood~id~">~good~</i> | |||
| </a> | |||
| </div> | |||
| </div> | |||
| <div class="feedback-content">~msg~</div> | |||
| </div> | |||
| </div>`; | |||
| if (result.code === 200) { | |||
| $(`.feedback_replies[for="${fid}"]`).html(""); | |||
| for (let i = 0; i < result.data.length; i++) { | |||
| const feedback = result.data[i]; | |||
| let rs = tpl; | |||
| for (const key in feedback) { | |||
| if (feedback.hasOwnProperty(key)) { | |||
| rs = rs.replace(new RegExp(`~${key}~`,"gm"), feedback[key]) | |||
| } | |||
| } | |||
| $(`.feedback_replies[for="${fid}"]`).append(rs); | |||
| } | |||
| } | |||
| }) | |||
| } | |||
| //赞 | |||
| function GoodFeedback(fid, g) { | |||
| let good = { | |||
| action : "send", | |||
| feedbacktype : "good", | |||
| good : g, | |||
| fid : fid, | |||
| } | |||
| $.post("{dede:field name='phpurl'/}/feedback.php", good, function (data) { | |||
| let result = JSON.parse(data); | |||
| $(`#feedbackGood${fid}`).html(result.data); | |||
| }) | |||
| } | |||
| </script> | |||
| </body> | |||
| </html> | |||
| @@ -11,9 +11,6 @@ | |||
| <link rel="stylesheet" href="{dede:global.cfg_cmsurl/}/static/web/css/bootstrap.min.css"> | |||
| <link rel="stylesheet" href="{dede:global.cfg_cmsurl/}/static/web/css/style.css"> | |||
| <link rel="shortcut icon" href="{dede:global.cfg_cmsurl/}/static/web/img/favicon.ico"> | |||
| <script>const PHPURL = '{dede:field name="phpurl"/}';</script> | |||
| <script src="{dede:global.cfg_cmsurl/}/static/web/js/jquery.min.js"></script> | |||
| <script src="{dede:global.cfg_cmsurl/}/static/web/js/bootstrap.min.js"></script> | |||
| <script> | |||
| var shortname = "{dede:global.art_shortname/}"; | |||
| var npage = parseInt("{dede:field name = 'nowpage'/}"); | |||
| @@ -150,6 +147,176 @@ | |||
| </div> | |||
| </div> | |||
| </main> | |||
| <script>const PHPURL = '{dede:field name="phpurl"/}';</script> | |||
| {dede:include filename='foot.htm'/} | |||
| <script> | |||
| //获取顶踩数据 | |||
| function GetDigg(aid,cid) { | |||
| let url = `{dede:global.cfg_phpurl/}/digg_ajax.php?id=${aid}&cid=${cid}&format=json`; | |||
| $.get(url, function (data) { | |||
| let reval = JSON.parse(data); | |||
| if (reval.code === 200) { | |||
| $("#goodpost").html(reval.data.goodpost); | |||
| $("#badpost").html(reval.data.badpost); | |||
| $("#goodper").css("width", `${reval.data.goodper}%`) | |||
| $("#badper").css("width", `${reval.data.badper}%`) | |||
| } | |||
| }) | |||
| } | |||
| function PostDigg(ftype, aid) { | |||
| var saveid = GetCookie('diggid'); | |||
| if (saveid != null) { | |||
| var saveids = saveid.split(','); | |||
| var hasid = false; | |||
| saveid = ''; | |||
| j = 1; | |||
| for (i = saveids.length - 1; i >= 0; i--) { | |||
| if (saveids[i] == aid && hasid) continue; | |||
| else { | |||
| if (saveids[i] == aid && !hasid) hasid = true; | |||
| saveid += (saveid == '' ? saveids[i] : ',' + saveids[i]); | |||
| j++; | |||
| if (j == 20 && hasid) break; | |||
| if (j == 19 && !hasid) break; | |||
| } | |||
| } | |||
| if (hasid) { ShowMsg("您已经顶过该帖,请不要重复顶帖 "); return; } | |||
| else saveid += ',' + aid; | |||
| SetCookie('diggid', saveid, 1); | |||
| } | |||
| else { | |||
| SetCookie('diggid', aid, 1); | |||
| } | |||
| let url = "{dede:global.cfg_phpurl/}/digg_ajax.php?action=" + ftype + "&id=" + aid + "&format=json&cid={dede:field.channel/}"; | |||
| $.get(url, function (data) { | |||
| let reval = JSON.parse(data); | |||
| if (reval.code === 200) { | |||
| $("#goodpost").html(reval.data.goodpost); | |||
| $("#badpost").html(reval.data.badpost); | |||
| $("#goodper").css("width", `${reval.data.goodper}%`) | |||
| $("#badper").css("width", `${reval.data.badper}%`) | |||
| } | |||
| }); | |||
| } | |||
| GetDigg("{dede:field.id/}", "{dede:field.channel/}"); | |||
| //发表评论 | |||
| function SendFeedback() { | |||
| let feedback = { | |||
| action: "send", | |||
| comtype: "comments", | |||
| aid: "{dede:field name='id'/}", | |||
| msg: $("#iptMsg").val(), | |||
| username: $("#iptUsername").val(), | |||
| validate: $("#iptValidate").val(), | |||
| notuser: $("#iptAny").is(":checked") ? "1" : "", | |||
| }; | |||
| $.post("{dede:field name='phpurl'/}/feedback.php", feedback, function (data) { | |||
| let result = JSON.parse(data); | |||
| if (result.code === 200) { | |||
| ShowAlert("#feedback-alert", result.msg, "success"); | |||
| $("#iptMsg").val(""); | |||
| $("#iptValidate").val(""); | |||
| ($("#iptUsername").attr("disabled") !== "disabled") && $("#iptUsername").val(""); | |||
| $("#validateimg").attr("src", '{dede:global.cfg_cmspath/}/apps/vdimgck.php?' + new Date().getTime() + Math.round(Math.random() * 10000)); | |||
| } else { | |||
| ShowAlert("#feedback-alert", `评论失败:${result.msg}`, "danger"); | |||
| $("#validateimg").attr("src", '{dede:global.cfg_cmspath/}/apps/vdimgck.php?' + new Date().getTime() + Math.round(Math.random() * 10000)); | |||
| } | |||
| }); | |||
| } | |||
| //进行回复,回复必须登录 | |||
| function SendReplyFeedback(fid) { | |||
| let content = $(`._feedback_reply[for="${fid}"]`).find(".iptReplyContent").val(); | |||
| let reply = { | |||
| action : "send", | |||
| comtype : "reply", | |||
| fid : fid, | |||
| aid : "{dede:field name='id'/}", | |||
| msg : content, | |||
| } | |||
| $.post("{dede:field name='phpurl'/}/feedback.php", reply, function (data) { | |||
| let result = JSON.parse(data); | |||
| if (result.code === 200) { | |||
| ShowAlert(`._feedback_reply[for="${fid}"]`, result.msg, "success"); | |||
| } else { | |||
| ShowAlert(`._feedback_reply[for="${fid}"]`, `评论失败:${result.msg}`, "danger"); | |||
| } | |||
| }) | |||
| $(`._feedback_reply[for="${fid}"]`).find(".btn-send").attr("disabled", "disabled"); | |||
| } | |||
| //回复某个评论 | |||
| function ReplyFeedback(fid) { | |||
| let replyPannel = `<div class="form-group"> | |||
| <div class="input-group"> | |||
| <input type="text" class="form-control iptReplyContent"> | |||
| <button type="button" class="btn btn-success btn-send" onclick='SendReplyFeedback(${fid})'>评论</button> | |||
| </div> | |||
| </div>`; | |||
| $.get("{dede:global.cfg_cmsurl/}/user/api.php?format=json", function(result) { | |||
| if (result.code !== 200) { | |||
| $(`._feedback_reply`).html(""); | |||
| ShowAlert(`._feedback_reply[for="${fid}"]`, '回复需要登录会员中心,您可以<a href="{dede:global.cfg_cmsurl/}/user/login.php">点击登录</a>后再来回复', 'warning', 5000); | |||
| } else { | |||
| $(`._feedback_reply`).html(""); | |||
| $(`._feedback_reply[for="${fid}"]`).html(replyPannel); | |||
| } | |||
| }); | |||
| $(`._feedback_reply[for="${fid}"]`).html('<i class="fa fa-spinner"></i>'); | |||
| } | |||
| //加载回复评论 | |||
| function LoadReplyFeedbacks(fid) { | |||
| $(`.feedback_replies[for="${fid}"]`).html('<i class="fa fa-spinner"></i>'); | |||
| $.get("{dede:field name='phpurl'/}/feedback.php", { | |||
| "aid" : "{dede:field name='id'/}", | |||
| "fid" : fid, | |||
| }, function (data) { | |||
| let result = JSON.parse(data); | |||
| let tpl = `<div class="media py-3"> | |||
| <img src="~face~" class="face mr-3"> | |||
| <div class="media-body"> | |||
| <div class="feedback-infos pb-3"> | |||
| <div class="feedback-basic"> | |||
| <span>~username~</span> | |||
| <span>~dtimestr~</span> | |||
| </div> | |||
| <div class="feedback-action"> | |||
| <a href="javascript:GoodFeedback(~id~, ~good~)"> | |||
| <i class="fa fa-thumbs-up"></i> | |||
| <i id="feedbackGood~id~">~good~</i> | |||
| </a> | |||
| </div> | |||
| </div> | |||
| <div class="feedback-content">~msg~</div> | |||
| </div> | |||
| </div>`; | |||
| if (result.code === 200) { | |||
| $(`.feedback_replies[for="${fid}"]`).html(""); | |||
| for (let i = 0; i < result.data.length; i++) { | |||
| const feedback = result.data[i]; | |||
| let rs = tpl; | |||
| for (const key in feedback) { | |||
| if (feedback.hasOwnProperty(key)) { | |||
| rs = rs.replace(new RegExp(`~${key}~`,"gm"), feedback[key]) | |||
| } | |||
| } | |||
| $(`.feedback_replies[for="${fid}"]`).append(rs); | |||
| } | |||
| } | |||
| }) | |||
| } | |||
| //赞 | |||
| function GoodFeedback(fid, g) { | |||
| let good = { | |||
| action : "send", | |||
| feedbacktype : "good", | |||
| good : g, | |||
| fid : fid, | |||
| } | |||
| $.post("{dede:field name='phpurl'/}/feedback.php", good, function (data) { | |||
| let result = JSON.parse(data); | |||
| $(`#feedbackGood${fid}`).html(result.data); | |||
| }) | |||
| } | |||
| </script> | |||
| </body> | |||
| </html> | |||
| @@ -11,8 +11,6 @@ | |||
| <link rel="stylesheet" href="{dede:global.cfg_cmsurl/}/static/web/css/bootstrap.min.css"> | |||
| <link rel="stylesheet" href="{dede:global.cfg_cmsurl/}/static/web/css/style.css"> | |||
| <link rel="shortcut icon" href="{dede:global.cfg_cmsurl/}/static/web/img/favicon.ico"> | |||
| <script>const PHPURL = '{dede:field name="phpurl"/}';</script> | |||
| <script src="{dede:global.cfg_cmsurl/}/static/web/js/jquery.min.js"></script> | |||
| </head> | |||
| <body class="body-bg"> | |||
| {dede:include filename='top.htm'/} | |||
| @@ -81,6 +79,176 @@ | |||
| </div> | |||
| </div> | |||
| </main> | |||
| <script>const PHPURL = '{dede:field name="phpurl"/}';</script> | |||
| {dede:include filename='foot.htm'/} | |||
| <script> | |||
| //获取顶踩数据 | |||
| function GetDigg(aid,cid) { | |||
| let url = `{dede:global.cfg_phpurl/}/digg_ajax.php?id=${aid}&cid=${cid}&format=json`; | |||
| $.get(url, function (data) { | |||
| let reval = JSON.parse(data); | |||
| if (reval.code === 200) { | |||
| $("#goodpost").html(reval.data.goodpost); | |||
| $("#badpost").html(reval.data.badpost); | |||
| $("#goodper").css("width", `${reval.data.goodper}%`) | |||
| $("#badper").css("width", `${reval.data.badper}%`) | |||
| } | |||
| }) | |||
| } | |||
| function PostDigg(ftype, aid) { | |||
| var saveid = GetCookie('diggid'); | |||
| if (saveid != null) { | |||
| var saveids = saveid.split(','); | |||
| var hasid = false; | |||
| saveid = ''; | |||
| j = 1; | |||
| for (i = saveids.length - 1; i >= 0; i--) { | |||
| if (saveids[i] == aid && hasid) continue; | |||
| else { | |||
| if (saveids[i] == aid && !hasid) hasid = true; | |||
| saveid += (saveid == '' ? saveids[i] : ',' + saveids[i]); | |||
| j++; | |||
| if (j == 20 && hasid) break; | |||
| if (j == 19 && !hasid) break; | |||
| } | |||
| } | |||
| if (hasid) { ShowMsg("您已经顶过该帖,请不要重复顶帖 "); return; } | |||
| else saveid += ',' + aid; | |||
| SetCookie('diggid', saveid, 1); | |||
| } | |||
| else { | |||
| SetCookie('diggid', aid, 1); | |||
| } | |||
| let url = "{dede:global.cfg_phpurl/}/digg_ajax.php?action=" + ftype + "&id=" + aid + "&format=json&cid={dede:field.channel/}"; | |||
| $.get(url, function (data) { | |||
| let reval = JSON.parse(data); | |||
| if (reval.code === 200) { | |||
| $("#goodpost").html(reval.data.goodpost); | |||
| $("#badpost").html(reval.data.badpost); | |||
| $("#goodper").css("width", `${reval.data.goodper}%`) | |||
| $("#badper").css("width", `${reval.data.badper}%`) | |||
| } | |||
| }); | |||
| } | |||
| GetDigg("{dede:field.id/}", "{dede:field.channel/}"); | |||
| //发表评论 | |||
| function SendFeedback() { | |||
| let feedback = { | |||
| action: "send", | |||
| comtype: "comments", | |||
| aid: "{dede:field name='id'/}", | |||
| msg: $("#iptMsg").val(), | |||
| username: $("#iptUsername").val(), | |||
| validate: $("#iptValidate").val(), | |||
| notuser: $("#iptAny").is(":checked") ? "1" : "", | |||
| }; | |||
| $.post("{dede:field name='phpurl'/}/feedback.php", feedback, function (data) { | |||
| let result = JSON.parse(data); | |||
| if (result.code === 200) { | |||
| ShowAlert("#feedback-alert", result.msg, "success"); | |||
| $("#iptMsg").val(""); | |||
| $("#iptValidate").val(""); | |||
| ($("#iptUsername").attr("disabled") !== "disabled") && $("#iptUsername").val(""); | |||
| $("#validateimg").attr("src", '{dede:global.cfg_cmspath/}/apps/vdimgck.php?' + new Date().getTime() + Math.round(Math.random() * 10000)); | |||
| } else { | |||
| ShowAlert("#feedback-alert", `评论失败:${result.msg}`, "danger"); | |||
| $("#validateimg").attr("src", '{dede:global.cfg_cmspath/}/apps/vdimgck.php?' + new Date().getTime() + Math.round(Math.random() * 10000)); | |||
| } | |||
| }); | |||
| } | |||
| //进行回复,回复必须登录 | |||
| function SendReplyFeedback(fid) { | |||
| let content = $(`._feedback_reply[for="${fid}"]`).find(".iptReplyContent").val(); | |||
| let reply = { | |||
| action : "send", | |||
| comtype : "reply", | |||
| fid : fid, | |||
| aid : "{dede:field name='id'/}", | |||
| msg : content, | |||
| } | |||
| $.post("{dede:field name='phpurl'/}/feedback.php", reply, function (data) { | |||
| let result = JSON.parse(data); | |||
| if (result.code === 200) { | |||
| ShowAlert(`._feedback_reply[for="${fid}"]`, result.msg, "success"); | |||
| } else { | |||
| ShowAlert(`._feedback_reply[for="${fid}"]`, `评论失败:${result.msg}`, "danger"); | |||
| } | |||
| }) | |||
| $(`._feedback_reply[for="${fid}"]`).find(".btn-send").attr("disabled", "disabled"); | |||
| } | |||
| //回复某个评论 | |||
| function ReplyFeedback(fid) { | |||
| let replyPannel = `<div class="form-group"> | |||
| <div class="input-group"> | |||
| <input type="text" class="form-control iptReplyContent"> | |||
| <button type="button" class="btn btn-success btn-send" onclick='SendReplyFeedback(${fid})'>评论</button> | |||
| </div> | |||
| </div>`; | |||
| $.get("{dede:global.cfg_cmsurl/}/user/api.php?format=json", function(result) { | |||
| if (result.code !== 200) { | |||
| $(`._feedback_reply`).html(""); | |||
| ShowAlert(`._feedback_reply[for="${fid}"]`, '回复需要登录会员中心,您可以<a href="{dede:global.cfg_cmsurl/}/user/login.php">点击登录</a>后再来回复', 'warning', 5000); | |||
| } else { | |||
| $(`._feedback_reply`).html(""); | |||
| $(`._feedback_reply[for="${fid}"]`).html(replyPannel); | |||
| } | |||
| }); | |||
| $(`._feedback_reply[for="${fid}"]`).html('<i class="fa fa-spinner"></i>'); | |||
| } | |||
| //加载回复评论 | |||
| function LoadReplyFeedbacks(fid) { | |||
| $(`.feedback_replies[for="${fid}"]`).html('<i class="fa fa-spinner"></i>'); | |||
| $.get("{dede:field name='phpurl'/}/feedback.php", { | |||
| "aid" : "{dede:field name='id'/}", | |||
| "fid" : fid, | |||
| }, function (data) { | |||
| let result = JSON.parse(data); | |||
| let tpl = `<div class="media py-3"> | |||
| <img src="~face~" class="face mr-3"> | |||
| <div class="media-body"> | |||
| <div class="feedback-infos pb-3"> | |||
| <div class="feedback-basic"> | |||
| <span>~username~</span> | |||
| <span>~dtimestr~</span> | |||
| </div> | |||
| <div class="feedback-action"> | |||
| <a href="javascript:GoodFeedback(~id~, ~good~)"> | |||
| <i class="fa fa-thumbs-up"></i> | |||
| <i id="feedbackGood~id~">~good~</i> | |||
| </a> | |||
| </div> | |||
| </div> | |||
| <div class="feedback-content">~msg~</div> | |||
| </div> | |||
| </div>`; | |||
| if (result.code === 200) { | |||
| $(`.feedback_replies[for="${fid}"]`).html(""); | |||
| for (let i = 0; i < result.data.length; i++) { | |||
| const feedback = result.data[i]; | |||
| let rs = tpl; | |||
| for (const key in feedback) { | |||
| if (feedback.hasOwnProperty(key)) { | |||
| rs = rs.replace(new RegExp(`~${key}~`,"gm"), feedback[key]) | |||
| } | |||
| } | |||
| $(`.feedback_replies[for="${fid}"]`).append(rs); | |||
| } | |||
| } | |||
| }) | |||
| } | |||
| //赞 | |||
| function GoodFeedback(fid, g) { | |||
| let good = { | |||
| action : "send", | |||
| feedbacktype : "good", | |||
| good : g, | |||
| fid : fid, | |||
| } | |||
| $.post("{dede:field name='phpurl'/}/feedback.php", good, function (data) { | |||
| let result = JSON.parse(data); | |||
| $(`#feedbackGood${fid}`).html(result.data); | |||
| }) | |||
| } | |||
| </script> | |||
| </body> | |||
| </html> | |||
| @@ -11,8 +11,6 @@ | |||
| <link rel="stylesheet" href="{dede:global.cfg_cmsurl/}/static/web/css/bootstrap.min.css"> | |||
| <link rel="stylesheet" href="{dede:global.cfg_cmsurl/}/static/web/css/style.css"> | |||
| <link rel="shortcut icon" href="{dede:global.cfg_cmsurl/}/static/web/img/favicon.ico"> | |||
| <script>const PHPURL = '{dede:field name="phpurl"/}';</script> | |||
| <script src="{dede:global.cfg_cmsurl/}/static/web/js/jquery.min.js"></script> | |||
| </head> | |||
| <body class="body-bg"> | |||
| {dede:include filename='top.htm'/} | |||
| @@ -89,6 +87,176 @@ | |||
| </div> | |||
| </div> | |||
| </main> | |||
| <script>const PHPURL = '{dede:field name="phpurl"/}';</script> | |||
| {dede:include filename='foot.htm'/} | |||
| <script> | |||
| //获取顶踩数据 | |||
| function GetDigg(aid,cid) { | |||
| let url = `{dede:global.cfg_phpurl/}/digg_ajax.php?id=${aid}&cid=${cid}&format=json`; | |||
| $.get(url, function (data) { | |||
| let reval = JSON.parse(data); | |||
| if (reval.code === 200) { | |||
| $("#goodpost").html(reval.data.goodpost); | |||
| $("#badpost").html(reval.data.badpost); | |||
| $("#goodper").css("width", `${reval.data.goodper}%`) | |||
| $("#badper").css("width", `${reval.data.badper}%`) | |||
| } | |||
| }) | |||
| } | |||
| function PostDigg(ftype, aid) { | |||
| var saveid = GetCookie('diggid'); | |||
| if (saveid != null) { | |||
| var saveids = saveid.split(','); | |||
| var hasid = false; | |||
| saveid = ''; | |||
| j = 1; | |||
| for (i = saveids.length - 1; i >= 0; i--) { | |||
| if (saveids[i] == aid && hasid) continue; | |||
| else { | |||
| if (saveids[i] == aid && !hasid) hasid = true; | |||
| saveid += (saveid == '' ? saveids[i] : ',' + saveids[i]); | |||
| j++; | |||
| if (j == 20 && hasid) break; | |||
| if (j == 19 && !hasid) break; | |||
| } | |||
| } | |||
| if (hasid) { ShowMsg("您已经顶过该帖,请不要重复顶帖 "); return; } | |||
| else saveid += ',' + aid; | |||
| SetCookie('diggid', saveid, 1); | |||
| } | |||
| else { | |||
| SetCookie('diggid', aid, 1); | |||
| } | |||
| let url = "{dede:global.cfg_phpurl/}/digg_ajax.php?action=" + ftype + "&id=" + aid + "&format=json&cid={dede:field.channel/}"; | |||
| $.get(url, function (data) { | |||
| let reval = JSON.parse(data); | |||
| if (reval.code === 200) { | |||
| $("#goodpost").html(reval.data.goodpost); | |||
| $("#badpost").html(reval.data.badpost); | |||
| $("#goodper").css("width", `${reval.data.goodper}%`) | |||
| $("#badper").css("width", `${reval.data.badper}%`) | |||
| } | |||
| }); | |||
| } | |||
| GetDigg("{dede:field.id/}", "{dede:field.channel/}"); | |||
| //发表评论 | |||
| function SendFeedback() { | |||
| let feedback = { | |||
| action: "send", | |||
| comtype: "comments", | |||
| aid: "{dede:field name='id'/}", | |||
| msg: $("#iptMsg").val(), | |||
| username: $("#iptUsername").val(), | |||
| validate: $("#iptValidate").val(), | |||
| notuser: $("#iptAny").is(":checked") ? "1" : "", | |||
| }; | |||
| $.post("{dede:field name='phpurl'/}/feedback.php", feedback, function (data) { | |||
| let result = JSON.parse(data); | |||
| if (result.code === 200) { | |||
| ShowAlert("#feedback-alert", result.msg, "success"); | |||
| $("#iptMsg").val(""); | |||
| $("#iptValidate").val(""); | |||
| ($("#iptUsername").attr("disabled") !== "disabled") && $("#iptUsername").val(""); | |||
| $("#validateimg").attr("src", '{dede:global.cfg_cmspath/}/apps/vdimgck.php?' + new Date().getTime() + Math.round(Math.random() * 10000)); | |||
| } else { | |||
| ShowAlert("#feedback-alert", `评论失败:${result.msg}`, "danger"); | |||
| $("#validateimg").attr("src", '{dede:global.cfg_cmspath/}/apps/vdimgck.php?' + new Date().getTime() + Math.round(Math.random() * 10000)); | |||
| } | |||
| }); | |||
| } | |||
| //进行回复,回复必须登录 | |||
| function SendReplyFeedback(fid) { | |||
| let content = $(`._feedback_reply[for="${fid}"]`).find(".iptReplyContent").val(); | |||
| let reply = { | |||
| action : "send", | |||
| comtype : "reply", | |||
| fid : fid, | |||
| aid : "{dede:field name='id'/}", | |||
| msg : content, | |||
| } | |||
| $.post("{dede:field name='phpurl'/}/feedback.php", reply, function (data) { | |||
| let result = JSON.parse(data); | |||
| if (result.code === 200) { | |||
| ShowAlert(`._feedback_reply[for="${fid}"]`, result.msg, "success"); | |||
| } else { | |||
| ShowAlert(`._feedback_reply[for="${fid}"]`, `评论失败:${result.msg}`, "danger"); | |||
| } | |||
| }) | |||
| $(`._feedback_reply[for="${fid}"]`).find(".btn-send").attr("disabled", "disabled"); | |||
| } | |||
| //回复某个评论 | |||
| function ReplyFeedback(fid) { | |||
| let replyPannel = `<div class="form-group"> | |||
| <div class="input-group"> | |||
| <input type="text" class="form-control iptReplyContent"> | |||
| <button type="button" class="btn btn-success btn-send" onclick='SendReplyFeedback(${fid})'>评论</button> | |||
| </div> | |||
| </div>`; | |||
| $.get("{dede:global.cfg_cmsurl/}/user/api.php?format=json", function(result) { | |||
| if (result.code !== 200) { | |||
| $(`._feedback_reply`).html(""); | |||
| ShowAlert(`._feedback_reply[for="${fid}"]`, '回复需要登录会员中心,您可以<a href="{dede:global.cfg_cmsurl/}/user/login.php">点击登录</a>后再来回复', 'warning', 5000); | |||
| } else { | |||
| $(`._feedback_reply`).html(""); | |||
| $(`._feedback_reply[for="${fid}"]`).html(replyPannel); | |||
| } | |||
| }); | |||
| $(`._feedback_reply[for="${fid}"]`).html('<i class="fa fa-spinner"></i>'); | |||
| } | |||
| //加载回复评论 | |||
| function LoadReplyFeedbacks(fid) { | |||
| $(`.feedback_replies[for="${fid}"]`).html('<i class="fa fa-spinner"></i>'); | |||
| $.get("{dede:field name='phpurl'/}/feedback.php", { | |||
| "aid" : "{dede:field name='id'/}", | |||
| "fid" : fid, | |||
| }, function (data) { | |||
| let result = JSON.parse(data); | |||
| let tpl = `<div class="media py-3"> | |||
| <img src="~face~" class="face mr-3"> | |||
| <div class="media-body"> | |||
| <div class="feedback-infos pb-3"> | |||
| <div class="feedback-basic"> | |||
| <span>~username~</span> | |||
| <span>~dtimestr~</span> | |||
| </div> | |||
| <div class="feedback-action"> | |||
| <a href="javascript:GoodFeedback(~id~, ~good~)"> | |||
| <i class="fa fa-thumbs-up"></i> | |||
| <i id="feedbackGood~id~">~good~</i> | |||
| </a> | |||
| </div> | |||
| </div> | |||
| <div class="feedback-content">~msg~</div> | |||
| </div> | |||
| </div>`; | |||
| if (result.code === 200) { | |||
| $(`.feedback_replies[for="${fid}"]`).html(""); | |||
| for (let i = 0; i < result.data.length; i++) { | |||
| const feedback = result.data[i]; | |||
| let rs = tpl; | |||
| for (const key in feedback) { | |||
| if (feedback.hasOwnProperty(key)) { | |||
| rs = rs.replace(new RegExp(`~${key}~`,"gm"), feedback[key]) | |||
| } | |||
| } | |||
| $(`.feedback_replies[for="${fid}"]`).append(rs); | |||
| } | |||
| } | |||
| }) | |||
| } | |||
| //赞 | |||
| function GoodFeedback(fid, g) { | |||
| let good = { | |||
| action : "send", | |||
| feedbacktype : "good", | |||
| good : g, | |||
| fid : fid, | |||
| } | |||
| $.post("{dede:field name='phpurl'/}/feedback.php", good, function (data) { | |||
| let result = JSON.parse(data); | |||
| $(`#feedbackGood${fid}`).html(result.data); | |||
| }) | |||
| } | |||
| </script> | |||
| </body> | |||
| </html> | |||
| @@ -11,9 +11,6 @@ | |||
| <link rel="stylesheet" href="{dede:global.cfg_cmsurl/}/static/web/css/bootstrap.min.css"> | |||
| <link rel="stylesheet" href="{dede:global.cfg_cmsurl/}/static/web/css/style.css"> | |||
| <link rel="shortcut icon" href="{dede:global.cfg_cmsurl/}/static/web/img/favicon.ico"> | |||
| <script>const PHPURL = '{dede:field name="phpurl"/}';</script> | |||
| <script src="{dede:global.cfg_cmsurl/}/static/web/js/jquery.min.js"></script> | |||
| <script src="{dede:global.cfg_cmsurl/}/static/web/js/bootstrap.min.js"></script> | |||
| </head> | |||
| <body class="body-bg"> | |||
| {dede:include filename='top.htm'/} | |||
| @@ -54,6 +51,7 @@ | |||
| </div> | |||
| </div> | |||
| </main> | |||
| <script>const PHPURL = '{dede:field name="phpurl"/}';</script> | |||
| {dede:include filename='foot.htm'/} | |||
| </body> | |||
| </html> | |||
| @@ -7,13 +7,14 @@ | |||
| <div class="scroll-top"> | |||
| <button id="returntop" title="返回顶部"><i class="fa fa-chevron-up"></i> </button> | |||
| </div> | |||
| <script src="/static/web/js/bootstrap.min.js"></script> | |||
| <script src="/static/web/js/style.js"></script> | |||
| <script src="{dede:global.cfg_cmsurl/}/static/web/js/jquery.min.js"></script> | |||
| <script src="{dede:global.cfg_cmsurl/}/static/web/js/bootstrap.min.js"></script> | |||
| <script src="{dede:global.cfg_cmsurl/}/static/web/js/style.js"></script> | |||
| {dede:statistics/} | |||
| <script> | |||
| $.get("/user/api.php?format=json",function(result) { | |||
| $.get("{dede:global.cfg_memberurl/}/api.php?format=json",function(result) { | |||
| if (result.code === 200) { | |||
| $("#_login").html(`<a href="/user" class="mr-3"><img src="${result.data.facepic}" alt="${result.data.username}" title="${result.data.username}" class="user-img-xs mr-1">${result.data.username}</a><a href="/user/pm.php" class="btn btn-primary btn-sm rounded-circle"><i class="fa fa-bell"></i></a><a href="/user/index_do.php?fmdo=login&dopost=exit" class="btn btn-success btn-sm rounded-circle"><i class="fa fa-sign-out"></i></a>`); | |||
| $("#_login").html(`<a href="{dede:global.cfg_memberurl/}/" class="mr-3"><img src="${result.data.facepic}" alt="${result.data.username}" title="${result.data.username}" class="user-img-xs mr-1">${result.data.username}</a><a href="{dede:global.cfg_memberurl/}/pm.php" class="btn btn-primary btn-sm rounded-circle"><i class="fa fa-bell"></i></a><a href="{dede:global.cfg_memberurl/}/index_do.php?fmdo=login&dopost=exit" class="btn btn-success btn-sm rounded-circle"><i class="fa fa-sign-out"></i></a>`); | |||
| $("#iptUsername").val(result.data.username); | |||
| $("#iptUsername").attr("disabled", "disabled"); | |||
| $(".areaValidate").hide(); | |||
| @@ -11,7 +11,6 @@ | |||
| <link rel="stylesheet" href="{dede:global.cfg_cmsurl/}/static/web/css/bootstrap.min.css"> | |||
| <link rel="stylesheet" href="{dede:global.cfg_cmsurl/}/static/web/css/style.css"> | |||
| <link rel="shortcut icon" href="{dede:global.cfg_cmsurl/}/static/web/img/favicon.ico"> | |||
| <script src="{dede:global.cfg_cmsurl/}/static/web/js/jquery.min.js"></script> | |||
| </head> | |||
| <body class="body-bg"> | |||
| {dede:include filename='top.htm'/} | |||
| @@ -11,7 +11,6 @@ | |||
| <link rel="stylesheet" href="{dede:global.cfg_cmsurl/}/static/web/css/bootstrap.min.css"> | |||
| <link rel="stylesheet" href="{dede:global.cfg_cmsurl/}/static/web/css/style.css"> | |||
| <link rel="shortcut icon" href="{dede:global.cfg_cmsurl/}/static/web/img/favicon.ico"> | |||
| <script src="{dede:global.cfg_cmsurl/}/static/web/js/jquery.min.js"></script> | |||
| </head> | |||
| <body class="body-bg"> | |||
| {dede:include filename='top.htm'/} | |||
| @@ -11,7 +11,6 @@ | |||
| <link rel="stylesheet" href="{dede:global.cfg_cmsurl/}/static/web/css/bootstrap.min.css"> | |||
| <link rel="stylesheet" href="{dede:global.cfg_cmsurl/}/static/web/css/style.css"> | |||
| <link rel="shortcut icon" href="{dede:global.cfg_cmsurl/}/static/web/img/favicon.ico"> | |||
| <script src="{dede:global.cfg_cmsurl/}/static/web/js/jquery.min.js"></script> | |||
| </head> | |||
| <body class="body-bg"> | |||
| {dede:include filename='top.htm'/} | |||
| @@ -11,7 +11,6 @@ | |||
| <link rel="stylesheet" href="{dede:global.cfg_cmsurl/}/static/web/css/bootstrap.min.css"> | |||
| <link rel="stylesheet" href="{dede:global.cfg_cmsurl/}/static/web/css/style.css"> | |||
| <link rel="shortcut icon" href="{dede:global.cfg_cmsurl/}/static/web/img/favicon.ico"> | |||
| <script src="{dede:global.cfg_cmsurl/}/static/web/js/jquery.min.js"></script> | |||
| </head> | |||
| <body class="body-bg"> | |||
| {dede:include filename='top.htm'/} | |||
| @@ -11,7 +11,6 @@ | |||
| <link rel="stylesheet" href="{dede:global.cfg_cmsurl/}/static/web/css/bootstrap.min.css"> | |||
| <link rel="stylesheet" href="{dede:global.cfg_cmsurl/}/static/web/css/style.css"> | |||
| <link rel="shortcut icon" href="{dede:global.cfg_cmsurl/}/static/web/img/favicon.ico"> | |||
| <script src="{dede:global.cfg_cmsurl/}/static/web/js/jquery.min.js"></script> | |||
| </head> | |||
| <body class="body-bg"> | |||
| {dede:include filename='top.htm'/} | |||
| @@ -11,7 +11,6 @@ | |||
| <link rel="stylesheet" href="{dede:global.cfg_cmsurl/}/static/web/css/bootstrap.min.css"> | |||
| <link rel="stylesheet" href="{dede:global.cfg_cmsurl/}/static/web/css/style.css"> | |||
| <link rel="shortcut icon" href="{dede:global.cfg_cmsurl/}/static/web/img/favicon.ico"> | |||
| <script src="{dede:global.cfg_cmsurl/}/static/web/js/jquery.min.js"></script> | |||
| </head> | |||
| <body class="body-bg"> | |||
| {dede:include filename='top.htm'/} | |||
| @@ -11,7 +11,6 @@ | |||
| <link rel="stylesheet" href="{dede:global.cfg_cmsurl/}/static/web/css/bootstrap.min.css"> | |||
| <link rel="stylesheet" href="{dede:global.cfg_cmsurl/}/static/web/css/style.css"> | |||
| <link rel="shortcut icon" href="{dede:global.cfg_cmsurl/}/static/web/img/favicon.ico"> | |||
| <script src="{dede:global.cfg_cmsurl/}/static/web/js/jquery.min.js"></script> | |||
| </head> | |||
| <body class="body-bg"> | |||
| {dede:include filename='top.htm'/} | |||
| @@ -11,7 +11,6 @@ | |||
| <link rel="stylesheet" href="{dede:global.cfg_cmsurl/}/static/web/css/bootstrap.min.css"> | |||
| <link rel="stylesheet" href="{dede:global.cfg_cmsurl/}/static/web/css/style.css"> | |||
| <link rel="shortcut icon" href="{dede:global.cfg_cmsurl/}/static/web/img/favicon.ico"> | |||
| <script src="{dede:global.cfg_cmsurl/}/static/web/js/jquery.min.js"></script> | |||
| </head> | |||
| <body class="body-bg"> | |||
| {dede:include filename='top.htm'/} | |||
| @@ -11,7 +11,6 @@ | |||
| <link rel="stylesheet" href="{dede:global.cfg_cmsurl/}/static/web/css/bootstrap.min.css"> | |||
| <link rel="stylesheet" href="{dede:global.cfg_cmsurl/}/static/web/css/style.css"> | |||
| <link rel="shortcut icon" href="{dede:global.cfg_cmsurl/}/static/web/img/favicon.ico"> | |||
| <script src="{dede:global.cfg_cmsurl/}/static/web/js/jquery.min.js"></script> | |||
| </head> | |||
| <body class="body-bg"> | |||
| {dede:include filename='top.htm'/} | |||
| @@ -11,7 +11,6 @@ | |||
| <link rel="stylesheet" href="{dede:global.cfg_cmsurl/}/static/web/css/bootstrap.min.css"> | |||
| <link rel="stylesheet" href="{dede:global.cfg_cmsurl/}/static/web/css/style.css"> | |||
| <link rel="shortcut icon" href="{dede:global.cfg_cmsurl/}/static/web/img/favicon.ico"> | |||
| <script src="{dede:global.cfg_cmsurl/}/static/web/js/jquery.min.js"></script> | |||
| </head> | |||
| <body class="body-bg"> | |||
| {dede:include filename='top.htm'/} | |||
| @@ -11,7 +11,6 @@ | |||
| <link rel="stylesheet" href="{dede:global.cfg_cmsurl/}/static/web/css/bootstrap.min.css"> | |||
| <link rel="stylesheet" href="{dede:global.cfg_cmsurl/}/static/web/css/style.css"> | |||
| <link rel="shortcut icon" href="{dede:global.cfg_cmsurl/}/static/web/img/favicon.ico"> | |||
| <script src="{dede:global.cfg_cmsurl/}/static/web/js/jquery.min.js"></script> | |||
| </head> | |||
| <body class="body-bg"> | |||
| {dede:include filename='top.htm'/} | |||
| @@ -11,7 +11,6 @@ | |||
| <link rel="stylesheet" href="{dede:global.cfg_cmsurl/}/static/web/css/bootstrap.min.css"> | |||
| <link rel="stylesheet" href="{dede:global.cfg_cmsurl/}/static/web/css/style.css"> | |||
| <link rel="shortcut icon" href="{dede:global.cfg_cmsurl/}/static/web/img/favicon.ico"> | |||
| <script src="{dede:global.cfg_cmsurl/}/static/web/js/jquery.min.js"></script> | |||
| </head> | |||
| <body class="body-bg"> | |||
| {dede:include filename='top.htm'/} | |||
| @@ -12,7 +12,6 @@ | |||
| <link rel="stylesheet" href="{dede:global.cfg_cmsurl/}/static/web/css/style.css"> | |||
| <link rel="shortcut icon" href="{dede:global.cfg_cmsurl/}/static/web/img/favicon.ico"> | |||
| <style>.form-control{display:block;margin-right:0;margin-bottom:10px;width:100%}</style> | |||
| <script src="{dede:global.cfg_cmsurl/}/static/web/js/jquery.min.js"></script> | |||
| </head> | |||
| <body class="body-bg"> | |||
| {dede:include filename='top.htm'/} | |||
| @@ -11,7 +11,6 @@ | |||
| <link rel="stylesheet" href="{dede:global.cfg_cmsurl/}/static/web/css/bootstrap.min.css"> | |||
| <link rel="stylesheet" href="{dede:global.cfg_cmsurl/}/static/web/css/style.css"> | |||
| <link rel="shortcut icon" href="{dede:global.cfg_cmsurl/}/static/web/img/favicon.ico"> | |||
| <script src="{dede:global.cfg_cmsurl/}/static/web/js/jquery.min.js"></script> | |||
| </head> | |||
| <body class="body-bg"> | |||
| {dede:include filename='top.htm'/} | |||
| @@ -11,7 +11,6 @@ | |||
| <link rel="stylesheet" href="{dede:global.cfg_cmsurl/}/static/web/css/bootstrap.min.css"> | |||
| <link rel="stylesheet" href="{dede:global.cfg_cmsurl/}/static/web/css/style.css"> | |||
| <link rel="shortcut icon" href="{dede:global.cfg_cmsurl/}/static/web/img/favicon.ico"> | |||
| <script src="{dede:global.cfg_cmsurl/}/static/web/js/jquery.min.js"></script> | |||
| </head> | |||
| <body class="body-bg"> | |||
| {dede:include filename='top.htm'/} | |||
| @@ -11,7 +11,6 @@ | |||
| <link rel="stylesheet" href="{dede:global.cfg_cmsurl/}/static/web/css/bootstrap.min.css"> | |||
| <link rel="stylesheet" href="{dede:global.cfg_cmsurl/}/static/web/css/style.css"> | |||
| <link rel="shortcut icon" href="{dede:global.cfg_cmsurl/}/static/web/img/favicon.ico"> | |||
| <script src="{dede:global.cfg_cmsurl/}/static/web/js/jquery.min.js"></script> | |||
| </head> | |||
| <body class="body-bg"> | |||
| {dede:include filename='top.htm'/} | |||
| @@ -12,8 +12,6 @@ | |||
| <link rel="stylesheet" href="{dede:global.cfg_cmsurl/}/static/web/css/style.css"> | |||
| <link rel="shortcut icon" href="{dede:global.cfg_cmsurl/}/static/web/img/favicon.ico"> | |||
| <style>.tags{padding-top:10px}.tags a{float:left;margin:5px 10px}.tagc1{color:darkolivegreen}.tagc2{color:blue}.tagc3{color:blueviolet}.tagc4{color:brown}.tagc5{color:cadetblue}.tagc6{color:green}.tagc7{color:coral}.tagc8{color:cornflowerblue}.tagc9{color:black}</style> | |||
| <script>const currentNavTypeID = '{dede:field.id/}';</script> | |||
| <script src="{dede:global.cfg_cmsurl/}/static/web/js/jquery.min.js"></script> | |||
| </head> | |||
| <body class="body-bg"> | |||
| {dede:include filename='top.htm'/} | |||
| @@ -48,6 +46,7 @@ | |||
| </div> | |||
| </div> | |||
| </main> | |||
| <script>const currentNavTypeID = '{dede:field.id/}';</script> | |||
| {dede:include filename='foot.htm'/} | |||
| </body> | |||
| </html> | |||
| @@ -11,8 +11,6 @@ | |||
| <link rel="stylesheet" href="{dede:global.cfg_cmsurl/}/static/web/css/bootstrap.min.css"> | |||
| <link rel="stylesheet" href="{dede:global.cfg_cmsurl/}/static/web/css/style.css"> | |||
| <link rel="shortcut icon" href="{dede:global.cfg_cmsurl/}/static/web/img/favicon.ico"> | |||
| <script>const currentNavTypeID = '{dede:field.id/}';</script> | |||
| <script src="{dede:global.cfg_cmsurl/}/static/web/js/jquery.min.js"></script> | |||
| </head> | |||
| <body class="body-bg"> | |||
| {dede:include filename='top.htm'/} | |||
| @@ -66,6 +64,7 @@ | |||
| </div> | |||
| </div> | |||
| </main> | |||
| <script>const currentNavTypeID = '{dede:field.id/}';</script> | |||
| {dede:include filename='foot.htm'/} | |||
| </body> | |||
| </html> | |||
| @@ -54,124 +54,4 @@ | |||
| </div> | |||
| {/dede:feedback} | |||
| </div> | |||
| </div> | |||
| <script async> | |||
| //发表评论 | |||
| function SendFeedback() { | |||
| let feedback = { | |||
| action: "send", | |||
| comtype: "comments", | |||
| aid: "{dede:field name='id'/}", | |||
| msg: $("#iptMsg").val(), | |||
| username: $("#iptUsername").val(), | |||
| validate: $("#iptValidate").val(), | |||
| notuser: $("#iptAny").is(":checked") ? "1" : "", | |||
| }; | |||
| $.post("{dede:field name='phpurl'/}/feedback.php", feedback, function (data) { | |||
| let result = JSON.parse(data); | |||
| if (result.code === 200) { | |||
| ShowAlert("#feedback-alert", result.msg, "success"); | |||
| $("#iptMsg").val(""); | |||
| $("#iptValidate").val(""); | |||
| ($("#iptUsername").attr("disabled") !== "disabled") && $("#iptUsername").val(""); | |||
| $("#validateimg").attr("src", '{dede:global.cfg_cmspath/}/apps/vdimgck.php?' + new Date().getTime() + Math.round(Math.random() * 10000)); | |||
| } else { | |||
| ShowAlert("#feedback-alert", `评论失败:${result.msg}`, "danger"); | |||
| $("#validateimg").attr("src", '{dede:global.cfg_cmspath/}/apps/vdimgck.php?' + new Date().getTime() + Math.round(Math.random() * 10000)); | |||
| } | |||
| }); | |||
| } | |||
| //进行回复,回复必须登录 | |||
| function SendReplyFeedback(fid) { | |||
| let content = $(`._feedback_reply[for="${fid}"]`).find(".iptReplyContent").val(); | |||
| let reply = { | |||
| action : "send", | |||
| comtype : "reply", | |||
| fid : fid, | |||
| aid : "{dede:field name='id'/}", | |||
| msg : content, | |||
| } | |||
| $.post("{dede:field name='phpurl'/}/feedback.php", reply, function (data) { | |||
| let result = JSON.parse(data); | |||
| if (result.code === 200) { | |||
| ShowAlert(`._feedback_reply[for="${fid}"]`, result.msg, "success"); | |||
| } else { | |||
| ShowAlert(`._feedback_reply[for="${fid}"]`, `评论失败:${result.msg}`, "danger"); | |||
| } | |||
| }) | |||
| $(`._feedback_reply[for="${fid}"]`).find(".btn-send").attr("disabled", "disabled"); | |||
| } | |||
| //回复某个评论 | |||
| function ReplyFeedback(fid) { | |||
| let replyPannel = `<div class="form-group"> | |||
| <div class="input-group"> | |||
| <input type="text" class="form-control iptReplyContent"> | |||
| <button type="button" class="btn btn-success btn-send" onclick='SendReplyFeedback(${fid})'>评论</button> | |||
| </div> | |||
| </div>`; | |||
| $.get("{dede:global.cfg_cmsurl/}/user/api.php?format=json", function(result) { | |||
| if (result.code !== 200) { | |||
| $(`._feedback_reply`).html(""); | |||
| ShowAlert(`._feedback_reply[for="${fid}"]`, '回复需要登录会员中心,您可以<a href="{dede:global.cfg_cmsurl/}/user/login.php">点击登录</a>后再来回复', 'warning', 5000); | |||
| } else { | |||
| $(`._feedback_reply`).html(""); | |||
| $(`._feedback_reply[for="${fid}"]`).html(replyPannel); | |||
| } | |||
| }); | |||
| $(`._feedback_reply[for="${fid}"]`).html('<i class="fa fa-spinner"></i>'); | |||
| } | |||
| //加载回复评论 | |||
| function LoadReplyFeedbacks(fid) { | |||
| $(`.feedback_replies[for="${fid}"]`).html('<i class="fa fa-spinner"></i>'); | |||
| $.get("{dede:field name='phpurl'/}/feedback.php", { | |||
| "aid" : "{dede:field name='id'/}", | |||
| "fid" : fid, | |||
| }, function (data) { | |||
| let result = JSON.parse(data); | |||
| let tpl = `<div class="media py-3"> | |||
| <img src="~face~" class="face mr-3"> | |||
| <div class="media-body"> | |||
| <div class="feedback-infos pb-3"> | |||
| <div class="feedback-basic"> | |||
| <span>~username~</span> | |||
| <span>~dtimestr~</span> | |||
| </div> | |||
| <div class="feedback-action"> | |||
| <a href="javascript:GoodFeedback(~id~, ~good~)"> | |||
| <i class="fa fa-thumbs-up"></i> | |||
| <i id="feedbackGood~id~">~good~</i> | |||
| </a> | |||
| </div> | |||
| </div> | |||
| <div class="feedback-content">~msg~</div> | |||
| </div> | |||
| </div>`; | |||
| if (result.code === 200) { | |||
| $(`.feedback_replies[for="${fid}"]`).html(""); | |||
| for (let i = 0; i < result.data.length; i++) { | |||
| const feedback = result.data[i]; | |||
| let rs = tpl; | |||
| for (const key in feedback) { | |||
| if (feedback.hasOwnProperty(key)) { | |||
| rs = rs.replace(new RegExp(`~${key}~`,"gm"), feedback[key]) | |||
| } | |||
| } | |||
| $(`.feedback_replies[for="${fid}"]`).append(rs); | |||
| } | |||
| } | |||
| }) | |||
| } | |||
| //赞 | |||
| function GoodFeedback(fid, g) { | |||
| let good = { | |||
| action : "send", | |||
| feedbacktype : "good", | |||
| good : g, | |||
| fid : fid, | |||
| } | |||
| $.post("{dede:field name='phpurl'/}/feedback.php", good, function (data) { | |||
| let result = JSON.parse(data); | |||
| $(`#feedbackGood${fid}`).html(result.data); | |||
| }) | |||
| } | |||
| </script> | |||
| </div> | |||
| @@ -17,55 +17,4 @@ | |||
| <div class="progress-bar bg-danger" role="progressbar" id="badper" style="width:{dede:field.badper/}%" aria-valuenow="{dede:field.badper/}" aria-valuemin="0" aria-valuemax="100"></div> | |||
| </div> | |||
| </div> | |||
| </div> | |||
| <script> | |||
| //获取顶踩数据 | |||
| function GetDigg(aid,cid) { | |||
| let url = `{dede:global.cfg_phpurl/}/digg_ajax.php?id=${aid}&cid=${cid}&format=json`; | |||
| $.get(url, function (data) { | |||
| let reval = JSON.parse(data); | |||
| if (reval.code === 200) { | |||
| $("#goodpost").html(reval.data.goodpost); | |||
| $("#badpost").html(reval.data.badpost); | |||
| $("#goodper").css("width", `${reval.data.goodper}%`) | |||
| $("#badper").css("width", `${reval.data.badper}%`) | |||
| } | |||
| }) | |||
| } | |||
| function PostDigg(ftype, aid) { | |||
| var saveid = GetCookie('diggid'); | |||
| if (saveid != null) { | |||
| var saveids = saveid.split(','); | |||
| var hasid = false; | |||
| saveid = ''; | |||
| j = 1; | |||
| for (i = saveids.length - 1; i >= 0; i--) { | |||
| if (saveids[i] == aid && hasid) continue; | |||
| else { | |||
| if (saveids[i] == aid && !hasid) hasid = true; | |||
| saveid += (saveid == '' ? saveids[i] : ',' + saveids[i]); | |||
| j++; | |||
| if (j == 20 && hasid) break; | |||
| if (j == 19 && !hasid) break; | |||
| } | |||
| } | |||
| if (hasid) { ShowMsg("您已经顶过该帖,请不要重复顶帖 "); return; } | |||
| else saveid += ',' + aid; | |||
| SetCookie('diggid', saveid, 1); | |||
| } | |||
| else { | |||
| SetCookie('diggid', aid, 1); | |||
| } | |||
| let url = "{dede:global.cfg_phpurl/}/digg_ajax.php?action=" + ftype + "&id=" + aid + "&format=json&cid={dede:field.channel/}"; | |||
| $.get(url, function (data) { | |||
| let reval = JSON.parse(data); | |||
| if (reval.code === 200) { | |||
| $("#goodpost").html(reval.data.goodpost); | |||
| $("#badpost").html(reval.data.badpost); | |||
| $("#goodper").css("width", `${reval.data.goodper}%`) | |||
| $("#badper").css("width", `${reval.data.badper}%`) | |||
| } | |||
| }); | |||
| } | |||
| GetDigg("{dede:field.id/}", "{dede:field.channel/}"); | |||
| </script> | |||
| </div> | |||