Kyberia v2.0
[mirrors/Kyberia-bloodline.git] / inc / smarty / node_methodz / function.getCreationByTemplateId.php
1 <?php
2
3 function smarty_function_getCreationByTemplateId($params,&$smarty) {
4
5
6 $template_id=$params['template_id'];
7 if ($params['listing_amount']=='all') $listing_amount='23232323232323323';
8 elseif (is_numeric($params['listing_amount'])) $listing_amount=$params['listing_amount'];
9 else $listing_amount=DEFAULT_LISTING_AMOUNT;
10
11 if (empty($params['offset'])) $offset=0;
12 else $offset=$params['offset'];
13
14 global $db,$node;
15 if (is_numeric($params['creator_id'])) $creator_id=$params['creator_id'];
16 else $creator_id=$node['node_id'];
17 if (is_numeric($params['template_id'])) $template_id=$params['template_id'];
18 else $template_id=DEFAULT_TEMPLATE;
19
20 $user_id=$_SESSION['user_id'];
21
22 $q="select parent.node_name as
23 parent_name,nodes.*,node_content.* from nodes
24 left join node_content on (node_content.node_id=nodes.node_id)
25 left join nodes as parent on parent.node_id=nodes.node_parent
26 where nodes.node_creator='$creator_id' and
27 nodes.template_id='$template_id' and
28 nodes.node_system_access!='private' order by
29 nodes.node_created desc LIMIT $offset,$listing_amount";
30
31 $set=$db->query($q);
32 while ($set->next()) $pole[]=$set->getRecord();
33 $smarty->assign('getCreationByTemplateId',$pole);
34 }
35 ?>
This page took 0.286068 seconds and 4 git commands to generate.