X-Git-Url: http://git.harvie.cz/?a=blobdiff_plain;ds=sidebyside;f=inc%2Fsmarty%2Fnode_methodz%2Ffunction.get_matrix_from_tree.php;fp=inc%2Fsmarty%2Fnode_methodz%2Ffunction.get_matrix_from_tree.php;h=01d01ae12a7ae0da8d93f826f2e876224f5a8e0d;hb=b42b2bf946332ad8544d53f610be9cb05e80bf56;hp=0000000000000000000000000000000000000000;hpb=e586807dafc64c3fe152ab518599e6cf3f0f84e1;p=mirrors%2FKyberia-bloodline.git diff --git a/inc/smarty/node_methodz/function.get_matrix_from_tree.php b/inc/smarty/node_methodz/function.get_matrix_from_tree.php new file mode 100644 index 0000000..01d01ae --- /dev/null +++ b/inc/smarty/node_methodz/function.get_matrix_from_tree.php @@ -0,0 +1,39 @@ +query($q); + +$size = floor(sqrt($set->getNumRows())); + +$x=0; +$y=0; + +while ($set->next()) { + if ($x<$size) { + $x++; + } + else { + $y++; + $x=0; + } + + $matrix[$x][$y] = $set->getRecord(); + +} + +$smarty->assign('get_matrix_from_tree',$matrix); +} +?> \ No newline at end of file