/** * 删除帖子回复 */ public function delPostReply() { $ReplyId = I('post.replyId', 0, 'intval'); $this->requireLogin(); $this->checkAuth(null, get_reply_admin($ReplyId), '您无删除权限'); $res = M('GroupPostReply')->delPostReply($ReplyId); if ($res) { $this->success('删除成功'); } else { $this->error('删除失败'); } }
public function editReply() { $aReplyId = I('reply_id', 0, 'intval'); $this->requireLogin(); $this->checkAuth(null, get_reply_admin($aReplyId)); if (IS_POST) { $this->checkActionLimit('edit_group_reply', 'GroupPostReply', $aReplyId, is_login(), true); $aContent = I('post.content', '', 'filter_content'); $groipReplyModel = D('GroupPostReply'); $post = $groipReplyModel->getReply($aReplyId); $data['id'] = $aReplyId; $data['content'] = $aContent; $data['update_time'] = time(); $res = $groipReplyModel->editReply($data); if ($res) { $this->success('编辑回复成功', U('Group/Index/detail', array('id' => $post['post_id']))); } else { $this->error("编辑回复失败"); } } else { if ($aReplyId) { $reply = D('GroupPostReply')->getReply($aReplyId); } else { $this->error('参数出错!'); } $this->setTitle('编辑回复 —— 群组'); //显示页面 $this->assign('reply', $reply); $this->display(); } }