Added possibility to upload_data_file directly in add event (& to refer to node_id...
[mirrors/Kyberia-bloodline.git] / wwwroot / inc / smarty / node_methodz / function.get_linked_nodes.php
index ad44bacf7fd01d86378be157ee528f953f6dabcd..22fde3769b8495f4a80081201cbe9f0a1db1f193 100644 (file)
@@ -4,12 +4,15 @@
 function smarty_function_get_linked_nodes($params,&$smarty) {
        global $error, $node;
 
-        if ($params['listing_amount']=='all') $listing_amount=DEF_MAX_LISTING_AMMOUNT;
-        elseif (is_numeric($params['listing_amount'])) $listing_amount=$params['listing_amount'];
-        else $listing_amount=DEFAULT_LISTING_AMOUNT;
+       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 (is_numeric($params['offset'])) $offset=$params['offset'];
-       elseif (is_numeric($_POST['offset'])) $offset=$_POST['offset'];
+        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'])) {
@@ -25,7 +28,7 @@ function smarty_function_get_linked_nodes($params,&$smarty) {
        }
 
        $get_linked_nodes=nodes::getLinkedNodes($node_id,$orderby,$offset,$listing_amount);
-       $smarty->assign('get_linked_nodes',$get_linked_nodes);
+       if ($get_linked_nodes) $smarty->assign('get_linked_nodes',$get_linked_nodes);
 }
 
 ?>
This page took 0.103934 seconds and 4 git commands to generate.