| 1 | <?php |
| 2 | |
| 3 | function smarty_function_get_nodes_by_type($params,&$smarty) { |
| 4 | global $node; |
| 5 | |
| 6 | $vector=""; |
| 7 | $orderby=""; |
| 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']; |
| 13 | if (isset($params['vector']) && $params['vector']) { |
| 14 | $vector=$params['vector']; |
| 15 | } |
| 16 | if (isset($params['orderby']) && $params['orderby']) { |
| 17 | $orderby=$params['orderby']; |
| 18 | } |
| 19 | $node_id=$node['node_id']; |
| 20 | $user_id=$_SESSION['user_id']; |
| 21 | |
| 22 | $result=nodes::getNodesByType($vector,$user_id,$type,$orderby,$offset,$listing_amount); |
| 23 | |
| 24 | $smarty->assign('get_nodes_by_type',$result); |
| 25 | |
| 26 | } |
| 27 | ?> |