// ########################### INITILIZATION #############################
$response = array();
$messages = array();
$buddyList = array();
$time = time();
if (var_check('popout')) {
    $popout = true;
} else {
    $popout = false;
}
// ###################### START BUDDY LIST RECEIVE #######################
if (logged_in($userid)) {
    // Refresh the user's session
    updateUserSession();
    if ($disable_buddy_list == 1 or check_if_guest($userid) or NO_FREIND_SYSTEM == 1 or $is_admin == 1 and $admin_chat_all == 1) {
        $sql = get_online_list($userid, $time);
    } else {
        $sql = get_friend_list($userid, $time);
    }
    $result = $db->execute($sql);
    while ($chat = $db->fetch_array($result)) {
        if ($chat['userid'] != $userid) {
            if ($time - $chat['lastactivity'] < $online_timeout and $chat['status'] != 'invisible' and $chat['status'] != 'offline') {
                if ($chat['status'] != 'busy' and $chat['status'] != 'away') {
                    $chat['status'] = 'available';
                }
            } else {
                if ($chat['status'] == 'invisible') {
                    if ($is_admin == 1) {
                        $chat['status'] = 'available';
                    }
Ejemplo n.º 2
0
}
// ############################### DEBUG #################################
// Check if a user is logged in
if (logged_in($userid)) {
    $test_userid = "";
    $test_userid_img = "checked";
} else {
    $test_userid = 'The User ID is not set. ArrowChat is acting as if no one is logged in which may or may not show the bar depending on your settings. <a href="javascript:;" class="vtip" title="&lt;b&gt;What this means&lt;/b&gt;<br />Depending on your ArrowChat admin settings, this may mean several things.  If guests are allowed to chat, the full bar will be displayed. If the option to show a message was chosen, then guests will see a message to login.  If neither of those is true, ArrowChat will not be displayed.<br /><br />&lt;b&gt;How to fix this&lt;/b&gt;<br />You can fix the User ID if there is a problem in the /arrowchat/includes/integration.php file. The get_user_id() function must return the logged in user\'s ID.">More Information &rarr;</a>';
    $test_userid_img = "unchecked";
}
// Check if the buddy list is functioning
if ($disable_buddy_list == 1) {
    if (!logged_in($userid)) {
        $userid = 0;
    }
    $sql = get_online_list($userid, time());
} else {
    if (!logged_in($userid)) {
        $userid = 0;
    }
    $sql = get_friend_list($userid, time());
}
$result = $db->execute($sql);
if ($result) {
    $test_buddylist = "";
    $test_buddylist_img = "checked";
} else {
    $test_buddylist = 'The buddy list has an error in the MySQL. Here is the error that MySQL is returning:' . $db->display_errors() . '<a href="javascript:;" class="vtip" title="&lt;b&gt;What this means&lt;/b&gt;<br />The buddy list cannot be loaded properly. You are most likely seeing an error when clicking on the chat tab.<br /><br />&lt;b&gt;How to fix this&lt;/b&gt;<br />You can fix the buddy list if there is a problem in the /arrowchat/includes/integration.php file. The get_friend_list() function is used for sites with a friends list. The get_online_list() function is used for sites that want to display all online users.">More Information &rarr;</a>';
    $test_buddylist_img = "unchecked";
}
// Check if the user's ID or IP address is banned