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/html/pkgsubmit.php | 4 +++- web/lang/submit_po.inc | 5 +++++ web/lib/pkgfuncs.inc | 17 ++++++++++------- 3 files changed, 18 insertions(+), 8 deletions(-) (limited to 'web') diff --git a/web/html/pkgsubmit.php b/web/html/pkgsubmit.php index 7de7f20..a12ead8 100644 --- a/web/html/pkgsubmit.php +++ b/web/html/pkgsubmit.php @@ -488,7 +488,9 @@ if ($_COOKIE["AURSID"]) { print __("Sorry, uploads are not permitted by this server."); print "
\n"; } - } + } else { + print __("Package upload successful"); + } } else { # visitor is not logged in diff --git a/web/lang/submit_po.inc b/web/lang/submit_po.inc index fd1c02c..88acd50 100644 --- a/web/lang/submit_po.inc +++ b/web/lang/submit_po.inc @@ -196,4 +196,9 @@ $_t["en"]["You must supply a comment for this upload/change."] = "You must suppl # $_t["fr"]["You must supply a comment for this upload/change."] = "--> Traduction française ici. <--"; # $_t["de"]["You must supply a comment for this upload/change."] = "--> Deutsche Übersetzung hier. <--"; +$_t["en"]["Package upload successful"] = "Package upload successful"; +# $_t["es"]["Package upload successful"] = "--> Traducción española aquí. <--"; +# $_t["fr"]["Package upload successful"] = "--> Traduction française ici. <--"; +# $_t["de"]["Package upload successful"] = "--> Deutsche Übersetzung hier. <--"; + ?> \ No newline at end of file diff --git a/web/lib/pkgfuncs.inc b/web/lib/pkgfuncs.inc index b723209..df1da05 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-70-g09d2