make_thread_list($threads, $showAdminOptions);
$page->set_title(html_escape("Forum"));
$page->set_heading(html_escape("Forum"));
$page->add_block(new Block("Forum", $html, "main", 10));
$this->display_paginator($page, "forum/index", null, $pageNumber, $totalPages);
}
public function display_new_thread_composer(Page $page, $threadText = null, $threadTitle = null)
{
global $config, $user;
$max_characters = $config->get_int('forumMaxCharsPerPost');
$html = make_form(make_link("forum/create"));
if (!is_null($threadTitle))
$threadTitle = html_escape($threadTitle);
if(!is_null($threadText))
$threadText = html_escape($threadText);
$html .= "
".
"".
"User | ".
"Message | ".
"
";
foreach ($posts as $post)
{
$message = $post["message"];
$tfe = new TextFormattingEvent($message);
send_event($tfe);
$message = $tfe->formatted;
$message = str_replace('\n\r', '
', $message);
$message = str_replace('\r\n', '
', $message);
$message = str_replace('\n', '
', $message);
$message = str_replace('\r', '
', $message);
$message = stripslashes($message);
$user = "".$post["user_name"]."";
$poster = User::by_name($post["user_name"]);
$gravatar = $poster->get_avatar_html();
if ($post["user_admin"] == "Y") {
$rank = "admin";
} else {
$rank = "user";
}
$postID = $post['id'];
//if($user->is_admin()){
//$delete_link = "Delete";
//} else {
//$delete_link = "";
//}
if($showAdminOptions){
$delete_link = "Delete";
}else{
$delete_link = "";
}
$html .= "".
"".$user." ".$rank." ".$gravatar." | ".
"".$message." | "."
".autodate($post["date"])." |
".$delete_link." |
";
}
$html .= "
";
$this->display_paginator($page, "forum/view/".$threadID, null, $pageNumber, $totalPages);
$page->set_title(html_escape($threadTitle));
$page->set_heading(html_escape($threadTitle));
$page->add_block(new Block("Thread", $html, "main", 20));
}
public function add_actions_block(Page $page, $threadID)
{
$html = '