moved get_node_userlist into backend, removed some warnings
[mirrors/Kyberia-bloodline.git] / wwwroot / inc / smarty / node_methodz / function.get_node_userlist.php
index b5bd2650372521d8b8c75ed67d5e4a63748007e6..43499a55f59fc86d2f5358023f90e1e09af76db0 100644 (file)
@@ -1,17 +1,18 @@
 <?php
 
-       function smarty_function_get_node_userlist($params,&$smarty) {
+// Get list of users currently viewing specified node.
 
-               global $db,$node;
-               if (is_numeric($params['node_id'])) $node_id=$params['node_id'];
-               else $node_id=$node['node_id'];
+function smarty_function_get_node_userlist($params,&$smarty) {
 
-               $set=$db->query("select login,user_id from users where user_action_id='$node_id'");
-               while ($set->next()) {
-                       $userlist[]=$set->getRecord();
-               }
-
-               $smarty->assign('userlist',$userlist);
+       global $node;
 
+       if (isset($params['node_id']) && is_numeric($params['node_id'])) {
+               $node_id=$params['node_id'];
+       } else { 
+               $node_id=$node['node_id'];
        }
-?>
\ No newline at end of file
+
+       $userlist=nodes::getNodeUserlist($node_id);
+       $smarty->assign('userlist',$userlist);
+}
+?>
This page took 0.097945 seconds and 4 git commands to generate.