pkgfuncs.inc: Fix indentation.

Signed-off-by: Loui Chang <louipc.ist@gmail.com>
This commit is contained in:
Loui Chang 2009-03-03 12:11:49 -05:00
parent bbc05414cf
commit c949296a08

View file

@ -392,7 +392,8 @@ function pkg_search_page($SID="") {
$_GET['O'] = intval($_GET['O']); $_GET['O'] = intval($_GET['O']);
if ($_GET['O'] < 0) if ($_GET['O'] < 0)
$_GET['O'] = 0; $_GET['O'] = 0;
} else { }
else {
$_GET['O'] = 0; $_GET['O'] = 0;
} }
@ -402,7 +403,8 @@ function pkg_search_page($SID="") {
$_GET["PP"] = 25; $_GET["PP"] = 25;
else if ($_GET["PP"] > 100) else if ($_GET["PP"] > 100)
$_GET["PP"] = 100; $_GET["PP"] = 100;
} else { }
else {
$_GET["PP"] = 25; $_GET["PP"] = 25;
} }
@ -427,11 +429,12 @@ function pkg_search_page($SID="") {
FROM PackageCategories, PackageLocations, Packages FROM PackageCategories, PackageLocations, Packages
LEFT JOIN Users ON (Packages.MaintainerUID = Users.ID) "; LEFT JOIN Users ON (Packages.MaintainerUID = Users.ID) ";
if ($SID) { if ($SID) {
$q .= "LEFT JOIN PackageVotes $q .= "LEFT JOIN PackageVotes
ON (Packages.ID = PackageVotes.PackageID AND PackageVotes.UsersID = ".$myuid.") ON (Packages.ID = PackageVotes.PackageID AND PackageVotes.UsersID = $myuid)
LEFT JOIN CommentNotify LEFT JOIN CommentNotify
ON (Packages.ID = CommentNotify.PkgID AND CommentNotify.UserID = ".$myuid.") "; ON (Packages.ID = CommentNotify.PkgID AND CommentNotify.UserID = $myuid) ";
} }
$q .= "WHERE $q .= "WHERE
Packages.CategoryID = PackageCategories.ID Packages.CategoryID = PackageCategories.ID
@ -449,15 +452,17 @@ function pkg_search_page($SID="") {
if ($_GET['K']) { if ($_GET['K']) {
$_GET['K'] = mysql_real_escape_string(trim($_GET['K'])); $_GET['K'] = mysql_real_escape_string(trim($_GET['K']));
//search by maintainer # Search by maintainer
if ($_GET["SeB"] == "m"){ if ($_GET["SeB"] == "m") {
$q.= "AND Users.Username = '".$_GET['K']."' "; $q.= "AND Users.Username = '".$_GET['K']."' ";
} elseif ($_GET["SeB"] == "s") { }
elseif ($_GET["SeB"] == "s") {
// FIXME: this shouldn't be making 2 queries // FIXME: this shouldn't be making 2 queries
// kill the call to uid_from_username // kill the call to uid_from_username
$q.= "AND SubmitterUID = ".uid_from_username($_GET['K'])." "; $q.= "AND SubmitterUID = ".uid_from_username($_GET['K'])." ";
// the default behavior, query the name/description // the default behavior, query the name/description
} else { }
else {
$q.= "AND (Name LIKE '%".$_GET['K']."%' OR "; $q.= "AND (Name LIKE '%".$_GET['K']."%' OR ";
$q.= "Description LIKE '%".$_GET['K']."%') "; $q.= "Description LIKE '%".$_GET['K']."%') ";
} }
@ -508,7 +513,8 @@ function pkg_search_page($SID="") {
if ($_GET["SO"] == "d"){ if ($_GET["SO"] == "d"){
$SO_next="a"; $SO_next="a";
$_GET["SO"] = 'd'; $_GET["SO"] = 'd';
} else { }
else {
$SO_next="d"; $SO_next="d";
$_GET["SO"] = 'a'; $_GET["SO"] = 'a';
} }
@ -517,7 +523,7 @@ function pkg_search_page($SID="") {
// figure out the results to use // figure out the results to use
$first = $_GET['O'] + 1; $first = $_GET['O'] + 1;
if (($_GET['PP']+$_GET['O']) > $total) { if (($_GET['PP'] + $_GET['O']) > $total) {
$last = $total; $last = $total;
} else { } else {
$last = $_GET['PP'] + $_GET['O']; $last = $_GET['PP'] + $_GET['O'];