Fixed few warnings appeared after turning E_STRICT on
authorHarvie <tomas@mudrunka.cz>
Mon, 16 May 2011 05:02:40 +0000 (07:02 +0200)
committerHarvie <tomas@mudrunka.cz>
Mon, 16 May 2011 05:31:50 +0000 (07:31 +0200)
wwwroot/backend/mysql/backend.inc
wwwroot/backend/mysql/permissions.inc
wwwroot/inc/eventz/display.inc
wwwroot/inc/permissions.inc
wwwroot/inc/smarty/node_methodz/function.merge_arrays.php
wwwroot/nodes.php

index 0dc22dcfe951d351c5c3610d4ad39258274dcfbf..c85a43fd44de2327e7d30424befed6ffc7cecf00 100644 (file)
@@ -3,10 +3,10 @@ class nodes {
 // All mysql code should go here
 // Split into multiple files if needed
 
-function processContent($node_content) { return processContent_hack($node_content); } //XXX TODO FIXME HACK
+public static function processContent($node_content) { return processContent_hack($node_content); } //XXX TODO FIXME HACK
 
 // Called for every node view. Updates node views, neurons, 
-function update_nodes($user_id,$node_id,$referer_id) {
+public static function update_nodes($user_id,$node_id,$referer_id) {
        global $node,$db,$error;
        $db->update("update nodes set node_views=node_views+1 where".
                     "node_id='".$node_id."'");
@@ -35,7 +35,7 @@ function update_nodes($user_id,$node_id,$referer_id) {
 }
 
 
-function putNode($what,$where,$checkpermissions=true) {
+public static function putNode($what,$where,$checkpermissions=true) {
        global $db,$error,$error_messages;
        $user_id = $_SESSION['user_id'];
        if (!$user_id) {
@@ -64,7 +64,7 @@ function putNode($what,$where,$checkpermissions=true) {
        $db->query("update nodes set lastdescendant_created=NOW(),node_children_count=node_children_count+1 where node_id='$where'");
 }
 
-function addNode($params) {
+public static function addNode($params) {
         global $db,$node,$error,$error_messages;
         $parent_id=$params['node_parent'];
 
@@ -165,7 +165,7 @@ node_vector='".$params['node_vector']."'";
 }
 
 
-function getUserByLogin($login) {
+public static function getUserByLogin($login) {
        global $error, $error_messages;
        $q2="select user_id from users where login='".$login."'";
        $userset=$db->query($q2);
@@ -178,7 +178,7 @@ function getUserByLogin($login) {
        }
 }
 
-static function getNodeIdByName($name, $external_link=false) {
+public static function getNodeIdByName($name, $external_link=false) {
        global $db;
 
        $qh = sprintf('select node_id from nodes where node_name = "%s"', db_escape_string($name));
@@ -190,7 +190,7 @@ static function getNodeIdByName($name, $external_link=false) {
        return $set->getString('node_id');
 }
 
-function getNodeById($node_handle,$user_id, $table_name="nodes") {
+public static function getNodeById($node_handle,$user_id, $table_name="nodes") {
        global $db, $error;
        $q="select length(concat($table_name.node_vector)) as
 vector_depth,$table_name.*,$table_name.node_creator as
@@ -219,7 +219,7 @@ where $table_name.node_id='$node_handle'";
 }
 
 
-function redirByName($node_handle) {
+public static function redirByName($node_handle) {
        global $db, $error;
        $user_id=$_SESSION['user_id'];
        $set=$db->query("select node_id from nodes where node_name='$node_handle' and node_creator='$user_id'");
@@ -239,7 +239,7 @@ function redirByName($node_handle) {
 
 }
 
-function getNodesByName($node_handle) {
+public static function getNodesByName($node_handle) {
        global $db, $error;
        $q="select nodes.* from nodes where node_name='$node_handle%'";
 
@@ -254,7 +254,7 @@ function getNodesByName($node_handle) {
 
 
 
-function getChildrenNodes($orderby="desc",$offset=0,$limit=DEFAULT_LISTING_AMOUNT) {
+public static function getChildrenNodes($orderby="desc",$offset=0,$limit=DEFAULT_LISTING_AMOUNT) {
        global $db, $error, $node;
        $node_handle=$node['node_id'];
 
@@ -273,7 +273,7 @@ node_parent='$node_handle' order by node_created $orderby LIMIT $offset,$limit";
 }
 
 
-function GetUserSubmissionsChildren($user_id,$limit=23,$offset=0,$orderby='') {
+public static function GetUserSubmissionsChildren($user_id,$limit=23,$offset=0,$orderby='') {
   global $db;
 
          $q="select users.*,nodes.* from nodes
@@ -290,7 +290,7 @@ node_creator='$user_id' order by node_created $orderby LIMIT $offset,$limit";
   return $array;
 }
 
-function getThreadedChildrenNodes($orderby="desc",$offset=0,$limit=DEFAULT_LISTING_AMOUNT) {
+public static function getThreadedChildrenNodes($orderby="desc",$offset=0,$limit=DEFAULT_LISTING_AMOUNT) {
        global $db, $error, $node;
        $node_handle=$node['node_id'];
 
@@ -308,7 +308,7 @@ function getThreadedChildrenNodes($orderby="desc",$offset=0,$limit=DEFAULT_LISTI
 
 
 
-function getNodeAccessData() {
+public static function getNodeAccessData() {
        global $node,$db;
        $q="select users.login,node_access.* from node_access left join users on users.user_id=node_access.user_id where node_id='".$node['node_id']."' and node_permission!=''";
        $result=$db->query($q);
@@ -324,7 +324,7 @@ function getNodeAccessData() {
 
 // Simple internal function to set node parrent
 
-function setParent($node_id,$parent_id) {
+public static function setParent($node_id,$parent_id) {
        global $db,$node,$error,$error_messages;
 
        if (!is_numeric($parent_id)) {
@@ -345,7 +345,7 @@ function setParent($node_id,$parent_id) {
 
 // Get nodes sorted by weight_k specific to user
 
-function getKNeurons($user_id,$interval) {
+public static function getKNeurons($user_id,$interval) {
        global $db,$node,$error,$error_messages;
 
        $q="call k_neurons('$user_id','$interval')";
@@ -365,7 +365,7 @@ function getKNeurons($user_id,$interval) {
 // Secure.
 // Returns true on sucess, otherwise false.
 
-function setSynapse($params){
+public static function setSynapse($params){
        global $db,$node,$error,$error_messages;
 
        // security check
@@ -410,7 +410,7 @@ function setSynapse($params){
 // Secure.
 // Returns synapse weight (from user to node)
 
-function getSynapseWeight($user_id,$node_id){
+public static function getSynapseWeight($user_id,$node_id){
        global $db;
 
        if (!is_numeric($user_id)) 
index fded0a937a5b24e6ffef3c7ad8fcc792ac0af127..f2db74a355cb3b096e6d2fc25879768b22fd3b95 100644 (file)
@@ -4,7 +4,7 @@ class permissions {
 
 //trillion lights to Hierarchy!
 //$node input parameter can be a numeric node_id of a node-to-be-checked or a hash containing node_id,node_vector
-function checkPerms($node) {
+public static function checkPerms($node) {
     // new permissions checking
     global $db;
        
@@ -139,4 +139,4 @@ function checkPerms($node) {
 
 }
 
-?>
\ No newline at end of file
+?>
index 1793463cab663bccc57d135c9497abd420807268..934e1915f6ee8f399cdd4b659bc49f2a0fe385d7 100644 (file)
@@ -3,6 +3,7 @@ function display() {
        global $node,$db,$error,$referer_id,$smarty,$permissions,$template_id;
        global $timer_start;
        if (!$referer_id) $referer_id=1;
+       $content='';
 
        $node_id=$node['node_id'];
        $user_id=$_SESSION['user_id'];
@@ -265,7 +266,6 @@ if (!empty($_POST['template_event'])) {
        $_POST['offset']=$offset; // XXX sqli?
        $smarty->assign('offset',$offset);
 
-
 if ($node['external_link']=='header://svg' && !is_numeric($template_id)) {
        header("Content-Type: image/svg+xml");
 }
index e6c2eb95ce7322c4b33d88a5589811dd3f5b1cbf..1d77e420d56d57476f0ea0857df2ea07964c4d02 100644 (file)
@@ -32,7 +32,7 @@ function isHierarch($node) {
 
 }
 
-function checkPermissions($node) {
+public static function checkPermissions($node) {
 global $db;
 if (IsSet($_SESSION['user_id'])) {
        $user_id=$_SESSION['user_id'];
index e7320d2742fe0f4dab3c71e204243d97276ed326..d81b8f41bfff53c0dbfc65d69ef8969a7b1f7a8f 100644 (file)
@@ -4,6 +4,8 @@
 
                $array1=$params['array1'];
                $array2=$params['array2'];
+               if(!is_array($array1)) $array1=array();
+               if(!is_array($array2)) $array2=array();
                $sort_by=$params['sort_by'];
                $orderby=$params['orderby'];
                if ($orderby=='asc') $order=SORT_ASC;
index 5b9a9a3b2126639fa67a60b7b1bfa4781bdf17cd..9bafe5163028aae308f084fc0605079600b02e7a 100644 (file)
@@ -95,6 +95,7 @@ if(isset($_SESSION['debugging']) && $_SESSION['debugging']) {
     echo '<b>SESSION VARIABLES::</b><br/>';
     print_r($_SESSION);
 } else {
+       $_SESSION['debugging']=false;
        set_error_handler('logger::error_handler');
 }
 
This page took 0.266642 seconds and 4 git commands to generate.