warnings fixup
authorniekt0 <niekt0@kyberia.cz>
Thu, 29 Sep 2011 22:10:07 +0000 (00:10 +0200)
committerniekt0 <niekt0@kyberia.cz>
Thu, 29 Sep 2011 22:10:07 +0000 (00:10 +0200)
wwwroot/backend/mysql/backend.inc
wwwroot/inc/smarty/node_methodz/function.get_linked_nodes.php

index 563caf63c9de6ced2b7ea313e1ed62793b4ec0c0..d0861e1bd0166329903ca001a0a05389feb0499d 100644 (file)
@@ -586,7 +586,7 @@ public static function getLinkedNodes($node_id,$orderby,$offset,$listing_amount)
        if ((!is_numeric($node_id))
                or (!is_numeric($offset))
                or (!is_numeric($listing_amount)))
-               { return -1; } // XXX check return value by caller?
+               { return false; } // XXX check return value by caller?
        $orderby=db_escape_string($orderby);
 
        $q="select neurons.synapse_created,node_content,author.login,linker.login as linker,nodes.* from neurons 
@@ -604,7 +604,7 @@ public static function getLinkedNodes($node_id,$orderby,$offset,$listing_amount)
                $array['node_created']=$array['synapse_created'];
                $get_linked_nodes[]=$array;
        }
-       return $get_linked_nodes;
+       return (isset($get_linked_nodes) ? $get_linked_nodes : false);
 }
 
 // getThreadedChildren
index 9a846e4022a0e5ec6c54c703cad521489eb1d231..7e19ef770af98bb1003bb8235029450b46e9af61 100644 (file)
@@ -4,9 +4,12 @@
 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 (isset($params['offset']) && is_numeric($params['offset'])) $offset=$params['offset'];
        elseif (isset($_POST['offset']) && is_numeric($_POST['offset'])) $offset=$_POST['offset'];
This page took 0.170208 seconds and 4 git commands to generate.