set_synapse update
authorniekt0 <niekt0@kyberia.cz>
Sun, 27 Mar 2011 21:02:39 +0000 (23:02 +0200)
committerniekt0 <niekt0@kyberia.cz>
Sun, 27 Mar 2011 21:02:39 +0000 (23:02 +0200)
wwwroot/backend/mysql/backend.inc
wwwroot/inc/eventz/set_synapse_weight.inc

index ac554ed3691877192c2532a6175d4f2948c0c246..a92deeae52ef3106a845110a95ef22fe29c07961 100644 (file)
@@ -348,12 +348,15 @@ function getKNeurons($user_id,$interval) {
 
 // XXX TODO
 
-function setSynapse($src,$dst,$weight) {
+function setSynapse($params){
        global $db,$node,$error,$error_messages;
 
-       if ((!is_numeric($src)) or (!is_numeric($dst)) or (!is_numeric($weight))) {
+       if ((!is_numeric($params['src'])) or (!is_numeric($params['dst'])) or (!is_numeric($params['weight']))) {
                return false;
        }
+       $src=$params['src'];
+       $dst=$params['dst'];
+       $weight=$params['weight'];
 
        // if already exists
        $q="select src from neurons where dst ='$dst' and src = '$src'";
index 80dabe692f264fbca1d6f78f607d3f6e326643b1..32c37f5d88b1260123e33067e1af6e501c993ddc 100644 (file)
@@ -1,16 +1,16 @@
 <?php
 
 // Setting weight of the synapse.
-// Synapse is connection betwenn current node and logged user
+// Synapse is connection between current node and logged user
 
 function set_synapse_weight() {
 
        global $db,$error,$node,$permissions,$types;
 
        if (!empty($_POST['synapse_weight'])) {
-               $params['synapse_weight']=$_POST['synapse_weight'];
-               $params['from']=$_SESSION['user_id'];
-               $params['to']=$node['node_id'];
+               $params['weight']=$_POST['synapse_weight'];
+               $params['src']=$_SESSION['user_id'];
+               $params['dst']=$node['node_id'];
 
                nodes::setSynapse($params);
                return true;
This page took 0.187484 seconds and 4 git commands to generate.