FROM $track_online_table INNER JOIN $friend_user_table ON (friend_user_id = login_user_id)
WHERE DATE_ADD(login_date,INTERVAL $valid MINUTE) >= '".$current_date."' AND friend_user_id <> '".api_get_user_id()."' AND relation_type='".USER_RELATION_TYPE_FRIEND."' AND user_id = '".api_get_user_id()."' ";
WHERE DATE_ADD(login_date,INTERVAL $time_limit MINUTE) >= '".$current_date."' AND friend_user_id <> '".api_get_user_id()."' AND relation_type='".USER_RELATION_TYPE_FRIEND."' AND user_id = '".api_get_user_id()."'
ORDER BY $column $direction
LIMIT $from, $number_of_items";
} else {
// all users online
//$query = "SELECT login_user_id,login_date FROM ".$track_online_table ." WHERE DATE_ADD(login_date,INTERVAL $valid MINUTE) >= '".$current_date."' "; //WHERE DATE_ADD(login_date,INTERVAL $valid MINUTE) >= '".$current_date."'
$query = "SELECT login_user_id,login_date FROM ".$track_online_table ." e INNER JOIN ".$table_user ." u ON (u.user_id=e.login_user_id) WHERE DATE_ADD(login_date,INTERVAL $valid MINUTE) >= '".$current_date."' ORDER BY picture_uri DESC";
//$query = "SELECT login_user_id,login_date FROM ".$track_online_table ." WHERE DATE_ADD(login_date,INTERVAL $time_limit MINUTE) >= '".$current_date."' "; //WHERE DATE_ADD(login_date,INTERVAL $time_limit MINUTE) >= '".$current_date."'
$query = "SELECT login_user_id, login_date FROM ".$track_online_table ." e INNER JOIN ".$table_user ." u ON (u.user_id=e.login_user_id)
WHERE DATE_ADD(login_date,INTERVAL $time_limit MINUTE) >= '".$current_date."'
ORDER BY $column $direction
LIMIT $from, $number_of_items";
}
if (api_get_multiple_access_url()) {
@ -168,25 +198,31 @@ function who_is_online($valid, $friends = false) {
INNER JOIN $friend_user_table ON (friend_user_id = login_user_id)
WHERE track.access_url_id = $access_url_id AND DATE_ADD(login_date,INTERVAL $valid MINUTE) >= '".$current_date."' AND friend_user_id <> '".api_get_user_id()."' AND relation_type='".USER_RELATION_TYPE_FRIEND."' ";
FROM $track_online_table track INNER JOIN $friend_user_table ON (friend_user_id = login_user_id)
WHERE track.access_url_id = $access_url_id AND DATE_ADD(login_date,INTERVAL $time_limit MINUTE) >= '".$current_date."' AND friend_user_id <> '".api_get_user_id()."' AND relation_type='".USER_RELATION_TYPE_FRIEND."'
ORDER BY $column $direction
LIMIT $from, $number_of_items";
} else {
// all users online
$query = "SELECT login_user_id,login_date FROM ".$track_online_table ." track INNER JOIN ".$table_user ." u ON (u.user_id=track.login_user_id)
WHERE track.access_url_id = $access_url_id AND DATE_ADD(login_date,INTERVAL $valid MINUTE) >= '".$current_date."' ORDER BY picture_uri DESC ";
WHERE track.access_url_id = $access_url_id AND DATE_ADD(login_date,INTERVAL $time_limit MINUTE) >= '".$current_date."'
ORDER BY $column $direction
LIMIT $from, $number_of_items";
}
}
}
//This query will show all registered users. Only for dev purposes.
$query = "SELECT DISTINCT u.user_id as login_user_id, login_date FROM ".$track_online_table ." e , $table_user u GROUP by u.user_id ORDER BY picture_uri DESC";
/*$query = "SELECT DISTINCT u.user_id as login_user_id, login_date FROM ".$track_online_table ." e , $table_user u
if ($is_group_member || $group_info['visibility'] == GROUP_PERMISSION_OPEN) {
if (!$is_group_member) {
if (!in_array($my_group_role, array(GROUP_USER_PERMISSION_PENDING_INVITATION_SENT_BY_USER, GROUP_USER_PERMISSION_PENDING_INVITATION))) {
echo '<aclass="a_button white medium"href="groups.php?id='.$group_id.'&action=join&u='.api_get_user_id().'">'.get_lang('JoinGroup').'</a>';
$social_right_content .= '<aclass="a_button white medium"href="groups.php?id='.$group_id.'&action=join&u='.api_get_user_id().'">'.get_lang('JoinGroup').'</a>';
echo '<aclass="a_button white medium"href="groups.php?id='.$group_id.'&action=join&u='.api_get_user_id().'">'.get_lang('YouHaveBeenInvitedJoinNow').'</a>';
$social_right_content .= '<aclass="a_button white medium"href="groups.php?id='.$group_id.'&action=join&u='.api_get_user_id().'">'.get_lang('YouHaveBeenInvitedJoinNow').'</a>';
$create_thread_link = '<ahref="'.api_get_path(WEB_CODE_PATH).'social/message_for_group_form.inc.php?view_panel=1&height=400&width=610&&user_friend='.api_get_user_id().'&group_id='.$group_id.'&action=add_message_group"class="a_button white medium thickbox"title="'.get_lang('ComposeMessage').'">'.get_lang('YouShouldCreateATopic').'</a></li>';
} else {
$create_thread_link = '<ahref="'.api_get_path(WEB_CODE_PATH).'social/message_for_group_form.inc.php?view_panel=1&height=400&width=610&&user_friend='.api_get_user_id().'&group_id='.$group_id.'&action=add_message_group"class="a_button white medium thickbox"title="'.get_lang('ComposeMessage').'">'.get_lang('NewTopic').'</a>';
$create_thread_link = '<ahref="'.api_get_path(WEB_CODE_PATH).'social/message_for_group_form.inc.php?view_panel=1&height=400&width=610&&user_friend='.api_get_user_id().'&group_id='.$group_id.'&action=add_message_group"class="a_button white medium thickbox"title="'.get_lang('ComposeMessage').'">'.get_lang('NewTopic').'</a>';
if (!in_array($my_group_role, array(GROUP_USER_PERMISSION_PENDING_INVITATION_SENT_BY_USER, GROUP_USER_PERMISSION_PENDING_INVITATION))) {
echo '<aclass="a_button white medium"href="groups.php?id='.$group_id.'&action=join&u='.api_get_user_id().'">'.get_lang('JoinGroup').'</a>';
$social_right_content .= '<aclass="a_button white medium"href="groups.php?id='.$group_id.'&action=join&u='.api_get_user_id().'">'.get_lang('JoinGroup').'</a>';
echo '<aclass="a_button white medium"href="groups.php?id='.$group_id.'&action=join&u='.api_get_user_id().'">'.get_lang('YouHaveBeenInvitedJoinNow').'</a>';
$social_right_content .= '<aclass="a_button white medium"href="groups.php?id='.$group_id.'&action=join&u='.api_get_user_id().'">'.get_lang('YouHaveBeenInvitedJoinNow').'</a>';
}
}
echo '</div>'; // end layout messages
$social_right_content .= '</div>'; // end layout messages