X-Git-Url: http://git.harvie.cz/?a=blobdiff_plain;f=inc%2Feventz%2Fset_bookmark_category.inc;h=159a0859ff08f528f8ffcf522fa24618d524c0b3;hb=673e23209e2e3b9782c037e70156a1a20154a5b9;hp=a1789146b5bcd3696bfdb9ce4d8b8e9060f05482;hpb=e586807dafc64c3fe152ab518599e6cf3f0f84e1;p=mirrors%2FKyberia-bloodline.git diff --git a/inc/eventz/set_bookmark_category.inc b/inc/eventz/set_bookmark_category.inc index a178914..159a085 100644 --- a/inc/eventz/set_bookmark_category.inc +++ b/inc/eventz/set_bookmark_category.inc @@ -1,14 +1,7 @@ query("start transaction"); - $set=$db->query("select bookmark_category from node_access where node_id='$chosen_id' and user_id='".$_SESSION['user_id']."'"); - $set->next(); - $old_category=$set->getString('old_category'); $q="update node_access set bookmark_category='$category_id' where node_id='$chosen_id' and user_id='".$_SESSION['user_id']."'"; $db->query($q); - $q="update neurons set central='$category_id' where peripheral='$chosen_id' and central='$old_category'"; - $db->update($q); - $db->query("commit"); + $q="update neurons set dst='$category_id' where src='$chosen_id' and synapse_creator='".$_SESSION['user_id']."' and link='bookmark'"; + $result=$db->update($q); + if (!$result) $db->query("insert into neurons set synapse_creator='".$_SESSION['user_id']."',src='$chosen_id',dst='$category_id',link='bookmark'"); +$db->query("update nodes set lastdescendant_created=NOW() where node_id='$category_id'"); +$db->query("commit"); } return true; } -?> \ No newline at end of file +?> + +