Exemplo n.º 1
0
<a name="comments"></a>
<legend>Comments</legend>
<?php 
// Comments
// * $id - Content Id
// * $page - Comments page
// * $pageLoc - Where to send new pages to.
$commLib = new comments(ConnectionFactory::get('mongo'));
$commentData = $commLib->getForId($id, $page);
extract($commentData);
$paginationData = array('total' => $total, 'perPage' => comments::PAGE_LIMIT, 'page' => $page, 'url' => $pageLoc, 'where' => 'comments');
$pagination = Partial::render('pagination', $paginationData);
if ($total != 0) {
    echo $pagination;
}
if (empty($comments)) {
    echo '<div class="alert">No comments!</div>';
}
foreach ($comments as $comment) {
    ?>
<table class="table table-bordered">
	<tr>
		<td style="width: 20%">
			<a href="<?php 
    echo Url::format('/user/view/' . $comment['user']['username']);
    ?>
">
				<?php 
    echo $comment['user']['username'];
    ?>
			</a><br />