Beispiel #1
0
function filter_post_content($content)
{
    $content = op_h($content);
    $content = limit_picture_count($content);
    $content = op_h($content);
    return $content;
}
 public function detail()
 {
     $aId = I('get.id', 0, 'intval');
     $aPage = I('get.page', 1, 'intval');
     $r = 10;
     $post = D('GroupPost')->getPost($aId);
     $post['group'] = D('Group')->getGroup($post['group_id']);
     $post['content'] = D('ContentHandler')->displayHtmlContent($post['content']);
     $post['content'] = limit_picture_count($post['content']);
     $this->assignNotice($post['group_id']);
     //检测群组、帖子是否存在
     if (!$post || !group_is_exist($post['group_id'])) {
         $this->error('找不到该帖子');
     }
     //增加浏览次数
     D('GroupPost')->where(array('id' => $aId))->setInc('view_count');
     //读取回复列表
     $map = array('post_id' => $aId, 'status' => 1);
     $replyList = D('GroupPostReply')->getList(array('where' => $map, 'order' => 'create_time asc', 'page' => $aPage, 'count' => $r));
     $replyTotalCount = D('GroupPostReply')->where($map)->count();
     //显示页面
     $this->assign('group_id', $post['group_id']);
     $this->assign('post', $post);
     $this->setTitle('{$post.title|op_t} —— 贴吧');
     $this->assign('page', $aPage);
     $this->assign('r', $r);
     $this->assign('replyList', $replyList);
     $this->assign('replyTotalCount', $replyTotalCount);
     $this->assignGroup($post['group_id']);
     $this->display();
 }