Kyberia v2.0
[mirrors/Kyberia-bloodline.git] / inc / smarty / node_methodz / function.get_creation_by_template_id.php
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
17 $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
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 ?>
This page took 0.352636 seconds and 4 git commands to generate.