<?php 
function smarty_function_get_bookmark_statistics_tux($brawco,&$smarty) 
{ global $db, $error, $node; 
$node_handle=$node['node_id'];
 $q="select node_access.*,users.login,users.user_action from node_access left join users on node_access.user_id=users.user_id where node_id='$node_handle' and node_bookmark='yes' order by node_user_subchild_count"; 
$result=$db->query($q); 
while ($result->next()) { 

$bs_array[]=$result->getRecord();
$user_id = $bs_array['user_id'];
$query = "select * from users where user_id = '$user_id' and user_action_id IS NOT NULL order by login";
$set1 = mysql_query($query);
$is_user_online = mysql_fetch_array($set1);
if($is_user_online['user_action_id'])) {
# user je online
$bs_array['user_logged_in'] = true;
# /
}

 } 
$smarty->assign('get_bookmark_statistics',$bs_array); 
} 

?>