-
Notifications
You must be signed in to change notification settings - Fork 1
/
results.php
39 lines (28 loc) · 998 Bytes
/
results.php
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
<?php
require_once("Sprinkles.php");
$sprink = new Sprinkles();
$page_num = request_param('page');
if (!$page_num) { $page_num = 0; }
$topic_filters = array("limit" => $discuss_page_size, "page" => $page_num);
$filter_style = request_param('style');
if ($filter_style) {
$topic_filters['style'] = $filter_style;
$smarty->assign('style', $filter_style);
}
$filter_query = request_param('query');
if ($filter_query) {
$topic_filters['query'] = $filter_query;
$smarty->assign('query', $filter_query);
}
$topics = $sprink->topics($topic_filters);
$topic_count = $topics['totals']['this'];
// $sprink->resolve_authors($topics['topics']);
$smarty->assign('page_num', $page_num);
$smarty->assign('num_pages', ceil($topic_count/$discuss_page_size));
$smarty->assign('topics', $topics['topics']);
$smarty->assign('topic_count', $topic_count);
$smarty->assign('totals', $topics['totals']);
$sprink->add_std_hash_elems($smarty);
$smarty->display('results.t');
finish_request('results');
?>