Transport cleanup
authorHarvie <tomas@mudrunka.cz>
Fri, 24 Dec 2010 02:32:43 +0000 (03:32 +0100)
committerHarvie <tomas@mudrunka.cz>
Fri, 24 Dec 2010 02:32:43 +0000 (03:32 +0100)
wwwroot/inc/smarty/node_methodz/function.get_threaded_children.php
wwwroot/inc/transports.inc
wwwroot/inc/transports/kyberia.sk.inc
wwwroot/nodes.php

index c39e537059097611f719cb2cb2b08ec2af75a85a..7a7cc3313b656e8487d84cc53c6193f75f6fda68 100644 (file)
@@ -65,12 +65,13 @@ else $security = "";
 $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']!='') {
index 6c595c354aec6007d386a9c7d2343c850fd06ebd..318096d2a75663d2aaf916043e77687801f3236a 100644 (file)
@@ -4,3 +4,18 @@ function transport_load($transport) {
        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;
+}
index 23e40d29868c7b3c283b25369faa91d8aaf5c3fa..16205724d9647c1d121a258bc6a6139e82a2e261 100644 (file)
@@ -3,6 +3,10 @@ $transport_name='kyberia.sk';
 
 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");
 };
index 54cfa79bb550db9411db67930fd9bc62e03e2b17..c6e8f57fc6f5211800f86c39d6e7414a985ca625 100644 (file)
@@ -88,11 +88,12 @@ if (isset($_SERVER['HTTP_REFERER'])) {
 }
 
 //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();
 
This page took 0.350584 seconds and 4 git commands to generate.