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