Commit | Line | Data |
---|---|---|
e586807d H |
1 | <?php |
2 | ||
3 | function smarty_function_get_creation_by_template_id($params,&$smarty) { | |
4 | ||
5 | if ($params['listing_amount']=='all') $listing_amount='2323'; | |
6 | else $listing_amount=$params['listing_amount']; | |
7 | ||
8 | if (empty($params['offset'])) $offset=0; | |
9 | else $offset=$params['offset']; | |
10 | ||
11 | global $db,$node; | |
12 | if (is_numeric($params['creator_id'])) $creator_id=$params['creator_id']; | |
13 | else $creator_id=$node['node_id']; | |
14 | $template_id=$_GET['action']; | |
15 | $user_id=$_SESSION['user_id']; | |
16 | ||
b42b2bf9 | 17 | $q="select parent.node_name as parent_name,nodes.* from nodes left join nodes as parent on parent.node_id=nodes.node_parent where nodes.node_creator='$creator_id' and |
e586807d H |
18 | nodes.template_id='$template_id' and |
19 | nodes.node_system_access!='private' order by | |
20 | nodes.node_created desc LIMIT $offset,$listing_amount"; | |
21 | // echo $q; | |
22 | $set=$db->query($q); | |
23 | while ($set->next()) $pole[]=$set->getRecord(); | |
24 | $smarty->assign('get_creation_by_template_id',$pole); | |
25 | } | |
26 | ?> |