From 354c86b6c608c8923d0a087285f97d5d8121ed08 Mon Sep 17 00:00:00 2001 From: Loui Chang Date: Sun, 25 Jan 2009 13:17:54 -0500 Subject: Move package comment form into a new template. Feature the form on the package details page. Signed-off-by: Loui Chang --- web/lib/pkgfuncs.inc | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'web/lib') diff --git a/web/lib/pkgfuncs.inc b/web/lib/pkgfuncs.inc index b6f32e6..150f552 100644 --- a/web/lib/pkgfuncs.inc +++ b/web/lib/pkgfuncs.inc @@ -180,7 +180,7 @@ function package_comments($pkgid=0) { $q.= " AND DelUsersID = 0"; # only display non-deleted comments $q.= " ORDER BY CommentTS DESC"; $result = db_query($q, $dbh); - if (!$result) {return array();} + if (!$result) {print 'poop';return array();} while ($row = mysql_fetch_assoc($result)) { $comments[] = $row; } @@ -272,20 +272,22 @@ function package_details($id=0, $SID="") { global $pkgsearch_vars; $atype = account_from_sid($SID); $uid = uid_from_sid($SID); + $q = "SELECT Packages.*,Location,Category "; $q.= "FROM Packages,PackageLocations,PackageCategories "; $q.= "WHERE Packages.LocationID = PackageLocations.ID "; $q.= "AND Packages.CategoryID = PackageCategories.ID "; - $q.= "AND Packages.ID = ".intval($_REQUEST["ID"]); + $q.= "AND Packages.ID = " . intval($_REQUEST['ID']); $dbh = db_connect(); $results = db_query($q, $dbh); - if (!$results) { - print __("Error retrieving package details.")."
\n"; - } else { + if (!$results) { + print __("Error retrieving package details.") . "
\n"; + } + else { $row = mysql_fetch_assoc($results); if (empty($row)) { - print __("Package details could not be found.")."
\n"; + print __("Package details could not be found.") . "
\n"; } else { @@ -294,10 +296,11 @@ function package_details($id=0, $SID="") { # Actions Bar if ($SID) { include('actions_form.php'); + include('pkg_comment_form.php'); } # Print Comments - $comments = package_comments($row["ID"]); + $comments = package_comments($_REQUEST['ID']); if (!empty($comments)) { include('pkg_comments.php'); } -- cgit v1.2.3-70-g09d2