fixed getUSerSubmissionChildren & moved getLast to backend
[mirrors/Kyberia-bloodline.git] / wwwroot / inc / smarty / node_methodz / function.get_last.php
index cc29ea54f105101911e56143f1a12b63ae63f262..b5298a9892a383b2d30093874573a9b77dd13f43 100644 (file)
@@ -1,36 +1,13 @@
 <?php
 
-# XXX remove constants and move to backend
-       function smarty_function_get_last($params,&$smarty) {
+// Get last submissions that appeared on kyberia (all users)
+// XXX permission checking?
 
-               if ($params['listing_amount']=='all') $listing_amount='-1';
-               else $listing_amount=addslashes($params['listing_amount']);
-               if (empty($params['offset'])) $offset=0;
-               else $offset=addslashes($params['offset']);
+function smarty_function_get_last($params,&$smarty) {
 
-               global $db,$node;
+       $last=nodes::GetLast($params/*$listing_ammount,$offset,$order_by*/);
+       $smarty->assign('get_last', $last);
 
-               if ($node['node_id']==23)  {
-                       $interval=" nodes.node_created>NOW()-INTERVAL 65 HOUR and";
-                       $params['vector']="00";
-               }
 
-               else {
-                       $vector=$node['node_vector'];
-                       $interval=" nodes.node_created>NOW()-INTERVAL 42 DAY and";
-               }
-
-               $node_id=$node['node_id'];
-               $user_id=$_SESSION['user_id'];
-               $q="select parent.node_name as parent_name,users.*,nodes.* from nodes
-               left join nodes as parent on parent.node_id=nodes.node_parent
-               left  join users on users.user_id=nodes.node_creator where $interval
-               nodes.node_vector like '$vector%'  and
-               nodes.node_system_access!='private' order by nodes.node_id desc LIMIT $offset,$listing_amount ";
-
-               $set=$db->query($q);
-               while ($set->next()) $pole[]=$set->getRecord();
-               $smarty->assign('get_last',$pole);
-
-       }
+}
 ?>
This page took 0.148873 seconds and 4 git commands to generate.