user_exists) { //Initiate data $userinfo = $user->user_info; $profileinfo = $user->profile_info; $levelinfo = $user->level_info; $user_id = $userinfo["user_id"]; $is_enabled = $userinfo["user_enabled"]; //SETUP user picture dir $user_subdir = $user_id+999-(($user_id-1)%1000); $userdir = "../uploads_user/$user_subdir/$user_id/"; //CHECK if user is enabled if ($is_enabled){ //SETUP user variables $username = $userinfo["user_username"]; $avconfig['changeuser'] = 0; $avconfig["username"] = $username; $avconfig['usersListType'] = 'thumbnail'; //SETUP user gender if (!empty($profileinfo) && isset($profileinfo["profilevalue_5"]) && $profileinfo["profilevalue_5"] != ""){ $gender = $profileinfo["profilevalue_5"]; $avconfig['changegender'] = 0; $avconfig['coupleGenderEnabled'] = 0; if ($gender == 1) { $avconfig['gender'] = 'male'; }else if ($gender == 2) { $avconfig['gender'] = 'female'; } } $avconfig['changegender'] = 0; $avconfig['coupleGenderEnabled'] = 0; $avconfig['gender'] = 'male'; //SETUP profile URL $friendly_url = $setting["setting_url"]; if ($friendly_url){ $avconfig['profileUrl']='../'; }else{ $avconfig['profileUrl']='../profile.php?user='.$userinfo["user_username"]; } //SETUP profile thumbnail to show in user list $userphoto_name = $userinfo["user_photo"]; if ($userphoto_name == "" || $levelinfo["level_photo_allow"] == 0){ $userphoto_url = 'nophoto.png'; }else{ $userphoto_url = $userdir.$userphoto_name; } $avconfig['thumbnailUrl'] = $userphoto_url; //SETUP audio & video broadcast permission if (isset($levelinfo["level_avchat3_allowvideobroadcast"]) && $levelinfo["level_avchat3_allowvideobroadcast"] != ""){ $avconfig['allowVideoStreaming']=$levelinfo["level_avchat3_allowvideobroadcast"]; } if (isset($levelinfo["level_avchat3_allowaudiobroadcast"]) && $levelinfo["level_avchat3_allowaudiobroadcast"] != ""){ $avconfig['allowAudioStreaming']=$levelinfo["level_avchat3_allowaudiobroadcast"]; } //SETUP private streaming if (isset($levelinfo["level_avchat3_allowprivatestreaming"]) && $levelinfo["level_avchat3_allowprivatestreaming"] != ""){ $avconfig['allowPrivateStreaming'] = $levelinfo["level_avchat3_allowprivatestreaming"]; } //SETUP allowance of emails & urls in text chat if (isset($levelinfo["level_avchat3_allowEmailsAndUrlsInChat"]) && $levelinfo["level_avchat3_allowEmailsAndUrlsInChat"]){ $avconfig['allowEmails'] = $levelinfo["level_avchat3_allowEmailsAndUrlsInChat"]; $avconfig['allowUrls'] = $levelinfo["level_avchat3_allowEmailsAndUrlsInChat"]; } //SETUP youtube's video button if (isset($levelinfo["level_avchat3_youTubeVideosEnabled"]) && $levelinfo["level_avchat3_youTubeVideosEnabled"] != ""){ $avconfig['youTubeVideosEnabled'] = $levelinfo["level_avchat3_youTubeVideosEnabled"]; } //SETUP send file to room if(isset($levelinfo["level_avchat3_sendFileToRoomsEnabled"]) && $levelinfo["level_avchat3_sendFileToRoomsEnabled"] !=""){ $avconfig['sendFileToRoomsEnabled'] = $levelinfo["level_avchat3_sendFileToRoomsEnabled"]; } //SETUP send file to user if(isset($levelinfo["level_avchat3_sendFileToUserEnabled"]) && $levelinfo["level_avchat3_sendFileToUserEnabled"] !=""){ $avconfig['sendFileToUserEnabled'] = $levelinfo["level_avchat3_sendFileToUserEnabled"]; } //SETUP PM button if (isset($levelinfo["level_avchat3_pmEnabled"]) && $levelinfo["level_avchat3_pmEnabled"] != ""){ $avconfig['pmEnabled'] = $levelinfo["level_avchat3_pmEnabled"]; } //SETUP join rooms button if (isset($levelinfo["level_avchat3_joinRoomsEnabled"]) && $levelinfo["level_avchat3_joinRoomsEnabled"] != ""){ $avconfigp['joinRoomsEnabled'] = $levelinfo["level_avchat3_sendFileToUserEnabled"]; } //SETUP create rooms button if (isset($levelinfo["level_avchat3_createRoomsEnabled"]) && $levelinfo["level_avchat3_createRoomsEnabled"] != ""){ $avconfig['createRoomsEnabled'] = $levelinfo["level_avchat3_createRoomsEnabled"]; } //SETUP maxStreams if (isset($setting["setting_avchat3_maxStreams"]) && isset($setting["setting_avchat3_maxStreams"]) != ""){ $avconfig['maxStreams'] = $setting["setting_avchat3_maxStreams"]; } //SETUP flood control if (isset($levelinfo["level_avchat3_floodControlEnabled"]) && $levelinfo["level_avchat3_floodControlEnabled"] != ""){ $avconfig["floodControlEnabled"] = $levelinfo["level_avchat3_floodControlEnabled"]; if ($levelinfo["level_avchat3_floodControlEnabled"] == 1){ $avconfig['floodControlDelay'] = $setting["setting_avchat3_floodControlDelay"]; } } //SETUP char limit if (isset($setting["setting_avchat3_textChatCharLimit"]) && $setting["setting_avchat3_textChatCharLimit"] != ""){ $avconfig['textChatCharLimit'] = $setting["setting_avchat3_textChatCharLimit"]; } //SETUP max rooms one can be in if (isset($setting["setting_avchat3_maxRoomsOneCanBeIn"]) && $setting["setting_avchat3_maxRoomsOneCanBeIn"] != ""){ $avconfig["maxRoomsOneCanBeIn"] = $setting["setting_avchat3_maxRoomsOneCanBeIn"]; } //SETUP free video time if (isset($levelinfo["level_avchat3_freeVideoTime"]) && $levelinfo["level_avchat3_freeVideoTime"] != ""){ $avconfig['freeVideoTime'] = $levelinfo["level_avchat3_freeVideoTime"]; } //SETUP maximum number of characters a username can have if (isset($setting['setting_avchat3_usnmaxchars']) && $setting['setting_avchat3_usnmaxchars']){ $avconfig['usnmaxchars'] = $setting['setting_avchat3_usnmaxchars']; } //SETUP language filter if (isset($levelinfo["level_avchat3_applyLanguageFilter"]) && $levelinfo["level_avchat3_applyLanguageFilter"] != ""){ $avconfig['applyLanguageFilter'] = $levelinfo["level_avchat3_applyLanguageFilter"]; } }else{ //IF the user is not enabled, he will not access the application $avconfig["showLoginError"] = 1; } }elseif(isset($admin) && !empty($admin) ){ //IF user is admin if ($admin->admin_exists){ $admininfo = $admin->admin_info; $avconfig["username"] = $admininfo["admin_username"]; $avconfig['changeuser'] = 0; $avconfig['changegender'] = 0; }else{ $avconfig["showLoinError"] = 1; } }else{ //IF the user is not a member he will not access the application $avconfig["showLoginError"] = 1; //SETUP LOGIN & REGISTER button $avconfig['loginPageURL'] = '../login.php'; $avconfig['registerPageURL'] = '../signup.php'; } ?>