mirror of
https://gitlab.com/CodeSolutionsProject/CodeShare.git
synced 2026-02-14 17:11:34 +01:00
repair search
This commit is contained in:
@@ -196,7 +196,7 @@ class DB
|
|||||||
* @param $array Array whit all (Post mensage)
|
* @param $array Array whit all (Post mensage)
|
||||||
* @return mysqli_result ten codes
|
* @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 ";
|
$query = "SELECT IDC,Name,nick,Lang,Description,Code,Version FROM Users NATURAL JOIN Sources as S NATURAL JOIN Codes ";
|
||||||
$where = "WHERE (";
|
$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;
|
$first = $array["o"] * 10;
|
||||||
else
|
else
|
||||||
$first = 0;
|
$first = 0;
|
||||||
|
|||||||
@@ -131,13 +131,14 @@ function sendHTTPError($code){
|
|||||||
function firstPage($filter=false,$globalSearch=false){
|
function firstPage($filter=false,$globalSearch=false){
|
||||||
global $supported,$twig,$path,$user;
|
global $supported,$twig,$path,$user;
|
||||||
global $db;
|
global $db;
|
||||||
|
//var_dump($_POST);
|
||||||
if(!$filter and !$globalSearch) //Common index
|
if(!$filter and !$globalSearch) //Common index
|
||||||
if(isset($_GET["p"])) //If page (not 0)
|
if(isset($_GET["p"])) //If page (not 0)
|
||||||
$query = $db->loadLast($_GET["p"]);
|
$query = $db->loadLast($_GET["p"]);
|
||||||
else
|
else
|
||||||
$query = $db->loadLast();
|
$query = $db->loadLast();
|
||||||
else
|
else
|
||||||
$query = $db->loadFilter($_POST);
|
$query = $db->loadFilter($_POST,$globalSearch);
|
||||||
$last = lastToArray($db,$query,$supported);
|
$last = lastToArray($db,$query,$supported);
|
||||||
$page = array(
|
$page = array(
|
||||||
"title" => "CodeShare",
|
"title" => "CodeShare",
|
||||||
|
|||||||
Reference in New Issue
Block a user