欢迎访问 舍力博客(www.shuyong.net)
<label><input type="checkbox" value="y" id="simi" name="simi" ><font color="red">私密(仅管理员可见)</font></label>2、在include/model/comment_model.php文件中找到
function addComment($name, $content, $mail, $url, $imgcode, $blogId, $pid) 用下面代码替换 function addComment($name, $content, $mail, $url, $imgcode, $blogId, $pid, $simi)
找到 $hide = ROLE == ROLE_VISITOR ? $ischkcomment : 'n'; 后面加入代码 $simi = isset($_POST['simi']) ? $_POST['simi'] : 'n';
找到代码 $sql = 'INSERT INTO '.DB_PREFIX."comment (date,poster,gid,comment,mail,url,hide,ip,pid) VALUES ('$utctimestamp','$name','$blogId','$content','$mail','$url','$hide','$ipaddr','$pid')"; 用下面代码替换 $sql = 'INSERT INTO '.DB_PREFIX."comment (date,poster,gid,comment,mail,url,hide,ip,pid,simi) VALUES ('$utctimestamp','$name','$blogId','$content','$mail','$url','$hide','$ipaddr','$pid','$simi')";
找到 function replyComment($blogId, $pid, $content, $hide) 用下面代码替换 function replyComment($blogId, $pid, $content, $hide, $simi)
找到 $hide = ROLE == ROLE_VISITOR ? $ischkcomment : 'n'; 后面加入代码 $simi = isset($_POST['simi']) ? $_POST['simi'] : 'n';
找到 $this->db->query("INSERT INTO ".DB_PREFIX."comment (date,poster,gid,comment,mail,url,hide,ip,pid) VALUES ('$utctimestamp','$name','$blogId','$content','$mail','$url','$hide','$ipaddr','$pid')"); 用下面代码替换 $this->db->query("INSERT INTO ".DB_PREFIX."comment (date,poster,gid,comment,mail,url,hide,ip,pid,simi) VALUES ('$utctimestamp','$name','$blogId','$content','$mail','$url','$hide','$ipaddr','$pid','$simi')");评论列表调用方法
<?php if($comment['simi']=='y'){echo '<font color="red">私密(仅管理员可见)</font>';}else{echo $comment['content'];}?>
'mail' => $show_com['mail'], 后面加入代码 'simi' => $show_com['simi'],调用方法
<?php echo $value['content'];?> 用下面代码替换 <?php if($value['simi']=='y'){?><font color="red">私密(仅管理员可见)</font><?php }else{echo $value['content'];}?>
$url = isset($_POST['url']) ? addslashes(trim($_POST['url'])) : ''; 后面添加下面代码 $simi = isset($_POST['simi']) ? addslashes(trim($_POST['simi'])) : 'n';
找到 'url' => $url, 后面添加下面代码 'simi' => $simi,2、在admin/views/comment_edit.php及comment_reply.php文件<form></form>之间任意位置放置如下代码
<li><input type="checkbox" name="simi" value="y"<?php if($simi=='y'){echo ' checked="checked"';}?>><font color="red">仅管理员可查看</font></li>
留言/评论:◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。