X-Git-Url: http://git.harvie.cz/?a=blobdiff_plain;f=wwwroot%2Finc%2Fsmarty%2Fnode_methodz%2Ffunction.get_k_neurons.php;h=3711415b4eb348a5273d961fa43ed1571ec637cc;hb=79a1334bcab6596cf6695b1949dbb04c10c1cdf7;hp=b43bf952c7983079215d892f1e697be1ee7ccc8c;hpb=fba1bac4c86998039580413bc2dab4eeadfc15a7;p=mirrors%2FKyberia-bloodline.git diff --git a/wwwroot/inc/smarty/node_methodz/function.get_k_neurons.php b/wwwroot/inc/smarty/node_methodz/function.get_k_neurons.php index b43bf95..3711415 100644 --- a/wwwroot/inc/smarty/node_methodz/function.get_k_neurons.php +++ b/wwwroot/inc/smarty/node_methodz/function.get_k_neurons.php @@ -1,34 +1,27 @@ now()-interval $interval day - 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"; - - $set=$db->query($q); - while ($set->next()) { - $k_array[]=$set->getRecord(); - } - - $smarty->assign('get_k',$k_array); - - - - } +function smarty_function_get_k_neurons($params,&$smarty) { + + global $db,$node; + if (isset($params['offset']) && (is_numeric($params['offset']))) { + $offset=$params['offset']; + } else {$offset=20;} + if (isset($params['listing_amount']) && (is_numeric($params['listing_amount']))) { + $listing_amount=$params['listing_amount']; + } else {$listing_amount=DEFAULT_LISTING_AMOUNT;} + if (isset($_POST['interval']) && (is_numeric($_POST['interval']))) { + $interval= $_POST['interval']; + } else {$interval = 1;} + if (isset($params['vector']) && ($params['vector'])) { + $vector=$params['vector']; + $interval=365; + } else {$vector="00";} + + + // XXX other parameters + $k_array=nodes::getKNeurons($_SESSION['user_id'],$offset); + + + $smarty->assign('get_k_neurons',$k_array); +} ?>