mirror of
https://gitlab.archlinux.org/archlinux/aurweb.git
synced 2025-02-03 10:43:03 +01:00
Fix the comment poop bug.
Signed-off-by: Loui Chang <louipc.ist@gmail.com>
This commit is contained in:
parent
a669db5c7a
commit
402c6d0933
2 changed files with 10 additions and 7 deletions
|
@ -62,12 +62,12 @@ if ($output):
|
||||||
<?php
|
<?php
|
||||||
endif;
|
endif;
|
||||||
|
|
||||||
if (isset($_GET["ID"])) {
|
if (isset($_GET['ID'])) {
|
||||||
include('pkg_search_form.php');
|
include('pkg_search_form.php');
|
||||||
if (!intval($_GET["ID"])) {
|
if (!$_GET['ID'] = intval($_GET['ID'])) {
|
||||||
print __("Error trying to retrieve package details.")."<br />\n";
|
print __("Error trying to retrieve package details.")."<br />\n";
|
||||||
} else {
|
} else {
|
||||||
package_details($_GET["ID"], $_COOKIE["AURSID"]);
|
package_details($_GET['ID'], $_COOKIE["AURSID"]);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
pkg_search_page($_COOKIE["AURSID"]);
|
pkg_search_page($_COOKIE["AURSID"]);
|
||||||
|
|
|
@ -180,7 +180,11 @@ function package_comments($pkgid=0) {
|
||||||
$q.= " AND DelUsersID = 0"; # only display non-deleted comments
|
$q.= " AND DelUsersID = 0"; # only display non-deleted comments
|
||||||
$q.= " ORDER BY CommentTS DESC";
|
$q.= " ORDER BY CommentTS DESC";
|
||||||
$result = db_query($q, $dbh);
|
$result = db_query($q, $dbh);
|
||||||
if (!$result) {print 'poop';return array();}
|
|
||||||
|
if (!$result) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
while ($row = mysql_fetch_assoc($result)) {
|
while ($row = mysql_fetch_assoc($result)) {
|
||||||
$comments[] = $row;
|
$comments[] = $row;
|
||||||
}
|
}
|
||||||
|
@ -268,7 +272,6 @@ function pkgname_from_id($id="") {
|
||||||
# display package details
|
# display package details
|
||||||
#
|
#
|
||||||
function package_details($id=0, $SID="") {
|
function package_details($id=0, $SID="") {
|
||||||
global $_REQUEST;
|
|
||||||
global $pkgsearch_vars;
|
global $pkgsearch_vars;
|
||||||
$atype = account_from_sid($SID);
|
$atype = account_from_sid($SID);
|
||||||
$uid = uid_from_sid($SID);
|
$uid = uid_from_sid($SID);
|
||||||
|
@ -277,7 +280,7 @@ function package_details($id=0, $SID="") {
|
||||||
$q.= "FROM Packages,PackageLocations,PackageCategories ";
|
$q.= "FROM Packages,PackageLocations,PackageCategories ";
|
||||||
$q.= "WHERE Packages.LocationID = PackageLocations.ID ";
|
$q.= "WHERE Packages.LocationID = PackageLocations.ID ";
|
||||||
$q.= "AND Packages.CategoryID = PackageCategories.ID ";
|
$q.= "AND Packages.CategoryID = PackageCategories.ID ";
|
||||||
$q.= "AND Packages.ID = " . intval($_REQUEST['ID']);
|
$q.= "AND Packages.ID = " . intval($id);
|
||||||
$dbh = db_connect();
|
$dbh = db_connect();
|
||||||
$results = db_query($q, $dbh);
|
$results = db_query($q, $dbh);
|
||||||
|
|
||||||
|
@ -300,7 +303,7 @@ function package_details($id=0, $SID="") {
|
||||||
}
|
}
|
||||||
|
|
||||||
# Print Comments
|
# Print Comments
|
||||||
$comments = package_comments($_REQUEST['ID']);
|
$comments = package_comments($id);
|
||||||
if (!empty($comments)) {
|
if (!empty($comments)) {
|
||||||
include('pkg_comments.php');
|
include('pkg_comments.php');
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue