| 1 | <?php |
| 2 | |
| 3 | function smarty_function_get_k_neurons($params,&$smarty) { |
| 4 | |
| 5 | global $db,$node; |
| 6 | if (isset($params['offset']) && (is_numeric($params['offset']))) { |
| 7 | $offset=$params['offset']; |
| 8 | } else {$offset=0;} |
| 9 | if (isset($params['listing_amount']) && (is_numeric($params['listing_amount']))) { |
| 10 | $listing_amount=$params['listing_amount']; |
| 11 | } else {$listing_amount=DEFAULT_LISTING_AMOUNT;} |
| 12 | if (isset($_POST['interval']) && (is_numeric($_POST['interval']))) { |
| 13 | $interval= $_POST['interval']; |
| 14 | } else {$interval = 1;} |
| 15 | if (isset($params['vector']) && ($params['vector'])) { |
| 16 | $vector=$params['vector']; |
| 17 | $interval=365; |
| 18 | } else {$vector="00";} |
| 19 | |
| 20 | |
| 21 | $set=nodes::getKNeurons($params['user_id'],20); // XXX offset |
| 22 | |
| 23 | while ($set->next()) { |
| 24 | $k_array[]=$set->getRecord(); |
| 25 | } |
| 26 | |
| 27 | $smarty->assign('get_k_neurons',$k_array); |
| 28 | } |
| 29 | ?> |