2 function smarty_function_get_userlist($params,&$smarty) {
4 if (is_numeric($params['node_id'])) $node_id=$params['node_id'];
6 else $node_id=$node['node_id'];
7 if ($params['vector']) {
8 $vector=AddSlashes($params['vector']);
10 if ($_SESSION['cube_vector']) {
11 $vector=$_SESSION['cube_vector'];
14 $q="select user_action,user_action_id,(UNIX_TIMESTAMP()-UNIX_TIMESTAMP(last_action)) as idle,login,user_id from users where ";
15 if ($vector) $q.=" user_location_vector like '$vector%' and ";
16 $q.=" invisible != 'yes' and user_action_id IS NOT NULL order by login";
19 while ($set->next()) {
20 if (!empty($_SESSION['friends'][$set->getString('user_id')])) {
21 $array=$set->getRecord();
22 $array['idle_time_minutes']=floor($array['idle']/60);
23 $array['idle_time_seconds']=$array['idle']%60
;
24 $active_friends[]=$array;
27 $array=$set->getRecord();
28 $array['idle_time_minutes']=floor($array['idle']/60);
30 $array['idle_time_seconds']=$array['idle']%60
;
31 $active_users[]=$array;
35 $smarty->assign('active_users',$active_users);
36 $smarty->assign('active_friends',$active_friends);
This page took 0.292322 seconds and 4 git commands to generate.