最新EMLOG 评论美化完整代码
这个美化版评论基于默认模板美化而成,文件包含module.php,echo_log.php,css,js等。 module.php核心文件,复制粘贴替换掉默认的就行了
echo_log.php内页文件,把代码放在适当的位置
css和js 放在能载入的公共文件。
本篇文章本站收藏记录与分享,套用之后如有错位微调CSS样式即可。
module.php
<?php //blog:评论列表 function blog_comments($comments,$params){ extract($comments); if($commentStacks): ?> <?php $isGravatar = Option::get('isgravatar'); $comnum = count($comments);foreach($comments as $value){if($value['pid'] != 0){$comnum--;}} $page = isset($params[5])?intval($params[5]):1; $i= $comnum - ($page - 1)*Option::get('comment_pnum'); foreach($commentStacks as $cid): $comment = $comments[$cid]; $comment['poster'] = $comment['url'] ? ''.$comment['poster'].'' : $comment['poster']; ?> <div class="comment" id="comment-"> <a name=""> <img src="<?php echo getGravatar($comment['mail']); ?>" /> <a href="#comment-" onclick="commentReply(,this)">@回复 发表于
<?php //blog:发表评论表单 function blog_comments_post($logid,$ckname,$ckmail,$ckurl,$verifyCode,$allow_remark){ if($allow_remark == 'y'): ?> <form method="post" name="commentform" action="<?php echo BLOG_URL; ?>index.php?action=addcom" id="commentform"> <input type="hidden" name="gid" value="<?php echo $logid; ?>" /> <input type="text" name="comname" value="<?php echo $ckname; ?>" placeholder="昵称" required> <input type="email" name="commail" value="<?php echo $ckmail; ?>" placeholder="邮箱" required> <input type="text" name="comurl" value="<?php echo $ckurl; ?>" placeholder="网址"> echo_log.php
CSS
/*评论*/ .ribbon-comment h3{margin:10px 0 0 0;padding-bottom:5px;color:#000;font-weight:700;font-size:18px; border-bottom: 1px solid #f0f0f0;} .ribbon-comment{padding: 5px 15px 10px 15px;} .form-submit .submit-tool{float:left;width: 45px;} .form-submit .submit-tool a{padding:5px 10px;border:1px solid #03a9f4;border-radius:50%;color:#03a9f4;vertical-align:middle;text-align:center;font-size:15px;line-height:32px;cursor:pointer;} .form-submit #comment_submit{float:right;margin:0 10px;padding:6px;width:108px;border:1px solid #03a9f4;border-radius:2px;background:#03a9f4;color:#fff;cursor:pointer;transition:all .2s ease-in 0s;-webkit-appearance:none;} .comment-list .comment{overflow:hidden;border-top:1px solid #e6e6e6;} .comment-list .avatar{float:left;display:block;margin:10px 10px 0 0;} .comment-list .avatar img{width:50px;height:50px;border-radius:50%;transition: all 2s;border: 1px solid #ccc;padding: 2px;} .comment-list .avatar img:hover{transform:rotate(360deg);} .floor{float:right;color:#c3c3c3;font-weight:700;} .comment-time{color:#999;font-size:13px;} .comment-reply #ta{color:#999;} .comment-info{padding:15px 0;} .comment-reply a{padding-left:5px;} .comment-list .comment-children{position:relative;margin-left:60px;border-bottom:none;} .comment-list .comment-children .comment-children{margin-left:0;} .cancel-reply{overflow:hidden;margin:0 0 10px;border-top:1px solid #ebebeb;} .cancel-reply a{float:right;padding:2px 10px;border:1px solid #ebebeb;border-radius:2px;} .cancel-reply #respond{margin-top:10px;} .comment-content{padding-left:65px;margin-top: 10px;} .comment-content img{height: 20px;width: 20px;} .form-submit{overflow:hidden;} .comment-list #pagenavi{overflow:hidden;margin-top:10px;padding:15px;text-align:center;} .comment-list #pagenavi span{margin:2px;padding:5px 11px;border:1px solid #ccc;border-radius:50%;color:#f44336;vertical-align:middle;text-align:center;font-size:14px;line-height:40px;cursor:not-allowed;} .comment-list #pagenavi a{margin:2px;padding:5px 11px;border:1px solid #ccc;border-radius:50%;color:#333;vertical-align:middle;text-align:center;font-size:14px;line-height:40px;} .comment-list #pagenavi em{display:none;} #comment-input{overflow:hidden;margin-bottom:5px;} #comment-input input{float:left;margin:5px 0;padding:0 0 0 10px;width: 33.3333%;height:34px;border:1px solid #ccc;border-radius:3px;background:#fff;background-color:#fff;background-image:none;color:#555;font-size:14px;line-height:1.42857143;-webkit-appearance:none;} #comment{margin:0 10px 10px 0;padding:5px;width:100%;border:1px solid #ccc;border-radius:3px;background:#fff;-webkit-appearance:none;} #comment-post{overflow:hidden;margin:10px 0 10px 0;} @media only screen and (max-width:767px){ #comment-input input{width: 100%;} .comment-list .comment-children{margin-left: 0px!important;} }
JS
/*签到*/ function addNumber(a) { document.getElementById("comment").value += a }
常见问题FAQ
- 链接地址失效了怎么办?
- 例如蓝奏盘,https://www.lanzous.com/i1b2oib 把S改成m或i即可解决,或者请联系本站修复!
- 本站资源和文章版权声明
- 版权声明:本站部分文章来源或改编自互联网及其他公众平台,主要目的在于分享信息,版权归原作者所有,内容仅供读者参考,如有侵权请联系我们,减少损失。联系邮箱:1453316800@qq.com
- 点击下载链接不跳转怎么回事?
- 您好,QQ内打开是不跳转的,少部分浏览器也不跳转,一般的谷歌,UC了,搜狗 360等浏览器都可以跳转。