Kyberia v2.3 - 1st revision from SVN (Without patches of kyberia.sk team)
[mirrors/Kyberia-bloodline.git] / inc / smarty / node_methodz / function.get_children_by_external_link.php
index c4b12e8a0609283893ec72096fe088aed0921daa..994926a6d800f3e27e359af6d8630b4be1970864 100644 (file)
@@ -1,31 +1,32 @@
 <?php
+function smarty_function_get_children_by_external_link($params,&$smarty) {
+       global $db,$node;
 
-       function smarty_function_get_children_by_external_link($params,&$smarty) {
+       if ($params['orderby']=='desc') $orderby="desc";
+       $external_link=$params['external_link'];
 
-               if ($params['orderby']=='desc') $orderby="desc";
+       if ($params['listing_amount']=='all') $listing_amount='23232323232323323';
+       else $listing_amount=$params['listing_amount'];
 
-               $external_link=$params['external_link'];
-               if ($params['listing_amount']=='all') $listing_amount='23232323232323323';
-               else $listing_amount=$params['listing_amount'];
+       if (empty($params['offset'])) $offset=0;
+       else $offset=$params['offset'];
 
-               if (empty($params['offset'])) $offset=0;
-               else $offset=$params['offset'];
+       if (empty($params['orderby_type'])) $orderby_type = 'node_created';
+       else $orderby_type = $params['orderby_type'];
 
-               global $db,$node;
-//             if (!$params['parent_id']) {
-                       $parent_id=$node['node_id'];
-//             }
-//             else $parent_id=$params['parent_id'];
+       // if (!$params['parent_id']) {
+       $parent_id=$node['node_id'];
+       // }
+       // else $parent_id=$params['parent_id'];
 
-               $user_id=$_SESSION['user_id'];
+       $user_id=$_SESSION['user_id'];
 
-               $q="select users.*,nodes.*,node_content.* from nodes  left join
-node_content on (node_content.node_id=nodes.node_id) left
+       $q="select users.*,nodes.* from nodes left
 join users on users.user_id=nodes.node_creator where node_parent='$parent_id'
-and external_link='$external_link' order by node_created $orderby LIMIT $offset,$listing_amount";
+and external_link='$external_link' order by $orderby_type $orderby LIMIT $offset,$listing_amount";
 
-               $set=$db->query($q);
-               while ($set->next()) $pole[]=$set->getRecord();
-               $smarty->assign('get_children_by_external_link',$pole);
-       }
-?>
\ No newline at end of file
+       $set=$db->query($q);
+       while ($set->next()) $pole[]=$set->getRecord();
+       $smarty->assign('get_children_by_external_link',$pole);
+}
+?>
This page took 0.140586 seconds and 4 git commands to generate.