本文整理汇总了PHP中message::translate_bbcodes方法的典型用法代码示例。如果您正苦于以下问题:PHP message::translate_bbcodes方法的具体用法?PHP message::translate_bbcodes怎么用?PHP message::translate_bbcodes使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类message
的用法示例。
在下文中一共展示了message::translate_bbcodes方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: execute
public function execute()
{
$this->output->title = "Posting library demo";
if ($_SERVER["REQUEST_METHOD"] == "POST") {
$input = $_POST["input"];
$message = new message($input);
if ($message->is_spam == false) {
$message->unescaped_output();
$message->translate_bbcodes();
$message->translate_smilies();
$this->output->add_tag("output", $message->content);
} else {
$this->output->add_message("Message seen as spam.");
}
$this->output->add_tag("input", $input);
}
}
示例2: show_weblog
private function show_weblog($weblog_id)
{
if (($weblog = $this->model->get_weblog($weblog_id)) === false) {
$this->output->add_tag("result", "Weblog not found.", $this->url);
return;
}
$this->output->title = $weblog["title"] . " - Weblog";
$weblog["timestamp"] = date("j F Y, H:i", $weblog["timestamp"]);
$this->output->open_tag("weblog", array("id" => $weblog["id"]));
$this->output->add_tag("title", $weblog["title"]);
$this->output->add_tag("content", $weblog["content"]);
$this->output->add_tag("author", $weblog["author"]);
$this->output->add_tag("timestamp", $weblog["timestamp"]);
/* Tags
*/
$this->output->open_tag("tags");
foreach ($weblog["tags"] as $tag) {
$this->output->add_tag("tag", $tag["tag"], array("id" => $tag["id"]));
$this->output->keywords .= ", " . $tag["tag"];
}
$this->output->close_tag();
/* Comments
*/
$this->output->open_tag("comments");
foreach ($weblog["comments"] as $comment) {
unset($comment["weblog_id"]);
unset($comment["ip_address"]);
$message = new message($comment["content"]);
$message->unescaped_output();
$message->translate_bbcodes();
$message->translate_smilies();
$comment["content"] = $message->content;
unset($message);
$comment["timestamp"] = date("j F Y, H:i", $comment["timestamp"]);
$this->output->record($comment, "comment");
}
$this->output->close_tag();
$this->output->close_tag();
}
示例3: show_topic
private function show_topic($topic_id, $response = null)
{
$moderate = $this->user->access_allowed("cms/forum");
if (($topic = $this->model->get_topic($topic_id)) == false) {
$this->output->add_tag("result", "Topic not found.", $this->url);
} else {
$this->output->add_javascript("forum.js");
$this->output->title = $topic["subject"] . " - Forum";
$this->output->open_tag("topic", array("id" => $topic["id"], "forum_id" => $topic["forum_id"]));
$this->output->add_tag("subject", $topic["subject"]);
if ($this->user->logged_in) {
$last_view = $this->model->last_topic_view($topic["id"], true);
}
foreach ($topic["messages"] as $message) {
if ($this->user->logged_in) {
$message["unread"] = show_boolean($last_view < $message["timestamp"]);
}
if ($message["user_id"] == "") {
$message["author"] = $message["username"];
$message["usertype"] = "unregistered";
} else {
$message["usertype"] = "registered";
}
$message["timestamp"] = date("j F Y, H:i", $message["timestamp"]);
$message["content"] = preg_replace("/\\[(config|code|quote)\\]([\r\n]*)/", "[\$1]", $message["content"]);
$post = new message($message["content"]);
$post->unescaped_output();
$post->translate_bbcodes();
$post->translate_smilies();
$message["content"] = $post->content;
unset($post);
$this->output->record($message, "message", array("moderate" => show_boolean($moderate)));
}
if ($response != null) {
$this->output->record($response, "response");
}
$this->output->close_tag();
$this->show_smilies();
}
}