FLY 1.4 开源美化V2极致版EMLOG主题
<=============================================>
【更新内容】
1.修复顶部二级菜单BUG问题
2.修正美化CSS错乱,CSS细节等优化
3.增加底部导航,搜索等...
4.评论列表优化..
5.增加复制弹窗小功能
6.底部友情链接,集成IP显示,浏览器显示等..
7.优化CSS,看起来更美观
创建SOS.PHP搜索单页即可手机端显示搜索功能
本文皆为蓝优网原创作品,如需转载请带上出处链接!
<=============================================>
IP,浏览器显示代码如下:
首先在include/model/comment_model.php 大概45行左右添加以下代码
$row['useragent'] = htmlspecialchars($row['useragent']);其次同在comment_model.php的249行左右替换以下代码即可
function addComment($name, $content, $mail, $url, $imgcode, $blogId, $pid) { $ipaddr = getIp(); $useragent = $_SERVER['HTTP_USER_AGENT']; $utctimestamp = time(); if($pid != 0) { $comment = $this->getOneComment($pid); $content = '@' . addslashes($comment['poster']) . ':' . $content; } $ischkcomment = Option::get('ischkcomment'); $hide = ROLE == ROLE_VISITOR ? $ischkcomment : 'n'; $sql = 'INSERT INTO '.DB_PREFIX."comment (date,poster,gid,comment,mail,url,hide,ip,pid,useragent) VALUES ('$utctimestamp','$name','$blogId','$content','$mail','$url','$hide','$ipaddr','$pid','$useragent')"; $ret = $this->db->query($sql); $cid = $this->db->insert_id(); $CACHE = Cache::getInstance(); if ($hide == 'n') { $this->db->query('UPDATE '.DB_PREFIX."blog SET comnum = comnum + 1 WHERE gid='$blogId'"); $CACHE->updateCache(array('sta', 'comment')); doAction('comment_saved', $cid); emDirect(Url::log($blogId).'#'.$cid); } else { $CACHE->updateCache('sta'); doAction('comment_saved', $cid); emMsg('评论发表成功,请等待管理员审核', Url::log($blogId)); } }