mirror of
https://gitlab.com/CodeSolutionsProject/CodeShare.git
synced 2026-02-14 00:51:33 +01:00
repair search
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user