From 92ac14b2de96259830a9a35cfd4f2f1485006334 Mon Sep 17 00:00:00 2001 From: niekt0 Date: Fri, 30 Sep 2011 00:10:07 +0200 Subject: [PATCH] warnings fixup --- wwwroot/backend/mysql/backend.inc | 4 ++-- .../smarty/node_methodz/function.get_linked_nodes.php | 9 ++++++--- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/wwwroot/backend/mysql/backend.inc b/wwwroot/backend/mysql/backend.inc index 563caf6..d0861e1 100644 --- a/wwwroot/backend/mysql/backend.inc +++ b/wwwroot/backend/mysql/backend.inc @@ -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 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 9a846e4..7e19ef7 100644 --- a/wwwroot/inc/smarty/node_methodz/function.get_linked_nodes.php +++ b/wwwroot/inc/smarty/node_methodz/function.get_linked_nodes.php @@ -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']; -- 2.30.2