-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsearch.php
More file actions
27 lines (20 loc) · 792 Bytes
/
Copy pathsearch.php
File metadata and controls
27 lines (20 loc) · 792 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
<?php
// @search
$q = ucwords(warez::slug($_GET['q'], ' '));
if(empty($q)) header("Location: /");
$header['s'] = [
'title' => "Resultados para: {$q} - " . $basic->slogan
];
$sql->listSearch = $db->query("SELECT post.id as post_id, post.title, post.image, post.date_create, post.id_category, category.name as category_name, category.slug as category_slug, category.type as category_type FROM post INNER JOIN category ON category.id = post.id_category
WHERE MATCH(post.title, post.content)
AGAINST('{$q}' IN NATURAL LANGUAGE MODE WITH QUERY EXPANSION)
ORDER BY post.date_create DESC LIMIT 50");
$vars = [
'l' => [
'search' => $sql->listSearch,
],
'q' => $q
];
$fenom->display('header.tpl', $header);
$fenom->display('search.tpl', $vars);
$fenom->display('footer.tpl');