setVariable(array( 'page_title' => "PostgreSQL ${version}: " . $docs['title'], 'page_content' => $content, 'doc_nav_version' => $version )); $tpl->addBlockfile('comments', 'comments_block', 'docs-comments.html'); if (!$comments = fetch_comments_list($db, $version, pg_fetch_result($rs,0,0), true)) { $tpl->touchBlock('comment_empty'); } else { foreach ($comments as $comment) { // Cleanup the comment $comment['comment'] = str_replace(" ", "  ", $comment['comment']); $comment['comment'] = str_replace("<", "<", $comment['comment']); $comment['comment'] = str_replace(">", ">", $comment['comment']); $comment['comment'] = nl2br($comment['comment']); $tpl->setVariable(array( 'poster' => $comment['posted_by'], 'date' => date('d M Y G:i:s', $comment['timestamp']), 'comment' => $comment['comment'] )); $tpl->parse('comment_loop'); } } $tpl->show(); ?>