前言
非本站原创,本站只优化了显示样式(样式来于Mark's Blog)及部分代码,本文转载自Xcnte' s Blog,感谢大佬的教程
教程
以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
}
4 条评论
听说露脸了,过来看看
滴!学生卡!打卡时间:上午3:40:00,请上车的乘客系好安全带~
滴!学生卡!打卡时间:上午3:32:55,请上车的乘客系好安全带~ ::funny:06::
滴!访客卡!请上车的乘客系好安全带,现在是:Mon Jul 29 2019 01:10:03 GMT+0800 (CST)