public function displayContent($content, $useubb, $remindUser = array(), $contentLength = 140) { $content = WindSecurity::escapeHTML($content); if ($useubb) { $ubb = new PwUbbCodeConvertThread(); $ubb->setRemindUser($remindUser); $content = PwSimpleUbbCode::convert($content, $contentLength, $ubb); } else { $content = Pw::substrs($content, $contentLength); } return $content; }
protected function _bulidContent($array, &$errcode) { $errcode = array(); $array['content'] = str_replace(array("\r", "\n", "\t"), '', $array['content']); $array['content'] = WindSecurity::escapeHTML($array['content']); if ($array['ifshield']) { $array['subject'] = ''; $array['content'] = '<span style="text-decoration: line-through">此帖已被屏蔽</span>'; } elseif ($array['useubb']) { $ubb = new PwUbbCodeConvertThread(); $array['reminds'] && $ubb->setRemindUser($array['reminds']); $array['pic'] && $ubb->setAttachParser(new PwFreshAttachDisplay($array['pic'])); $array['content'] = PwSimpleUbbCode::convert($array['content'], 140, $ubb); PwSimpleUbbCode::isSubstr() && ($errcode['is_read_all'] = true); } elseif (Pw::strlen($array['content']) > 140) { $errcode['is_read_all'] = true; $array['content'] = Pw::substrs($array['content'], 140); } return $array; }
/** * 加工帖子数据 * * @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); }