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


PHP erLhcoreClassModelChatConfig::fetchCache方法代码示例

本文整理汇总了PHP中erLhcoreClassModelChatConfig::fetchCache方法的典型用法代码示例。如果您正苦于以下问题:PHP erLhcoreClassModelChatConfig::fetchCache方法的具体用法?PHP erLhcoreClassModelChatConfig::fetchCache怎么用?PHP erLhcoreClassModelChatConfig::fetchCache使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在erLhcoreClassModelChatConfig的用法示例。


在下文中一共展示了erLhcoreClassModelChatConfig::fetchCache方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: array

$filter = array('offset' => 0, 'limit' => $maxrows, 'sort' => 'last_visit DESC', 'filtergt' => array('last_visit' => time() - $timeout));
$department = isset($Params['user_parameters_unordered']['department']) && is_numeric($Params['user_parameters_unordered']['department']) ? (int) $Params['user_parameters_unordered']['department'] : false;
if ($department !== false) {
    $filter['filter']['dep_id'] = $department;
}
/**
 * Append user departments filter
 * */
$departmentParams = array();
$userDepartments = erLhcoreClassUserDep::parseUserDepartmetnsForFilter($currentUser->getUserID());
if ($userDepartments !== true) {
    $departmentParams['filterin']['id'] = $userDepartments;
    if (!$currentUser->hasAccessTo('lhchat', 'sees_all_online_visitors')) {
        $filter['filterin']['dep_id'] = $userDepartments;
    }
}
if ($is_ajax == true) {
    $items = erLhcoreClassModelChatOnlineUser::getList($filter);
    erLhcoreClassChat::$trackActivity = (int) erLhcoreClassModelChatConfig::fetchCache('track_activity')->current_value == 1;
    erLhcoreClassChat::$trackTimeout = (int) erLhcoreClassModelChatConfig::fetchCache('checkstatus_timeout')->current_value;
    erLhcoreClassChat::prefillGetAttributes($items, array('online_attr_system_array', 'notes_intro', 'last_check_time_ago', 'visitor_tz_time', 'last_visit_seconds_ago', 'lastactivity_ago', 'time_on_site_front', 'can_view_chat', 'operator_user_send', 'operator_user_string', 'first_visit_front', 'last_visit_front', 'online_status'), array('notes', 'online_attr_system'), array('do_not_clean' => true));
    echo json_encode(array_values($items));
    exit;
}
$tpl->set('departmentParams', $departmentParams);
$tpl->set('tracking_enabled', erLhcoreClassModelChatConfig::fetch('track_online_visitors')->current_value == 1);
$tpl->set('geo_location_data', erLhcoreClassModelChatConfig::fetch('geo_location_data')->data);
$Result['content'] = $tpl->fetch();
$Result['path'] = array(array('title' => erTranslationClassLhTranslation::getInstance()->getTranslation('chat/onlineusers', 'Online visitors')));
erLhcoreClassChatEventDispatcher::getInstance()->dispatch('chat.onlineusers_path', array('result' => &$Result));
$Result['additional_footer_js'] = '<script src="' . erLhcoreClassDesign::designJS('js/angular.lhc.online.min.js') . '"></script>';
开发者ID:mdb-webdev,项目名称:livehelperchat,代码行数:31,代码来源:onlineusers.php

示例2: array

<?php

