X-Git-Url: http://git.harvie.cz/?a=blobdiff_plain;f=wwwroot%2Fbackend%2Fmysql%2Fbackend.inc;h=b3b8770d93b86a80d90146d774ae777fe0fd0023;hb=4c113a6b8204cb0c446d0d7f1272f8995fd78378;hp=f8cd6a3fec998f83318162a8ee967ecc58dc1e51;hpb=57029afafb263ab5f16ced291748f9cca0860dd8;p=mirrors%2FKyberia-bloodline.git diff --git a/wwwroot/backend/mysql/backend.inc b/wwwroot/backend/mysql/backend.inc index f8cd6a3..b3b8770 100644 --- a/wwwroot/backend/mysql/backend.inc +++ b/wwwroot/backend/mysql/backend.inc @@ -307,18 +307,19 @@ node_parent='$node_handle' order by node_created $orderby LIMIT $offset,$limit"; // Simple internal function to set node parrent -function setParent($params) { +function setParent($node_id,$parent_id) { global $db,$node,$error,$error_messages; - $parent_id=$params['node_parent']; - $node_id=$params['node_id']; if (!is_numeric($parent_id)) { return false; } - $q="select node_vector from nodes where node_id='$parent_id'"; - $parent_vector=$db->query($q); - $new_vector=$parent_vector.str_pad($node_id,VECTOR_CHARS,"0",STR_PAD_LEFT); + $q="select node_vector from nodes where node_id='$parent_id'"; + $set=$db->query($q); + $set->next(); + $parent_vector=$set->getString('node_vector'); + $new_vector=$parent_vector.str_pad($node_id,VECTOR_CHARS,"0",STR_PAD_LEFT); + $q="update nodes set node_parent='$parent_id',node_vector='".$new_vector." ' where node_id='$node_id'"; $db->query($q);