Added transport event - not working yet... :(
authorHarvie <tomas@mudrunka.cz>
Fri, 24 Dec 2010 01:42:34 +0000 (02:42 +0100)
committerHarvie <tomas@mudrunka.cz>
Fri, 24 Dec 2010 01:42:34 +0000 (02:42 +0100)
wwwroot/inc/eventz/transport.inc [new file with mode: 0644]
wwwroot/inc/smarty/node_methodz/function.get_threaded_children.php

diff --git a/wwwroot/inc/eventz/transport.inc b/wwwroot/inc/eventz/transport.inc
new file mode 100644 (file)
index 0000000..79f4218
--- /dev/null
@@ -0,0 +1,41 @@
+<?php
+//Zatim jen test, je tu hromada SQLi, etc...
+//Problem je v tom, ze kybca jentak nezobrazi hardlink pokud prislusna noda neexistuje lokalne...
+
+die('Transport not ready yet! :-(');
+function transport() {
+/*php > print_r(preg_split('/[:@]/','kyberia.sk:23456@lol'));
+Array
+(
+    [0] => kyberia.sk
+    [1] => 23456
+    [2] => domena.tld
+)
+*/
+
+$nodeshell_id=$_POST['nodeshell_id'];
+
+$transport = preg_split('/[:@]/',$nodeshell_id);
+$nodeshell_id=$chosen;
+$chosen=$transport[1];
+if(isset($transport[2])) $domain=$transport[2];
+$transport=$transport[0];
+
+       global $error_messages,$db,$node,$error;
+       $user_id = $_SESSION['user_id'];
+
+       $nodeshell = nodes::getNodeById($nodeshell_id,UBIK_ID);
+       //$nodeshell_permissions = permissions::checkPermissions($nodeshell);
+       $nodeshell_vector = $nodeshell['node_vector'];
+
+               $dst_vector = $nodeshell_vector.str_pad($chosen,VECTOR_CHARS,0,STR_PAD_LEFT);
+               $q = "update neurons set synapse_created=NOW(),link='hard',synapse=synapse+1,
+dst_vector='$dst_vector' where src='$chosen' and dst='$nodeshell_id'";
+               $result=$db->update($q);
+
+               if (!$result) $db->query("insert into neurons set synapse_creator='$user_id',synapse_created=NOW(),
+src='$chosen',dst='$nodeshell_id',dst_vector='$dst_vector',link='hard',synapse=1,transport='$transport'");
+
+               $db->query("update nodes set lastdescendant_created=NOW() where node_id='$nodeshell_id'");
+}
+?>
index 7f18e893b816bec134dcc3df3961d3f0d231e0df..c1b2f31688356f4cba14f37894d12d30cd0338c9 100644 (file)
@@ -69,7 +69,8 @@ if($child['synapse_creator']!='') {
                require_once(INCLUDE_DIR.'transports.inc');
                transport_load($child['transport']);
                global $transports;
-               $child['node_content']=$child['node_id'].'@'.$child['transport'].':<br />'.$transports[$child['transport']]['get_node_content']($child['node_id']);
+               $child['node_content']=$child['transport'].':'.$child['node_id'].'@default:\n<br />'.$transports[$child['transport']]['get_node_content']($child['node_id']);
+               $child['node_name']=$child['transport'].':'.$child['node_id'];
        }
 }
 
This page took 0.416591 seconds and 4 git commands to generate.