From 341e4e5fa750420c06c319dab36581ecc5dc9381 Mon Sep 17 00:00:00 2001 From: jchu Date: Wed, 15 Dec 2004 03:24:28 +0000 Subject: fixed up a bunch of dummy package things and added a message saying teh upload was successful --- 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 b7232095..df1da05e 100644 --- a/web/lib/pkgfuncs.inc +++ b/web/lib/pkgfuncs.inc @@ -103,7 +103,7 @@ function package_dependencies($pkgid=0) { $deps = array(); if ($pkgid) { $dbh = db_connect(); - $q = "SELECT DepPkgID, Name FROM PackageDepends, Packages "; + $q = "SELECT DepPkgID, Name, DummyPkg FROM PackageDepends, Packages "; $q.= "WHERE PackageDepends.DepPkgID = Packages.ID "; $q.= "AND PackageDepends.PackageID = ".mysql_escape_string($pkgid); $q.= " ORDER BY Name"; @@ -131,9 +131,9 @@ function create_dummy($pname="", $sid="") { # Insert the dummy # $q = "INSERT INTO Packages (Name, Description, URL, SubmittedTS, "; - $q.= "SubmitterUID) VALUES ('"; + $q.= "SubmitterUID, DummyPkg) VALUES ('"; $q.= mysql_escape_string($pname)."', 'A dummy package', '/#', "; - $q.= "UNIX_TIMESTAMP(), ".$uid.")"; + $q.= "UNIX_TIMESTAMP(), ".$uid.", 1)"; $result = db_query($q, $dbh); if (!$result) { return NULL; @@ -197,7 +197,7 @@ function package_details($id=0) { $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) { @@ -262,7 +262,7 @@ function package_details($id=0) { print ""; print "Dependencies\n"; print ""; - $deps = package_dependencies($row["ID"]); # $deps[0] = array('id','name'); + $deps = package_dependencies($row["ID"]); # $deps[0] = array('id','name', 'dummy'); while (list($k, $darr) = each($deps)) { $url = "".$darr[1]."
\n"; + if ($darr[2] == 0) print $url."'>".$darr[1]."
\n"; + else print "".$darr[1]."
\n"; } print "\n"; print ""; @@ -466,7 +467,9 @@ function pkg_search_page($SID="") { # $q.= "FROM Packages LEFT JOIN PackageVotes "; # $q.= "ON Packages.ID = PackageVotes.PackageID "; $q = "SELECT * FROM Packages "; - $has_where = 0; + $q.= "WHERE DummyPkg != 1 "; + $has_where = 1; + if (intval($_REQUEST["L"])) { $q.= "WHERE LocationID = ".intval($_REQUEST["L"])." "; $has_where = 1; -- cgit v1.2.3-24-g4f1b