get_string('title'); $page->set_title($page_title); $page->set_heading($page_title); $page->disable_left(); $page->add_block(new Block(null, $this->build_upload_box(), "main", 0)); $page->add_block(new Block(null, "
", "main", 80)); $this->display_paginator($page, "comment/list", null, $page_number, $total_pages); // parts for each image $position = 10; foreach($images as $pair) { $image = $pair[0]; $comments = $pair[1]; $h_filename = html_escape($image->filename); $h_filesize = to_shorthand_int($image->filesize); $w = $image->width; $h = $image->height; $comment_html = ""; $comment_id = 0; foreach($comments as $comment) { $this->inner_id = $comment_id++; $comment_html .= $this->comment_to_html($comment, false); } $html = "

 


"; $html .= "File: id}")."\">$h_filename - ($h_filesize, {$w}x{$h}) - "; $html .= html_escape($image->get_tag_list()); $html .= "
"; $html .= "
" . $this->build_thumb_html($image) . "
"; $html .= "
$comment_html
"; $html .= "
"; $page->add_block(new Block(null, $html, "main", $position++)); } } public function display_recent_comments($comments) { // sidebar fails in this theme } public function build_upload_box() { return "[[ insert upload-and-comment extension here ]]"; } protected function comment_to_html(Comment $comment, $trim=false) { $inner_id = $this->inner_id; // because custom themes can't add params, because PHP 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); $stripped_nonl = str_replace("\n", "\\n", substr($tfe->stripped, 0, 50)); $stripped_nonl = str_replace("\r", "\\r", $stripped_nonl); $h_userlink = "$h_name"; $h_date = $comment->posted; $h_del = $user->can("delete_comment") ? ' - Del' : ''; $h_reply = "[Reply]"; if($inner_id == 0) { return "
$h_userlink$h_del $h_date No.$i_comment_id $h_reply

$h_comment

"; } else { return "
>>". "
$h_userlink$h_del $h_date No.$i_comment_id $h_reply

$h_comment

" . "
"; } } }