log function fix
[mirrors/Kyberia-bloodline.git] / wwwroot / inc / smarty / node_methodz / function.get_search.php
CommitLineData
51ff3226 1<?php
2function smarty_function_get_search($params,&$smarty) {
51ff3226 3
51ff3226 4global $db, $node;
5if (is_numeric($params['offset'])) $offset = $params['offset'];
6else $offset = 0;
7
8if (is_numeric($params['listing_amount'])) $listing_amount = $params['listing_amount'];
9else $listing_amount = 32;
10$query = addslashes($params['query']);
11$q = "select users.login, nodes.* from nodes left join users on
12 users.user_id = nodes.node_creator where node_name like '$query%'";
13$set = $db->query($q);
14while ($set->next()) {
15 $array[] = $set->getRecord();
16}
17$smarty->assign('get_search_short',$array);
18
19if ($_POST['orderby'] != ("k" || "node_created" || "probability" ||
20"node_views")) $orderby = "k";
21else $orderby=$_POST['orderby'];
22
23$q = "select users.login as login, users.*, nodes.*, nodes.node_creator,
24 nodes.node_content, match (node_content.node_content) against ('$query') as
25 probability from node_content left join users on node_content.node_id = users.user_id
26 left join nodes on node_content.node_id = nodes.node_id where
27 node_system_access!='private' and match (node_content.node_content)
28 against ('$query') order by $orderby desc limit $offset,$listing_amount";
29
30$set = $db->query($q);
31while ($set->next()) {
32 $search[] = $set->getRecord();
33}
34
35$smarty->assign('get_search',$search);
36}
d4e006f9 37?>
This page took 0.118507 seconds and 4 git commands to generate.