From 1dbf8bab6c0e5081b70f53202e29bf0a8fb93c48 Mon Sep 17 00:00:00 2001 From: steinm Date: Fri, 8 Apr 2011 16:09:50 +0000 Subject: [PATCH] - no more sql error if the whole result set is to be shown --- op/op.Search.php | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/op/op.Search.php b/op/op.Search.php index 09fcfc0a8..d2d41c755 100644 --- a/op/op.Search.php +++ b/op/op.Search.php @@ -177,13 +177,13 @@ $startdate = array(); $stopdate = array(); if (isset($_GET["creationdate"]) && $_GET["creationdate"]!=null) { $startdate = array('year'=>$_GET["createstartyear"], 'month'=>$_GET["createstartmonth"], 'day'=>$_GET["createstartday"]); - if (!checkdate($startdate['month'], $startdate['year'], $startdate['day'])) { + if (!checkdate($startdate['month'], $startdate['day'], $startdate['year'])) { UI::contentContainer(getMLText("invalid_create_date_start")); UI::htmlEndPage(); exit; } $stopdate = array('year'=>$_GET["createendyear"], 'month'=>$_GET["createendmonth"], 'day'=>$_GET["createendday"]); - if (!checkdate($stopdate['month'], $stopdate['year'], $stopdate['day'])) { + if (!checkdate($stopdate['month'], $stopdate['day'], $stopdate['year'])) { UI::contentContainer(getMLText("invalid_create_date_end")); UI::htmlEndPage(); exit; @@ -228,19 +228,20 @@ if(isset($_GET['categoryids']) && $_GET['categoryids']) { // // Default page to display is always one. $pageNumber=1; +$limit = 25; if (isset($_GET["pg"])) { if (is_numeric($_GET["pg"]) && $_GET["pg"]>0) { - $pageNumber = (integer)$_GET["pg"]; + $pageNumber = (int) $_GET["pg"]; } - else if (!strcasecmp($_GET["pg"], "all")) { - $pageNumber = "all"; + elseif (!strcasecmp($_GET["pg"], "all")) { + $limit = 0; } } // ------------------------------------- Suche starten -------------------------------------------- $startTime = getTime(); -$resArr = $dms->search($query, 25, ($pageNumber-1)*25, $mode, $searchin, $startFolder, $owner, $status, $startdate, $stopdate, $categories); +$resArr = $dms->search($query, $limit, ($pageNumber-1)*$limit, $mode, $searchin, $startFolder, $owner, $status, $startdate, $stopdate, $categories); $searchTime = getTime() - $startTime; $searchTime = round($searchTime, 2); // ---------------------------------- Ausgabe der Ergebnisse --------------------------------------