From ed17d0f69e3f8f88ed8f23ad12543022636fd87a Mon Sep 17 00:00:00 2001 From: simo Date: Fri, 6 May 2005 03:58:26 +0000 Subject: Added vote button to detail page (bug#2638) X's only show up if user can delete comment --- web/lib/pkgfuncs.inc | 27 ++++++++++++++++++++++----- 1 file changed, 22 insertions(+), 5 deletions(-) (limited to 'web/lib/pkgfuncs.inc') diff --git a/web/lib/pkgfuncs.inc b/web/lib/pkgfuncs.inc index dd168da..b0e570f 100644 --- a/web/lib/pkgfuncs.inc +++ b/web/lib/pkgfuncs.inc @@ -246,7 +246,7 @@ function pkgvotes_from_sid($sid="") { # display package details # -function package_details($id=0) { +function package_details($id=0, $SID="") { global $_REQUEST; global $pkgsearch_vars; $q = "SELECT Packages.*,Location,Category "; @@ -392,10 +392,12 @@ function package_details($id=0) { print " "; print ""; print ""; + if ($SID) { + print "\n"; + } print "\n"; print "
"; - $durl = ""; + if (canDeleteComment($carr["ID"], account_from_sid($SID), $SID)) { + $durl = ""; + } print $durl . "  "; print __("Comment by: %h%s%h on %h%s%h", array("",$carr["UserName"],"", @@ -423,6 +425,21 @@ function package_details($id=0) { print __("Add Comment")."\">"; print "\n"; print "
\n"; + print "\n"; + print "\n"; + $q = "SELECT * FROM PackageVotes WHERE UsersID = ".uid_from_sid($SID); + $q.= " AND PackageID = ".$row["ID"]; + if (!mysql_num_rows(db_query($q, $dbh))) { + print ""; + } else { + print ""; + } + print "
\n"; -- cgit v1.2.3-70-g09d2