big commit
[mirrors/Kyberia-bloodline.git] / inc / smarty / node_methodz / function.get_matrix_from_tree.php
CommitLineData
b42b2bf9
H
1<?php
2function smarty_function_get_matrix_from_tree($params,&$smarty) {
3global $db , $node;
4
5if (!is_numeric($params['dimensions'])) return false;
6
7//in the very moment IM2tired4going meta-dimensional
8for ($i=0; $i<$params['dimensions']; $i++ ) {}
9
10$q="select node_content.node_content,nodes.*
11 from nodes left join node_content
12on nodes.node_id=node_content.node_id
13where node_vector like '".$node['node_vector']."%' and
14nodes.node_id!='".$node['node_id']."' and
15node_system_access !='private'
16order by rand() ";
17$set=$db->query($q);
18
19$size = floor(sqrt($set->getNumRows()));
20
21$x=0;
22$y=0;
23
24while ($set->next()) {
25 if ($x<$size) {
26 $x++;
27 }
28 else {
29 $y++;
30 $x=0;
31 }
32
33 $matrix[$x][$y] = $set->getRecord();
34
35}
36
37$smarty->assign('get_matrix_from_tree',$matrix);
38}
39?>
This page took 0.191567 seconds and 4 git commands to generate.