$child = $result->getRecord();
if($child['external_link']=='transport') {
$child['node_status']='linked';
- $transport = preg_split('/[:@]/',trim($child['node_content']));
+ /*$transport = preg_split('/[:@]/',trim($child['node_content']));
require_once(INCLUDE_DIR.'transports.inc');
transport_load($transport[0]);
global $transports;
$child['node_name']=$transport[0].':'.$transport[1].'@defaulthost';
- $child['node_content']=$transport[0].':'.$transport[1].'@defaulthost:<br />'.$transports[$transport[0]]['get_node_content']($transport[1]);
+ $child['node_content']=$transport[0].':'.$transport[1].'@defaulthost:<br />'.$transports[$transport[0]]['get_node_content']($transport[1]);*/
+ $child = array_merge($child, transport_translate($child['node_content']));
}
if($child['synapse_creator']!='') {
require_once(TRANSPORT_DIR.$transport.'.inc');
}
+function transport_translate($transport_handle) {
+ $transport = preg_split('/[:@]/',trim($transport_handle));
+ transport_load($transport[0]);
+ global $transports;
+
+ $id=$transport[1];
+ $domain='defaulthost'; if(isset($transport[2])) $domain=$transport[2];
+ $transport=$transport[0];
+
+ $node['node_name']="$transport:$id@$domain";
+ $node['url']=$transports[$transport]['get_node_url']($id);
+ $node['node_content']=$node['url'].'<br />'.$transports[$transport]['get_node_content']($id);
+
+ return $node;
+}
global $transports;
+$transports[$transport_name]['get_node_url']=function($id, $protocol='http', $domain='kyberia.sk') {
+ return "$protocol://$domain/id/$id";
+};
+
$transports[$transport_name]['get_node_content']=function($id, $protocol='http', $domain='kyberia.sk', $content_template='2019721') {
return file_get_contents("$protocol://$domain/id/$id/$content_template");
};
}
//connecting to database and creating universal $db object
-require(INCLUDE_DIR.'log.inc');
-require(INCLUDE_DIR.'ubik.inc');
-require(INCLUDE_DIR.'nodes.inc');
-require(INCLUDE_DIR.'error_messages.inc');
-require(INCLUDE_DIR.'database.inc');
+require_once(INCLUDE_DIR.'log.inc');
+require_once(INCLUDE_DIR.'ubik.inc');
+require_once(INCLUDE_DIR.'nodes.inc');
+require_once(INCLUDE_DIR.'error_messages.inc');
+require_once(INCLUDE_DIR.'database.inc');
+require_once(INCLUDE_DIR.'transports.inc');
$db = new CLASS_DATABASE();