diff --git a/Source/src/DB.php b/Source/src/DB.php index 94db56b..16e867f 100644 --- a/Source/src/DB.php +++ b/Source/src/DB.php @@ -196,7 +196,7 @@ class DB * @param $array Array whit all (Post mensage) * @return mysqli_result ten codes */ - public function loadFilter($array) + public function loadFilter($array,$global_search) { $query = "SELECT IDC,Name,nick,Lang,Description,Code,Version FROM Users NATURAL JOIN Sources as S NATURAL JOIN Codes "; $where = "WHERE ("; @@ -211,8 +211,12 @@ class DB } } } + //var_dump($global_search); + if ($global_search){ + $where = "WHERE (TRUE"; + } - if (isset($array["o"])) + if (array_key_exists("o",$array)) $first = $array["o"] * 10; else $first = 0; diff --git a/Source/src/app.php b/Source/src/app.php index 1cc4dfa..eddb7d9 100644 --- a/Source/src/app.php +++ b/Source/src/app.php @@ -131,13 +131,14 @@ function sendHTTPError($code){ function firstPage($filter=false,$globalSearch=false){ global $supported,$twig,$path,$user; global $db; + //var_dump($_POST); if(!$filter and !$globalSearch) //Common index if(isset($_GET["p"])) //If page (not 0) $query = $db->loadLast($_GET["p"]); else $query = $db->loadLast(); else - $query = $db->loadFilter($_POST); + $query = $db->loadFilter($_POST,$globalSearch); $last = lastToArray($db,$query,$supported); $page = array( "title" => "CodeShare",