TODO: fix bloodsucking path system
[mirrors/Kyberia-bloodline.git] / wwwroot / inc / nodes.inc
index 93905746e8b72f192b75c78eab953ed19b18ceb3..e32825070db61645443062bb4916ab627d71961b 100644 (file)
@@ -13,9 +13,9 @@
      }
    }
 
-class nodes {
-
+require_once(INCLUDE_DIR.'base36.inc');
 
+class nodes {
 
 function addNode($params) {
         global $db,$node,$error,$error_messages;
@@ -28,7 +28,7 @@ function addNode($params) {
         $parent_permissions=permissions::checkPermissions($parent_id);
         if (!$parent_permissions['w']) {
                 $error=$error_messages['WRITE_PERMISSION_ERROR'];
-                log::log('add','error','WRITE_PERMISSION_ERROR');
+                logger::log('add','error','WRITE_PERMISSION_ERROR');
                 return false;
         }
 
@@ -100,7 +100,7 @@ node_vector='".$params['node_vector']."'";
         --$user_k;
         $db->query("update users set user_k='$user_k' where user_id='$params[node_creator]'");
         $db->query("commit");
-        log::log('add','ok',$id);
+        logger::log('add','ok',$id);
 
         if ($_POST['code']) {
                 $params['node_creator']=UBIK_ID;
@@ -117,7 +117,7 @@ node_vector='".$params['node_vector']."'";
 
 function processContent($node_content) {
         global $node;
-        include_once(SYSTEM_ROOT.'/inc/htmlparse.inc');
+        include_once(INCLUDE_DIR.'htmlparse.inc');
 
         if ($node['template_id']==$node['node_id'] && $_POST['event']=='configure_content') {
 
@@ -132,7 +132,7 @@ function processContent($node_content) {
                 require_once 'Text/Wiki.php';
 
                 // instantiate a Text_Wiki object with the default rule set
-                $wiki =& new Text_Wiki();
+                $wiki = new Text_Wiki();
 
                 $node_content = $wiki->transform($node_content, 'Xhtml');
         }
@@ -142,13 +142,13 @@ function processContent($node_content) {
         else {
                 global $db,$htmlparse,$error;
 
-                if (!htmlparse::htmlparse($node_content)) {
+                if (!htmlparser::htmlparse($node_content)) {
                         $error=$htmlparse;
                         return false;
                 }
 
                 $node_content = eregi_Replace("((( )|(\n)|(^))+)(http://|ftp://|https://)([[:alnum:]][^,[:space:]]*)","\\2<a target='_blank' href=\"\\6\\7\">\\6\\7</a>",$node_content);
-               $node_content = mysql_real_escape_string($node_content);
+               //$node_content = mysql_real_escape_string($node_content); once is enough
         }
 
         return $node_content;
@@ -194,7 +194,7 @@ where $table_name.node_id='$node_handle'";
                         return false;
                 }
                 else {
-                        $node=$result->getRecord();
+                        $node=addBase36id($result->getRecord());
                         $node['node_vector']=trim($node['node_vector'],"z");
                         $ancestors=str_split($node['node_vector'],VECTOR_CHARS);
                         foreach ($ancestors as $ancestor) {
@@ -233,7 +233,7 @@ where $table_name.node_id='$node_handle'";
                 $result=$db->query($q);
 
                 while ($result->next()){
-                        $record[]=$result->getRecord();
+                        $record[]=addBase36id($result->getRecord());
                 }
                 return $record;
 
@@ -252,7 +252,7 @@ node_parent='$node_handle' order by node_created $orderby LIMIT $offset,$limit";
                 $result=$db->query($q);
 
                 while ($result->next()) {
-                        $array[]=$result->getRecord();
+                        $array[]=addBase36id($result->getRecord());
                 }
 
                 return $array;
@@ -269,7 +269,7 @@ node_parent='$node_handle' order by node_created $orderby LIMIT $offset,$limit";
                 $result=$db->query($q);
 
                 while ($result->next()) {
-                        $children_array[]=$result->getRecord();
+                        $children_array[]=addBase36id($result->getRecord());
                 }
 
                 return $children_array;
This page took 0.198566 seconds and 4 git commands to generate.