51ff3226 |
1 | <?php |
2 | |
637e2914 |
3 | function smarty_function_get_threaded_children($params,&$smarty) { |
4 | global $error, $node; |
5 | |
6 | $offset=isset($params['offset']) ? $params['offset'] : ""; |
7 | $limit=isset($params['listing_amount']) ? $params['listing_amount'] : DEF_LISTING_AMMOUNT; |
8 | $limit=($limit > DEF_MAX_LISTING_AMMOUNT) ? DEF_MAX_LISTING_AMMOUNT : $limit; |
9 | $synapse_time= isset($_POST['synapse_time'])? $_POST['synapse_time'] : ""; |
10 | $orderby=isset($params['orderby']) ? $params['orderby'] : "desc"; |
11 | $time=isset($params['time']) ? $params['time'] : ""; |
12 | $link=(isset($params['link']) && $params['link']=='yes') ? "yes" : ""; |
40428f53 |
13 | $node_id=$node['node_id']; |
14 | $node_vector=$node['node_vector']; |
15 | |
637e2914 |
16 | |
17 | // XXX WTF |
18 | if ($node['node_system_access']=='public') { $security="yes"; } |
19 | else { $security = ""; } |
20 | |
21 | if (!empty($params['search'])) { |
22 | if ($params['search_type']=='content') { |
23 | $search='content'; |
24 | $search_param=$params['search']; |
25 | } else { |
26 | $id=nodes::getUserByLogin($params['search']); |
27 | $search='user'; |
28 | $search_param=$id; |
51ff3226 |
29 | } |
637e2914 |
30 | } else { |
31 | $search=""; |
32 | $search_param=""; |
444d6866 |
33 | } |
867423f4 |
34 | |
6973651b |
35 | $get_children_array=nodes::getThreadedChildren($node_id,$node_vector,$offset,$limit,$orderby,$time,$synapse_time,$security,$link,$search,$search_param); |
51ff3226 |
36 | |
444d6866 |
37 | $smarty->assign('get_threaded_children',$get_children_array); |
444d6866 |
38 | } |
51ff3226 |
39 | ?> |