From: Harvie Date: Tue, 28 Dec 2010 23:04:00 +0000 (+0100) Subject: Cleanup of delete event X-Git-Url: https://git.harvie.cz/?a=commitdiff_plain;h=14f5632c2d0bf7bad0d681caf26c74566241ba8c;p=mirrors%2FKyberia-bloodline.git Cleanup of delete event --- diff --git a/wwwroot/inc/eventz/delete.inc b/wwwroot/inc/eventz/delete.inc index d2e08ad..44ad5c3 100644 --- a/wwwroot/inc/eventz/delete.inc +++ b/wwwroot/inc/eventz/delete.inc @@ -1,92 +1,7 @@ query("select src from neurons where dst='$chosen_id' and link='hard'"); -$kset->next();$src=$kset->getString('src'); - - -// echo 'Debug:: Novy vektor putu'; -// echo $new_vector.$src; - - - -$chosen=nodes::getNodeById($chosen_id,$_SESSION['user_id']); - -if (($chosen['node_creator']!=$_SESSION['user_id']) and -($chosen['node_permission']!='master') and !permissions::isHierarch($chosen)) { -global $error_messages; -$error=$error_messages['EVENT_PERMISSION_ERROR']; -return false; -} - -$set=$db->query("select * from neurons where dst='$chosen_id' and link='hard'"); -if ($set->getNumRows()>0){ - -$q="update neurons set dst_vector='$new_vector.$src' where dst='$chosen_id' and link='hard'"; -$debug2=$db->update($q); -} - - -$db->query("start transaction"); -$q="update nodes set node_parent='$new_parent_id',node_vector='".$new_vector."' where -node_id='$chosen_id'"; -$debug1=$db->query($q); -$q="update nodes set -node_vector=replace(node_vector,'".$chosen['node_vector']."','$new_vector') where -node_vector like '".$chosen['node_vector']."%'"; -$changed=$db->update($q); -$q="update nodes set node_children_count=node_children_count+1 where node_id='$new_parent_id'"; -$db->update($q); -$db->query("commit"); - -// echo '
debug:: pocet putov v node::
'; -// -// $set=$db->query("select * from neurons where dst='$chosen_id' and link='hard'"); -// echo $set->getNumRows(); - -} -//echo "debug1::
"; -//echo $debug1;echo "
"; -//echo "changed::
"; -//echo $changed;echo "
"; -//echo "debug2::
"; -//echo $debug2;echo "
"; - - -return false; - - -} -?> \ No newline at end of file