GIT.Harvie.CZ
/
mirrors
/
Kyberia-bloodline.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
96acf00
)
k_neurons another fix.
author
niekt0
<niekt0@kyberia.cz>
Tue, 15 Mar 2011 00:24:41 +0000
(
01:24
+0100)
committer
niekt0
<niekt0@kyberia.cz>
Tue, 15 Mar 2011 00:24:41 +0000
(
01:24
+0100)
wwwroot/backend/mysql/backend.inc
patch
|
blob
|
blame
|
history
wwwroot/backend/mysql/functions.sql
patch
|
blob
|
blame
|
history
wwwroot/inc/smarty/node_methodz/function.get_k_neurons.php
patch
|
blob
|
blame
|
history
diff --git
a/wwwroot/backend/mysql/backend.inc
b/wwwroot/backend/mysql/backend.inc
index ebc9337ffae0dd9c341f0fb4915b1744822d6d2a..55e633ffbc2fe4ac3f27a320c969b4197f578139 100644
(file)
--- a/
wwwroot/backend/mysql/backend.inc
+++ b/
wwwroot/backend/mysql/backend.inc
@@
-326,19
+326,19
@@
function setParent($node_id,$parent_id) {
return 0;
}
return 0;
}
-// XXX TODO
-//
+// Get nodes sorted by weight_k specific to user
function getKNeurons($user_id,$interval) {
global $db,$node,$error,$error_messages;
$q="call k_neurons('$user_id','$interval')";
$set=$db->query($q);
function getKNeurons($user_id,$interval) {
global $db,$node,$error,$error_messages;
$q="call k_neurons('$user_id','$interval')";
$set=$db->query($q);
-// $set->next();
- return $set;
-}
-
+ while ($set->next()) {
+ $k_array[]=$set->getRecord();
+ }
+ return $k_array;
}
}
+}
diff --git
a/wwwroot/backend/mysql/functions.sql
b/wwwroot/backend/mysql/functions.sql
index 14bb0f514ebcf1cde34490148d6533f64d332340..801dc83f2b11cc544ce046ffe3e7070babb7e56a 100644
(file)
--- a/
wwwroot/backend/mysql/functions.sql
+++ b/
wwwroot/backend/mysql/functions.sql
@@
-37,7
+37,7
@@
END//
create procedure k_neurons ( IN user_id INT, IN day_int INT)
BEGIN
if day_int = NULL or day_int = 0 then set day_int=20; end if;
create procedure k_neurons ( IN user_id INT, IN day_int INT)
BEGIN
if day_int = NULL or day_int = 0 then set day_int=20; end if;
- select *,(k_get_node_weigth(node_id,user_id)*k) as weight_k from nodes where k>0
+ select *,(k_get_node_weigth(node_id,user_id)*k) as weight_k
,'test1' as creator,'test2' as parent
from nodes where k>0
and node_created>now()-interval day_int day order by weight_k desc;
END//
and node_created>now()-interval day_int day order by weight_k desc;
END//
diff --git
a/wwwroot/inc/smarty/node_methodz/function.get_k_neurons.php
b/wwwroot/inc/smarty/node_methodz/function.get_k_neurons.php
index ba04b1ac4dbcce560ad387de1339eff76380d7ff..dc28c9c9ac3500595b33a5318257127442444d34 100644
(file)
--- a/
wwwroot/inc/smarty/node_methodz/function.get_k_neurons.php
+++ b/
wwwroot/inc/smarty/node_methodz/function.get_k_neurons.php
@@
-18,11
+18,9
@@
function smarty_function_get_k_neurons($params,&$smarty) {
} else {$vector="00";}
} else {$vector="00";}
- $set=nodes::getKNeurons($params['user_id'],20); // XXX offset
+ // XXX offset + id $params['user_id']
+ $k_array=nodes::getKNeurons(904,20);
- while ($set->next()) {
- $k_array[]=$set->getRecord();
- }
$smarty->assign('get_k_neurons',$k_array);
}
$smarty->assign('get_k_neurons',$k_array);
}
This page took
0.195068 seconds
and
4
git commands to generate.