Hierarchy fixup
[mirrors/Kyberia-bloodline.git] / wwwroot / inc / eventz / unfriend.inc
diff --git a/wwwroot/inc/eventz/unfriend.inc b/wwwroot/inc/eventz/unfriend.inc
new file mode 100644 (file)
index 0000000..c2eeb26
--- /dev/null
@@ -0,0 +1,18 @@
+<?php
+function unfriend() {
+    global $db,$error,$node;
+    $node_id = $node['node_id'];
+    $user_id = $_SESSION['user_id'];
+    $friend = $node['node_parent'];
+
+    if ($user_id != $node['node_creator']) {
+        $error = "nejsi vlastnik tohto priatela";
+        return false;
+    }
+
+    $q = "update nodes set external_link='', node_parent=123456, node_vector='001234560$node_id' where node_id='$node_id' and external_link='session://friend'";
+    $db->query($q);
+
+    $_SESSION['friends']['$friend']=false;
+}
+?>
\ No newline at end of file
This page took 0.123117 seconds and 4 git commands to generate.