diff options
author | Loui Chang <louipc.ist@gmail.com> | 2009-01-25 19:17:54 +0100 |
---|---|---|
committer | Loui Chang <louipc.ist@gmail.com> | 2009-01-25 19:17:54 +0100 |
commit | 354c86b6c608c8923d0a087285f97d5d8121ed08 (patch) | |
tree | 2815243ed6596ca75a849e0191ef52712132d1ea /web/lib/pkgfuncs.inc | |
parent | f729eca80dbbce94ce02a5315794145fb8cd9bf7 (diff) | |
download | aur-354c86b6c608c8923d0a087285f97d5d8121ed08.tar.gz aur-354c86b6c608c8923d0a087285f97d5d8121ed08.tar.xz |
Move package comment form into a new template.
Feature the form on the package details page.
Signed-off-by: Loui Chang <louipc.ist@gmail.com>
Diffstat (limited to 'web/lib/pkgfuncs.inc')
-rw-r--r-- | web/lib/pkgfuncs.inc | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/web/lib/pkgfuncs.inc b/web/lib/pkgfuncs.inc index b6f32e6a..150f5527 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.")."<br />\n"; - } else { + if (!$results) { + print __("Error retrieving package details.") . "<br />\n"; + } + else { $row = mysql_fetch_assoc($results); if (empty($row)) { - print __("Package details could not be found.")."<br />\n"; + print __("Package details could not be found.") . "<br />\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'); } |