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>
Move package deletion to a separate page

Package actions now have a separate box on the package details page. Make
a package deletion link in that box.

Link leads to a new page (pkgdel.php) that can be used to confirm package
deletion. A separate page with confirmation is used to avoid CSRFs.

Signed-off-by: canyonknight <canyonknight@gmail.com>
Move package merging to a separate page

Package actions now have a separate box on the package details page. Add
a package merge link in that box.

Link leads to a new page (pkgmerge.php) that can be used to confirm package
merging. A separate page with confirmation is used to avoid CSRFs.

Signed-off-by: canyonknight <canyonknight@gmail.com>
Deprecate actions bar when virtual URLs are used

The only buttons on the actions bar that were still used when virtual URLs
are enabled were the package deletion and package merging. These now reside
in separate pages, so remove the need for the actions bar when virtual URLs
are enabled.

Signed-off-by: canyonknight <canyonknight@gmail.com>