$currentUser = erLhcoreClassUser::instance();
$onlineTimeout = (int) erLhcoreClassModelChatConfig::fetchCache('sync_sound_settings')->data['online_timeout'];
$canListOnlineUsers = false;
$canListOnlineUsersAll = false;
if (erLhcoreClassModelChatConfig::fetchCache('list_online_operators')->current_value == 1) {
    $canListOnlineUsers = $currentUser->hasAccessTo('lhuser', 'userlistonline');
    $canListOnlineUsersAll = $currentUser->hasAccessTo('lhuser', 'userlistonlineall');
}
// We do not need a session anymore
session_write_close();
$ReturnMessages = array();
$pendingTabEnabled = erLhcoreClassModelUserSetting::getSetting('enable_pending_list', 1);
$activeTabEnabled = erLhcoreClassModelUserSetting::getSetting('enable_active_list', 1);
$closedTabEnabled = erLhcoreClassModelUserSetting::getSetting('enable_close_list', 0);
$unreadTabEnabled = erLhcoreClassModelUserSetting::getSetting('enable_unread_list', 1);
$showAllPending = erLhcoreClassModelUserSetting::getSetting('show_all_pending', 1);
$showDepartmentsStats = $currentUser->hasAccessTo('lhuser', 'canseedepartmentstats');
if ($showDepartmentsStats == true) {
    /**
     * Departments stats
     * */
    $limitList = is_numeric($Params['user_parameters_unordered']['limitd']) ? (int) $Params['user_parameters_unordered']['limitd'] : 10;
    $filter = array('ignore_fields' => erLhcoreClassChat::$chatListIgnoreField);
    $filter['limit'] = $limitList;
    if (is_array($Params['user_parameters_unordered']['departmentd']) && !empty($Params['user_parameters_unordered']['departmentd'])) {
        erLhcoreClassChat::validateFilterIn($Params['user_parameters_unordered']['departmentd']);
        $filter['filterin']['id'] = $Params['user_parameters_unordered']['departmentd'];
    }
    $filter['sort'] = 'pending_chats_counter DESC';
开发者ID:kenjiro7,项目名称:livehelperchat,代码行数:31,代码来源:syncadmininterface.php

示例3: array

$content_status = 'false';
$userOwner = 'true';
$hasAccessToReadArray = array();
if (isset($_POST['chats']) && is_array($_POST['chats']) && count($_POST['chats']) > 0) {
    $ReturnMessages = array();
    $ReturnStatuses = array();
    $tpl = erLhcoreClassTemplate::getInstance('lhchat/syncadmin.tpl.php');
    $currentUser = erLhcoreClassUser::instance();
    if (!isset($_SERVER['HTTP_X_CSRFTOKEN']) || !$currentUser->validateCSFRToken($_SERVER['HTTP_X_CSRFTOKEN'])) {
        echo json_encode(array('error' => 'true', 'result' => 'Invalid CSRF Token'));
        exit;
    }
    // Set online condition configurations
    erLhcoreClassChat::$trackActivity = (int) erLhcoreClassModelChatConfig::fetchCache('track_activity')->current_value == 1;
    erLhcoreClassChat::$trackTimeout = (int) erLhcoreClassModelChatConfig::fetchCache('checkstatus_timeout')->current_value;
    erLhcoreClassChat::$onlineCondition = (int) erLhcoreClassModelChatConfig::fetchCache('online_if')->current_value;
    // We do not need a session anymore
    session_write_close();
    $db = ezcDbInstance::get();
    while (true) {
        $db->beginTransaction();
        try {
            foreach ($_POST['chats'] as $chat_id_list) {
                list($chat_id, $MessageID) = explode(',', $chat_id_list);
                $Chat = erLhcoreClassModelChat::fetch($chat_id);
                $Chat->updateIgnoreColumns = array('last_msg_id');
                if (isset($hasAccessToReadArray[$chat_id]) || erLhcoreClassChat::hasAccessToRead($Chat)) {
                    $hasAccessToReadArray[$chat_id] = true;
                    if ($Chat->last_msg_id > (int) $MessageID && count($Messages = erLhcoreClassChat::getPendingMessages($chat_id, $MessageID)) > 0) {
                        // If chat had flag that it contains unread messages set to 0
                        if ($Chat->has_unread_messages == 1 || $Chat->unread_messages_informed == 1) {
开发者ID:keramist,项目名称:livehelperchat,代码行数:31,代码来源:syncadmin.php


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