X-Git-Url: http://git.harvie.cz/?a=blobdiff_plain;ds=sidebyside;f=wwwroot%2Finc%2Fsmarty%2Fnode_methodz%2Ffunction.get_k_filtred_nodes.php;fp=wwwroot%2Finc%2Fsmarty%2Fnode_methodz%2Ffunction.get_k_filtred_nodes.php;h=d9fbc71185e84ed9d72fecccfbfca13c9f6da369;hb=51ff32267c4949bad6a8dddc502cbc01ed56edc8;hp=0000000000000000000000000000000000000000;hpb=dcee763368a1e3f380d07320a5254d91a09304e6;p=mirrors%2FKyberia-bloodline.git diff --git a/wwwroot/inc/smarty/node_methodz/function.get_k_filtred_nodes.php b/wwwroot/inc/smarty/node_methodz/function.get_k_filtred_nodes.php new file mode 100644 index 0000000..d9fbc71 --- /dev/null +++ b/wwwroot/inc/smarty/node_methodz/function.get_k_filtred_nodes.php @@ -0,0 +1,42 @@ +query($q); +while ($set->next()) { +$k_filtred_nodes_array[0][]=$set->getRecord(); +} + +// get k + +if (is_numeric($params['offset'])) $offset=$params['offset']; +else $offset=0; +if (is_numeric($params['listing_amount'])) $listing_amount=$params['listing_amount']; +else $listing_amount=DEFAULT_LISTING_AMOUNT; +if (!is_numeric($_POST['interval'])) $interval=1; +else $interval = $_POST['interval']; +if ($params['vector']) { +$vector=$params['vector']; +$interval=365; +} +else $vector="00"; + +$q="select node_content.node_content,nodes.*,parent.node_name as parent_name,users.login as creator +from nodes left join node_content on node_content.node_id=nodes.node_id left join nodes as parent on nodes.node_parent=parent.node_id +left join users on users.user_id=nodes.node_creator where nodes.node_created>now()-interval $interval day +and nodes.node_vector like '$vector%' and nodes.k>0 and nodes.node_system_access!='private' order by nodes.k desc limit $offset,$listing_amount"; + +$set=$db->query($q); +while ($set->next()) { +$k_filtred_nodes_array[1][]=$set->getRecord(); +} + +$smarty->assign('get_k_filtred_nodes',$k_filtred_nodes_array); + +} +?> \ No newline at end of file