Support canonical links to packages

This is more user-friendly than supporting package IDs only and can be
used as a basis to support direct links to AUR packages in places where
links are computer-produced (e.g. Wiki templates).

Addresses FS#21600 and FS#28839.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
This commit is contained in:
Lukas Fleischer 2012-03-22 09:38:18 +01:00
parent 132856a938
commit cf2f667512
3 changed files with 22 additions and 2 deletions

View file

@ -36,7 +36,7 @@ while (list($indx, $carr) = each($comments)) { ?>
</div>
<?php
$count = package_comments_count($_GET['ID']);
$count = package_comments_count(isset($_GET['ID']) ? $_GET['ID'] : pkgid_from_name($_GET['N']));
if ($count > 10 && !isset($_GET['comments'])) {
echo '<div class="pgbox">';
echo '<a href="'. $_SERVER['REQUEST_URI'] . '&comments=all">'. __('Show all %s comments', $count) . '</a>';