前言
非本站原创,本站只优化了显示样式(样式来于Mark's Blog)及部分代码
2019-5-10
修复了每次评论前,有概率要先单击评论框,否则无法发表评论
2019-5-29
修复了添加打卡功能后,移动端中评论框表情无法正常显示
教程
以Handsome主题为例
1、首先在后台
-->设置外观
-->开发者设置
-->自定义JavaScript
加入以下代码:
function addNumber(a) {
var length = document.getElementById("comment").value.length;
if(length> 0){
document.getElementById("comment").focus()
document.getElementById("comment").value += '\n' + a + new Date
}else{
document.getElementById("comment").focus()
document.getElementById("comment").value += a + new Date
}
}
2、打开主题目录的component/comments.php
里面的126
行到141
行:
替换为以下代码:
<div class="comment-form-comment form-group">
<label for="comment"><?php _me("评论") ?> <span class="required text-danger">(请使用真实邮箱地址,方便接收评论回复)</span>
<span class="required text-danger"></span></label>
<textarea id="comment" class="textarea form-control OwO-textarea" name="text" rows="5" placeholder="<?php _me("说点什么吧……") ?>" onkeydown="if(event.ctrlKey&&event.keyCode==13){document.getElementById('submit').click();return false};"><?php $this->remember('text'); ?></textarea>
<div class="OwO" style="display: inline;"></div><div class="OwO" style="display: inline;"><a href="javascript:addNumber('滴!访客卡!请上车的乘客系好安全带,现在是:')" class="OwO-logo"><i class="fontello fontello-user face"></i><span class="OwOlogotext">打卡</span></a></div>
<div class="secret_comment" id="secret_comment" data-toggle="tooltip"
data-original-title="<?php _me("开启该功能,您的评论仅作者和评论双方可见") ?>">
<label class="secret_comment_label control-label"><?php _me("私密评论") ?></label>
<div class="secret_comment_check">
<label class="i-switch i-switch-sm bg-dark m-b-ss m-r">
<input type="checkbox" id="secret_comment_checkbox">
<i></i>
</label>
</div>
</div>
</div>
3、在后台
-->设置外观
-->开发者设置
-->自定义CSS
加入以下代码:
.secret_comment {
top: 5px;
}
.OwO.OwO-open .OwO-body {
display:table
}
版权属于:Xcnte' s Blog(除特别注明外)
本文链接:https://xcnte.com/archives/527/
本站文章采用 知识共享署名4.0 国际许可协议 进行许可,请在转载时注明出处及本声明!
87 comments
呢呵呵呵
为什么全是以handsome为例,没有handsome的我看不懂啊
因为我用的handsome
请问这个店 点赞 按钮是怎么加的呢?
改源代码实现的
时光机的私密评论位置不对
自己调整一下即可
想make一下可以吗?也不是转载,有出处的。
可以
http://hunji.xyz/index.php/archives/107/
博主你这个复制成功的弹窗怎么弄的
js
我部署进去点击打卡,没有反应,没有任何执行。
仔细看文章吧
博客原有js和新添加的有矛盾。
模板是一样的,安装每一步都是弄好了。
我使用并没有问题
或者给一下演示地址
滴!访客卡!请上车的乘客系好安全带,现在是:Thu Aug 29 2019 22:00:50 GMT+0800 (CST)
滴!访客卡!请上车的乘客系好安全带,现在是:Tue Aug 20 2019 15:01:06 GMT+0800 (中国标准时间)
文章写得不错,支持一下!骚年,我怀疑你写了一篇假的文章!
滴!访客卡!请上车的乘客系好安全带,现在是:Sat Aug 10 2019 19:31:39 GMT+0800 (中国标准时间)
滴!访客卡!请上车的乘客系好安全带,现在是:Wed Aug 07 2019 20:01:28 GMT+0800 (CST)
滴!访客卡!请上车的乘客系好安全带,现在是:Sat Aug 03 2019 13:44:52 GMT+0800 (中国标准时间)
滴!访客卡!请上车的乘客系好安全带,现在是:Tue Jul 30 2019 09:01:41 GMT+0800 (中国标准时间)
滴!签到卡!请上车的乘客系好安全带,现在是:Sun Jul 21 2019 15:31:58 GMT+0800 (中国标准时间)
滴!签到卡!请上车的乘客系好安全带,现在是:Thu Jul 04 2019 13:50:09 GMT+0800 (中国标准时间)
滴!签到卡!请上车的乘客系好安全带,现在是:Thu Jul 04 2019 12:39:15 GMT+0800 (中国标准时间)
滴!签到卡!请上车的乘客系好安全带,现在是:Thu Jun 27 2019 13:51:21 GMT+0800 (CST)
滴!签到卡!请上车的乘客系好安全带,现在是:Mon Jun 10 2019 10:17:23 GMT+0800 (中国标准时间)
感谢一位友人的反馈(关于添加打卡功能后,移动端中评论框表情无法正常显示的问题)
已经修复,请更新一下文章的给出的css代码
已修复!请更新文章中给出css代码
ヾ(≧∇≦*)ゝ
好的,感谢反馈,晚点修复