From 16f4fc226c914c01178ca1e58ece4b8389ea8bef Mon Sep 17 00:00:00 2001 From: Harvie Date: Fri, 24 Dec 2010 02:42:34 +0100 Subject: [PATCH] Added transport event - not working yet... :( --- wwwroot/inc/eventz/transport.inc | 41 +++++++++++++++++++ .../function.get_threaded_children.php | 3 +- 2 files changed, 43 insertions(+), 1 deletion(-) create mode 100644 wwwroot/inc/eventz/transport.inc diff --git a/wwwroot/inc/eventz/transport.inc b/wwwroot/inc/eventz/transport.inc new file mode 100644 index 0000000..79f4218 --- /dev/null +++ b/wwwroot/inc/eventz/transport.inc @@ -0,0 +1,41 @@ + 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'"); +} +?> diff --git a/wwwroot/inc/smarty/node_methodz/function.get_threaded_children.php b/wwwroot/inc/smarty/node_methodz/function.get_threaded_children.php index 7f18e89..c1b2f31 100644 --- a/wwwroot/inc/smarty/node_methodz/function.get_threaded_children.php +++ b/wwwroot/inc/smarty/node_methodz/function.get_threaded_children.php @@ -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'].':
'.$transports[$child['transport']]['get_node_content']($child['node_id']); + $child['node_content']=$child['transport'].':'.$child['node_id'].'@default:\n
'.$transports[$child['transport']]['get_node_content']($child['node_id']); + $child['node_name']=$child['transport'].':'.$child['node_id']; } } -- 2.30.2