b43bf952c7983079215d892f1e697be1ee7ccc8c
[mirrors/Kyberia-bloodline.git] / wwwroot / inc / smarty / node_methodz / function.get_k_neurons.php
1 <?php
2 function smarty_function_get_k_neurons($params,&$smarty) {
3
4 global $db,$node;
5 if (is_numeric($params['offset'])) $offset=$params['offset'];
6 else $offset=0;
7 if (is_numeric($params['listing_amount'])) $listing_amount=$params['listing_amount'];
8 else $listing_amount=DEFAULT_LISTING_AMOUNT;
9 if (!is_numeric($_POST['interval'])) $interval=1;
10 else $interval = $_POST['interval'];
11 if ($params['vector']) {
12 $vector=$params['vector'];
13 $interval=365;
14 }
15 else $vector="00";
16
17 // XXX backend
18
19 $q="select nodes.*,parent.node_name as parent_name,users.login as creator
20 from nodes left join nodes as parent on nodes.node_parent=parent.node_id
21 left join users on users.user_id=nodes.node_creator where nodes.node_created>now()-interval $interval day
22 and nodes.node_vector like '$vector%' and nodes.k>0 and nodes.node_system_access!='private' order by nodes.k desc limit $offset,$listing_amount";
23
24 $set=$db->query($q);
25 while ($set->next()) {
26 $k_array[]=$set->getRecord();
27 }
28
29 $smarty->assign('get_k',$k_array);
30
31
32
33 }
34 ?>
This page took 0.460637 seconds and 3 git commands to generate.