";
$html .= "
" . $this->build_thumb_html($image) . "
";
$html .= "" . $this->comments_to_html($comments) . "
";
$html .= "";
if($with_postbox) {
$html .= "".($this->build_postbox($image->id))."
";
}
else {
// $html .= "You need to create an account before you can comment
";
$html .= "";
}
$page->add_block(new Block("{$image->id}: ".($image->get_tag_list()), $html, "main", $position));
}
protected function comment_to_html(Comment $comment, $trim=false) {
global $user;
$tfe = new TextFormattingEvent($comment->comment);
send_event($tfe);
$i_uid = int_escape($comment->owner_id);
$h_name = html_escape($comment->owner_name);
$h_poster_ip = html_escape($comment->poster_ip);
$h_comment = ($trim ? substr($tfe->stripped, 0, 50)."..." : $tfe->formatted);
$i_comment_id = int_escape($comment->comment_id);
$i_image_id = int_escape($comment->image_id);
$h_userlink = "$h_name";
$stripped_nonl = str_replace("\n", "\\n", $tfe->stripped);
$stripped_nonl = str_replace("\r", "\\r", $stripped_nonl);
$h_dellink = $user->is_admin() ?
"
($h_poster_ip, Del)" : "";
$h_imagelink = $trim ? ">>>\n" : "";
return "
";
}
}
?>