From d4b07f2b334dada626e4743951cdd6adab87f62e Mon Sep 17 00:00:00 2001 From: Callan Barrett Date: Sat, 12 Jan 2008 18:18:43 +0900 Subject: Tweaks of various page layouts and handling of data This is a patch that fixes a lot of little things: * We no longer have pkgsearch or pkgdetails link functions and all references to them are gone, that's what a back button is for and if we really need it we can come up with something better * No longer have do_Details variable, this means links on the package search are simply ?ID=foo * On the pkgdetails pages when there are either no deps, deps by, sources or comments for a package the list for each will display "None" instead of nothing at all (ruining the layout) * Fixed a bug where if a package had no sources or no deps pkgsubmit.php would submit an empty one * Translation of the word "Search'" has been changed to "Search" Most of these relate to each other. Signed-off-by: Callan Barrett --- web/html/pkgsubmit.php | 28 ++++++++++++++++++---------- 1 file changed, 18 insertions(+), 10 deletions(-) (limited to 'web/html/pkgsubmit.php') diff --git a/web/html/pkgsubmit.php b/web/html/pkgsubmit.php index e3495918..638654bc 100644 --- a/web/html/pkgsubmit.php +++ b/web/html/pkgsubmit.php @@ -421,11 +421,15 @@ if ($_COOKIE["AURSID"]) { db_query($q, $dbh); } - $sources = explode(" ", $new_pkgbuild['source']); - while (list($k, $v) = each($sources)) { - $q = "INSERT INTO PackageSources (PackageID, Source) VALUES ("; - $q .= $pdata["ID"].", '".mysql_real_escape_string($v)."')"; - db_query($q, $dbh); + # Insert sources, if they don't exist don't inser them + # + if ($new_pkgbuild['source'] != "") { + $sources = explode(" ", $new_pkgbuild['source']); + while (list($k, $v) = each($sources)) { + $q = "INSERT INTO PackageSources (PackageID, Source) VALUES ("; + $q .= $pdata["ID"].", '".mysql_real_escape_string($v)."')"; + db_query($q, $dbh); + } } } else { # this is a brand new package @@ -483,11 +487,15 @@ if ($_COOKIE["AURSID"]) { db_query($q, $dbh); } - $sources = explode(" ", $new_pkgbuild['source']); - while (list($k, $v) = each($sources)) { - $q = "INSERT INTO PackageSources (PackageID, Source) VALUES ("; - $q .= $packageID.", '".mysql_real_escape_string($v)."')"; - db_query($q, $dbh); + # insert sources + # + if ($new_pkgbuild['source'] != "") { + $sources = explode(" ", $new_pkgbuild['source']); + while (list($k, $v) = each($sources)) { + $q = "INSERT INTO PackageSources (PackageID, Source) VALUES ("; + $q .= $packageID.", '".mysql_real_escape_string($v)."')"; + db_query($q, $dbh); + } } } } -- cgit v1.2.3-24-g4f1b