本文整理汇总了PHP中erLhcoreClassModelChatOnlineUser::fetchByVid方法的典型用法代码示例。如果您正苦于以下问题:PHP erLhcoreClassModelChatOnlineUser::fetchByVid方法的具体用法?PHP erLhcoreClassModelChatOnlineUser::fetchByVid怎么用?PHP erLhcoreClassModelChatOnlineUser::fetchByVid使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类erLhcoreClassModelChatOnlineUser
的用法示例。
在下文中一共展示了erLhcoreClassModelChatOnlineUser::fetchByVid方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: header
<?php
header('content-type: application/json; charset=utf-8');
header('Access-Control-Allow-Origin: *');
header('Access-Control-Allow-Headers: Origin, X-Requested-With, Content-Type, Accept');
if ($Params['user_parameters_unordered']['hash'] != '' || $Params['user_parameters_unordered']['vid'] != '') {
$checkHash = true;
$vid = false;
if ($Params['user_parameters_unordered']['hash'] != '') {
list($chatID, $hash) = explode('_', $Params['user_parameters_unordered']['hash']);
} else {
if ($Params['user_parameters_unordered']['hash_resume'] != '') {
list($chatID, $hash) = explode('_', $Params['user_parameters_unordered']['hash_resume']);
} elseif ($Params['user_parameters_unordered']['vid'] != '') {
$vid = erLhcoreClassModelChatOnlineUser::fetchByVid($Params['user_parameters_unordered']['vid']);
if ($vid !== false) {
$chatID = $vid->chat_id;
$checkHash = false;
} else {
echo json_encode(array('stored' => 'false'));
exit;
}
}
}
try {
if ($chatID > 0) {
$chat = erLhcoreClassChat::getSession()->load('erLhcoreClassModelChat', $chatID);
} else {
$chat = false;
}
if (($checkHash == true && $chat !== false && $chat->hash == $hash || $checkHash == false) && (is_object($vid) || ($chat !== false && $chat->status == erLhcoreClassModelChat::STATUS_PENDING_CHAT || $chat->status == erLhcoreClassModelChat::STATUS_ACTIVE_CHAT))) {
示例2: date
<?php
$online_user = erLhcoreClassModelChatOnlineUser::fetchByVid($Params['user_parameters']['vid']);
if ($online_user !== false && isset($online_user->online_attr_system_array['ishare_enabled']) && $online_user->online_attr_system_array['ishare_enabled'] == 1) {
$fileData = erLhcoreClassModelChatConfig::fetch('file_configuration');
$data = (array) $fileData->data;
$path = 'var/storage/' . date('Y') . 'y/' . date('m') . '/' . date('d') . '/ou' . $online_user->id . '/';
erLhcoreClassChatEventDispatcher::getInstance()->dispatch('file.uploadfile.file_path', array('path' => &$path, 'storage_id' => $online_user->id));
$upload_handler = new erLhcoreClassFileUpload(array('user_id' => 0, 'max_file_size' => $data['fs_max'] * 1024, 'accept_file_types_lhc' => '/\\.(' . $data['ft_us'] . ')$/i', 'online_user' => $online_user, 'download_via_php' => true, 'upload_dir' => $path));
if ($upload_handler->uploadedFile instanceof erLhcoreClassModelChatFile) {
erLhcoreClassChatEventDispatcher::getInstance()->dispatch('file.uploadfile.file_store', array('chat_file' => $upload_handler->uploadedFile));
}
echo json_encode(array('error' => 'false'));
}
exit;
示例3: getAdjustment
public static function getAdjustment($geo_adjustment, $onlineUserVid = '', $widgetMode = false, $onlineUserDefined = false)
{
$responseStatus = array('status' => 'normal');
$onlineUser = false;
if (isset($geo_adjustment['use_geo_adjustment']) && $geo_adjustment['use_geo_adjustment'] == true) {
if ($widgetMode === true && $geo_adjustment['apply_widget'] == 0) {
return $responseStatus;
}
if (is_object($onlineUserDefined)) {
$onlineUser = $onlineUserDefined;
} elseif (!empty($onlineUserVid)) {
$onlineUser = erLhcoreClassModelChatOnlineUser::fetchByVid($onlineUserVid);
}
if ($onlineUser === false) {
$onlineUser = new erLhcoreClassModelChatOnlineUser();
// Just to pass instance
$onlineUser->ip = erLhcoreClassIPDetect::getIP();
erLhcoreClassModelChatOnlineUser::detectLocation($onlineUser);
}
$countriesAvailableFor = array();
if ($geo_adjustment['available_for'] != '') {
$countriesAvailableFor = explode(',', $geo_adjustment['available_for']);
}
if (!in_array($onlineUser->user_country_code, $countriesAvailableFor)) {
if ($geo_adjustment['other_countries'] == 'all') {
if ($geo_adjustment['other_status'] == 'offline') {
$responseStatus = array('status' => 'offline');
} else {
$responseStatus = array('status' => 'hidden');
}
} else {
if ($geo_adjustment['hide_for'] != '') {
$countrieshideFor = explode(',', $geo_adjustment['hide_for']);
if (in_array($onlineUser->user_country_code, $countrieshideFor)) {
if ($geo_adjustment['other_status'] == 'offline') {
$responseStatus = array('status' => 'offline');
} else {
$responseStatus = array('status' => 'hidden');
}
} else {
if ($geo_adjustment['rest_status'] == 'offline') {
$responseStatus = array('status' => 'offline');
} elseif ($geo_adjustment['rest_status'] == 'normal') {
$responseStatus = array('status' => 'normal');
} else {
$responseStatus = array('status' => 'hidden');
}
}
} else {
if ($geo_adjustment['rest_status'] == 'offline') {
$responseStatus = array('status' => 'offline');
} elseif ($geo_adjustment['rest_status'] == 'normal') {
$responseStatus = array('status' => 'normal');
} else {
$responseStatus = array('status' => 'hidden');
}
}
}
}
// Normal status
}
return $responseStatus;
}