51ff3226 |
1 | <?php |
2 | |
d69b37e1 |
3 | function smarty_function_get_nodes_by_type($params,&$smarty) { |
4 | global $node; |
51ff3226 |
5 | |
d69b37e1 |
6 | $type=$params['type']; |
7 | if ($params['listing_amount']=='all') $listing_amount=DEF_MAX_LISTING_AMMOUNT; |
8 | else $listing_amount=$params['listing_amount']; |
9 | if (empty($params['offset'])) $offset=0; |
10 | else $offset=$params['offset']; |
11 | if ($params['vector']) { |
12 | $vector=$params['vector']; |
13 | } |
14 | if ($params['orderby']) { |
15 | $orderby=$params['orderby']; |
16 | } |
17 | $node_id=$node['node_id']; |
18 | $user_id=$_SESSION['user_id']; |
51ff3226 |
19 | |
d69b37e1 |
20 | $result=nodes::getNodesByType(isset($vector)?$vector:"",$user_id,$type,isset($orderby)?$orderby:"",$offset,$listing_amount); |
51ff3226 |
21 | |
d69b37e1 |
22 | $smarty->assign('get_nodes_by_type',$result); |
23 | |
24 | } |
25 | ?> |