execute(" SELECT status, popout, hash_id, is_admin, play_sound, window_open, chatroom_block_chats, only_names, unfocus_chat, focus_chat, block_chats, chatroom_sound, guest_name, chatroom_show_names, ip_address, is_mod, session_time, session_start_time, welcome_viewed FROM arrowchat_status WHERE userid = '" . $db->escape_string($userid) . "' "); if ($result AND $db->count_select() > 0) { $row = $db->fetch_array($result); if (isset($row['popout'])) { $popout = $row['popout']; $popout_time = $popout; if ((time() - $popout < ($buddy_list_heart_beat +7)) AND $popout != "99") { $popout = 1; } } if (isset($row['play_sound'])) { $play_sound = $row['play_sound']; } if (isset($row['welcome_viewed'])) { $welcome_viewed = $row['welcome_viewed']; } if (isset($row['guest_name'])) { $guest_name = $row['guest_name']; } if (isset($row['window_open'])) { $window_open = $row['window_open']; } if (isset($row['chatroom_block_chats'])) { $chatroom_block_chats = $row['chatroom_block_chats']; } if (isset($row['chatroom_sound'])) { $chatroom_sound = $row['chatroom_sound']; } if (isset($row['chatroom_show_names'])) { $chatroom_show_names = $row['chatroom_show_names']; } if (isset($row['only_names'])) { $only_names = $row['only_names']; } if (isset($row['is_admin'])) { $is_admin = $row['is_admin']; } if (check_array_for_match($group_id, $group_is_admin_sep)) { $is_admin = 1; } if (isset($row['is_mod'])) { $is_mod = $row['is_mod']; } if (check_array_for_match($group_id, $group_is_mod_sep)) { $is_mod = 1; } /*if (isset($row['theme']) AND $theme_change_on == 1 AND ($chat_maintenance != 1 OR ($admin_view_maintenance == 1 AND $is_admin == 1))) { $theme = $row['theme']; }*/ if (!empty($row['unfocus_chat'])) { $unfocus_chat = unserialize($row['unfocus_chat']); } if (!empty($row['hash_id'])) { $hash_id = $row['hash_id']; } else { $hash_id = random_string(); $db->execute(" UPDATE arrowchat_status SET hash_id='" . $hash_id . "' WHERE userid = '" . $db->escape_string($userid) . "' "); } if (!empty($row['focus_chat'])) { $focus_chat = unserialize($row['focus_chat']); } if (!empty($row['status'])) { $status = $row['status']; } if (!empty($row['block_chats'])) { $block_chats = $row['block_chats']; } if ($row['ip_address'] != $user_ip) { $db->execute(" UPDATE arrowchat_status SET ip_address = '" . $db->escape_string($user_ip) . "' WHERE userid = '" . $db->escape_string($userid) . "' "); } if (!empty($row['session_time'])) { $session_time = $row['session_time']; } if (!empty($row['session_start_time'])) { $session_start_time = $row['session_start_time']; } } else { $hash_id = random_string(); $db->execute(" INSERT INTO arrowchat_status (userid, hash_id, session_time, ip_address) VALUES ('" . $db->escape_string($userid) . "', '" . $hash_id . "', '" . time() . "', '" . $db->escape_string($user_ip) . "') "); } } ?>