X-Git-Url: http://git.harvie.cz/?a=blobdiff_plain;f=wwwroot%2Finc%2Fsmarty%2Fnode_methodz%2Ffunction.get_linked_nodes.php;h=7e19ef770af98bb1003bb8235029450b46e9af61;hb=070706bd9485aeb39b8dc054ec2e116b09b8279a;hp=351679aceffaaf5b080979fb3430bc194c260203;hpb=51ff32267c4949bad6a8dddc502cbc01ed56edc8;p=mirrors%2FKyberia-bloodline.git diff --git a/wwwroot/inc/smarty/node_methodz/function.get_linked_nodes.php b/wwwroot/inc/smarty/node_methodz/function.get_linked_nodes.php index 351679a..7e19ef7 100644 --- a/wwwroot/inc/smarty/node_methodz/function.get_linked_nodes.php +++ b/wwwroot/inc/smarty/node_methodz/function.get_linked_nodes.php @@ -1,47 +1,34 @@ query($q); - while ($result->next()) { - $array=$result->getRecord(); - $array['node_status']="linked"; - $array['node_created']=$array['synapse_created']; - $get_linked_nodes[]=$array; - } - $smarty->assign('get_linked_nodes',$get_linked_nodes); - +function smarty_function_get_linked_nodes($params,&$smarty) { + global $error, $node; + + if (empty($params['listing_amount'])) { + $listing_amount=DEFAULT_LISTING_AMOUNT; + } else { + if ($params['listing_amount']=='all') $listing_amount=DEF_MAX_LISTING_AMMOUNT; + elseif (is_numeric($params['listing_amount'])) $listing_amount=$params['listing_amount']; + } + + if (isset($params['offset']) && is_numeric($params['offset'])) $offset=$params['offset']; + elseif (isset($_POST['offset']) && is_numeric($_POST['offset'])) $offset=$_POST['offset']; + else $offset=0; + + if (isset($params['node_id'])) { + $node_id=$params['node_id']; + } else { + $node_id=$node['node_id']; + } + + if ($params['orderby']='synapse') { + $orderby='synapse_created'; + } else { + $orderby='node_id'; + } + + $get_linked_nodes=nodes::getLinkedNodes($node_id,$orderby,$offset,$listing_amount); + $smarty->assign('get_linked_nodes',$get_linked_nodes); } ?>