removed some warnings
[mirrors/Kyberia-bloodline.git] / wwwroot / nodes.php
index 246a99e10d1e2fb3689fb042b184fe7ed31c8812..75b613b6737d0adec9b34d6b023442bbc9e4a40a 100644 (file)
@@ -35,7 +35,6 @@ $db = new CLASS_DATABASE();
 
 switch(true) {
        case preg_match('/id\/([0-9]+)(?:\/([a-zA-Z0-9]+)\/?)?/',$_SERVER['PATH_INFO'],$match):
-               //      print_r($match);
                $_GET['node_id']=$match[1];
                if (!empty($match[2])) {
                        $_GET['template_id']=$match[2];
@@ -52,7 +51,6 @@ switch(true) {
                break;
 
        case preg_match('/k\/([a-z0-9]{1,7})(?:\/([a-z0-9]+))?/',$_SERVER['PATH_INFO'],$match):
-               echo "picic";
                $_GET['node_id']=base_convert($match[1], 36, 10);
                if (!empty($match[2])) {
                        $_GET['template_id']=$match[2];
@@ -73,6 +71,8 @@ switch(true) {
                break;
 }
 
+
+
 if (!empty($_GET['template_id'])) {
        $template_id=$_GET['template_id'];
 } else {
@@ -156,6 +156,14 @@ if (!empty($_SESSION['debugging']) && $_SESSION['debugging']) {
 
 // DO NOT MESS WITH THIS !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
 //creating neural network
+if  (preg_match('/id\/(\d+)/',isset($_SERVER['HTTP_REFERER'])? $_SERVER['HTTP_REFERER'] : "",$match)) {
+       $referer_id=$match[1];
+} elseif (preg_match('/k\/([a-z0-9]{1,7})/',isset($_SERVER['HTTP_REFERER'])? $_SERVER['HTTP_REFERER'] : "",$match)) {
+       $referer_id=base_convert($match[1], 36, 10);
+} elseif (preg_match('/name\/(.*?)\/?$/',isset($_SERVER['HTTP_REFERER'])? $_SERVER['HTTP_REFERER'] : "",$match)) {
+       $referer_id  = nodes::getNodeIdByName($match[1]);
+}
+
 $db->update("update nodes set node_views=node_views+1 where node_id='".$node['node_id']."'");
 if (isset($referer_id) && is_numeric($referer_id)) {
        $q="update neurons set synapse=synapse+1 where dst='".$node['node_id']."' and src='$referer_id'";
This page took 0.109322 seconds and 4 git commands to generate.