public function reply() { $id = trim($_GET['id']); if (empty($id)) { $this->error('留言不存在!'); } $map['id'] = $id; $data = M('Feedback')->where($map)->find(); if ($data) { import("ORG.Util.Input"); $data['num'] = M('Feedback')->where(array('pid' => $id))->count(); $data['content'] = Input::nl2Br($data['content']); } $this->assign('data', $data); $this->display(); }
public function reply() { $id = trim($_GET['id']); if (empty($id)) { $this->error('评论不存在!'); } $map['id'] = $id; $data = M('Comment')->where($map)->find(); if ($data) { import("ORG.Util.Input"); $row = M('Article')->where(array('arcid' => $data['arcid']))->find(); $data['title'] = $row['title']; $data['num'] = M('Comment')->where(array('pid' => $id))->count(); $data['content'] = Input::nl2Br($data['content']); } $this->assign('data', $data); $this->display(); }
public function getCFContent($model) { $obj = D($model); $arcid = $_POST['arcid']; $offset = $_POST['offset']; $offset = $offset * 10; //开始位置 if ($arcid != 0) { $where['arcid'] = $arcid; } $where['pid'] = 0; $list = $obj->field('id,writer,content,time')->where($where)->order('time desc')->limit($offset, 10)->select(); if (!$list) { $this->ajaxReturn(''); } import("ORG.Util.Input"); foreach ($list as $k => $v) { $list[$k]['reply'] = $this->getReply($model, $v['id'], $arcid, $v['writer']); $list[$k]['time'] = date('Y-m-d', $v['time']); $list[$k]['content'] = Input::stripSlashes(Input::nl2Br($v['content'])); } return $list; }