pkg_comments: Only display 10 comments by default.

Add a mechanism to view all comments.

Signed-off-by: Loui Chang <louipc.ist@gmail.com>
This commit is contained in:
Loui Chang 2010-04-15 16:52:55 -04:00
parent 94da2bf1dc
commit 5b8b0757f4
2 changed files with 36 additions and 5 deletions

View file

@ -24,5 +24,15 @@ while (list($indx, $carr) = each($comments)) { ?>
</div>
</blockquote>
<?php
} ?>
}
?>
</div>
<?php
$count = package_comments_count($_GET['ID']);
if ($count > 10 && !isset($_GET['comments'])) {
echo '<div class="pgbox">';
echo '<a href="'. $_SERVER['PHP_SELF'] . '?ID=' . $_REQUEST['ID'] . '&comments=all">'. __('Show all %s comments', $count) . '</a>';
echo '</div>';
}
?>