index.php: Fix undefined variable notice

Spotted when browsing the package details page while being logged out.

Reported-by: canyonknight <canyonknight@gmail.com>
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
pkgfuncs.inc.php: Add missing global keyword

Use the global keyword to import "$AUR_LOCATION" in
add_package_comment().

Regression introduced in d3de6679010a1d140794305e747f1af0e7f21834.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
Do not set GET parameters in the routing framework

Setting GET parameters manually is bad style and causes some strange
side effects when using virtual URLs and mkurl().

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
pkg_comments.php: Fix "Latest Comments" link

Avoid adding "?comments=all" more than once if the "Latest Comments"
link is clicked multiple times.

Reported-by: canyonknight <canyonknight@gmail.com>
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
pkg_details.php: Hide "Adopt" button from logged out users

Reported-by: canyonknight <canyonknight@gmail.com>
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
Fix package notification

One cannot check if the PDOStatement object returned by query()
evaluates to true in order to check for a non-empty record set. Modify
the SQL query to count the number of records instead of retrieving the
records themselves and fixing the check.

Regression introduced in e171f6f34eeacf35cf7142b4788d43e7d0978546.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
Fix language selection

Use "REQUEST_URI" instead of the "PHP_SELF" sever variable to determine
the redirection URL for the language selection form. This fixes the
language selection feature to work well with virtual URLs.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
Fix category selection

Add a package ID parameter to pkg_change_category() instead of relying
on the "ID" or "N" GET parameters.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
Wrap long lines in the "Recent Updates" sidebar

* Sync the sidebar layout with archweb, use the "pkg-name" class to wrap
  long package names.

* Move the "New!" logo to a separate column to make sure it isn't
  wrapped to a new line on its own.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
Sync search result statistics with archweb

* Use archweb classes for search result statistics.
* Add some space between page numbers.
* Display current page number instead of current item range.
* Hide page numbers if the result fits into a single page.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
Remove unused chmod_group() function

Signed-off-by: canyonknight <canyonknight@gmail.com>
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
Remove unused canManagePackage() function

Signed-off-by: canyonknight <canyonknight@gmail.com>
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
Remove unused pkgnotify_from_sid function

Signed-off-by: canyonknight <canyonknight@gmail.com>
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
rss.php: Update links to reflect URL changes

Signed-off-by: canyonknight <canyonknight@gmail.com>
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
UPGRADING: Fix database upgrade instructions

Oversight in commit 985795a21000ea92bcc9e817ddc3a17c380b1ed1.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
aur.inc.php: Document all functions using PHPDoc format

PHPDoc is a standardized format for commenting on PHP code.
Using it allows for a more cohesive use of IDEs and documentation
generators with the AUR code.

Signed-off-by: canyonknight <canyonknight@gmail.com>
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
acctfuncs.inc.php: Document all functions using PHPDoc format

Signed-off-by: canyonknight <canyonknight@gmail.com>
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
stats.inc.php: Document all functions using PHPDoc format

Signed-off-by: canyonknight <canyonknight@gmail.com>
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
Use echo shortcut syntax

Replace all occurrences of "<?php echo" and "<?php print" by "<?=" to
reduce noise in templates.

Note that as of PHP 5.4.0, "<?=" is always available and no longer
requires "short_open_tag" to be set.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
Avoid use of "<b>"/"</b>"

* Use "<label>"/"</label>" for form labels.
* Use "<strong>"/"</strong>" for important text.
* Use "<h4>"/"</h4>" for headings.
* Drop "<b>"/"</b>" everywhere else.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>