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>
This commit is contained in:
Loui Chang 2009-01-25 13:17:54 -05:00
parent f729eca80d
commit 354c86b6c6
4 changed files with 78 additions and 80 deletions

View file

@ -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');
}