-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsearch.php
More file actions
49 lines (39 loc) · 900 Bytes
/
search.php
File metadata and controls
49 lines (39 loc) · 900 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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
<?php
/**
* search
*
* @package Sngine
* @author Zamblek
*/
// fetch bootstrap
require('bootstrap.php');
// user access
if(!$system['system_public']) {
user_access();
}
// page header
page_header($system['system_title'].' - '.__("Search"));
try {
// search
if(isset($_GET['query'])) {
/* get results */
$results = $user->search($_GET['query']);
/* assign variables */
$smarty->assign('query', $_GET['query']);
$smarty->assign('results', $results);
$smarty->assign('results_num', count($results));
}
// get ads
$ads = $user->ads('search');
/* assign variables */
$smarty->assign('ads', $ads);
// get widgets
$widgets = $user->widgets('search');
/* assign variables */
$smarty->assign('widgets', $widgets);
} catch (Exception $e) {
_error(__("Error"), $e->getMessage());
}
// page footer
page_footer("search");
?>