/** * 加工帖子数据 * * @param array $read 帖子数据(来自数据库) * @param int $lou 楼层 * @return array */ public function bulidRead($read, $lou) { $read['lou'] = $lou; if (!$read['usehtml']) { $read['content'] = WindSecurity::escapeHTML($read['content']); } $display = 1; if ($read['ifshield']) { $display = 0; $read['content'] = '<div class="shield">此帖已被屏蔽</div>'; } elseif ($this->users[$read['created_userid']]['groupid'] == '6') { list($read['content'], $display) = $this->_bulidBanContent($read['content']); } elseif ($read['useubb']) { $ubb = new PwUbbCodeConvertThread($this->thread, $read, $this->user); $ubb->setImgLazy($this->imgLazy); $this->attach && $this->attach->has($read['pid']) && $ubb->setAttachParser($this->attach); $read['reminds'] && $ubb->setRemindUser($read['reminds']); $read['content'] = PwUbbCode::convert($read['content'], $ubb); } else { $read['content'] = self::escapeSpace($read['content']); } if (empty($display) && $this->attach) { $this->attach->deleteList($read['pid']); } return $this->runWithFilters('bulidRead', $read); }
protected function _bulidContent($read) { if (!$read['useubb']) { return self::escapeSpace($read['content']); } $ubb = new PwUbbCodeConvertThread($this->thread, $read, $this->user); $ubb->setImgLazy($this->imgLazy); $this->attach && $this->attach->has($read['pid']) && $ubb->setAttachParser($this->attach); $read['reminds'] && $ubb->setRemindUser($read['reminds']); return PwUbbCode::convert($read['content'], $ubb); }