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