当前位置: 首页>>代码示例>>PHP>>正文


PHP erLhcoreClassModelChatOnlineUser::fetchByVid方法代码示例

本文整理汇总了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))) {
开发者ID:paisdelconocimiento,项目名称:glpi-smartcities,代码行数:31,代码来源:storescreenshot.php

示例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;
开发者ID:Adeelgill,项目名称:livehelperchat,代码行数:15,代码来源:uploadfileonline.php

示例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;
 }
开发者ID:sudogitguy,项目名称:livehelperchat,代码行数:63,代码来源:lhchat.php


注:本文中的erLhcoreClassModelChatOnlineUser::fetchByVid方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。