Commit | Line | Data |
---|---|---|
e586807d H |
1 | <?php |
2 | ||
3 | function smarty_function_get_last($params,&$smarty) { | |
4 | ||
5 | $vector=addslashes($params['vector']); | |
6 | if (empty($vector)) $vector='0'; | |
7 | if ($params['listing_amount']=='all') $listing_amount='-1'; | |
8 | else $listing_amount=addslashes($params['listing_amount']); | |
9 | if (empty($params['offset'])) $offset=0; | |
10 | else $offset=addslashes($params['offset']); | |
11 | ||
12 | global $db,$node; | |
13 | $node_id=$node['node_id']; | |
14 | $user_id=$_SESSION['user_id']; | |
15 | $q="select parent.node_name as parent_name,users.*,nodes.*,node_content.* from nodes left join nodes as parent on parent.node_id=nodes.node_parent left join node_content on (node_content.node_id=nodes.node_id) left join users on users.user_id=nodes.node_creator where nodes.node_created>NOW()-INTERVAL 23 HOUR and nodes.node_vector like '%$vector%' and nodes.node_system_access!='private' order by nodes.node_created desc LIMIT $offset,$listing_amount "; | |
16 | $set=$db->query($q); | |
17 | while ($set->next()) $pole[]=$set->getRecord(); | |
18 | $smarty->assign('get_last',$pole); | |
19 | ||
20 | } | |
21 | ?> |