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


PHP erLhcoreClassChat类代码示例

本文整理汇总了PHP中erLhcoreClassChat的典型用法代码示例。如果您正苦于以下问题:PHP erLhcoreClassChat类的具体用法?PHP erLhcoreClassChat怎么用?PHP erLhcoreClassChat使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: getList

 public static function getList($paramsSearch = array())
 {
     if (!isset($paramsSearch['sort'])) {
         $paramsSearch['sort'] = 'id ASC';
     }
     return erLhcoreClassChat::getList($paramsSearch, 'erLhcoreClassModelmsg', 'lh_msg');
 }
开发者ID:Adeelgill,项目名称:livehelperchat,代码行数:7,代码来源:erlhcoreclassmodelmsg.php

示例2: getList

 public static function getList($paramsSearch = array())
 {
     $paramsDefault = array('limit' => 32, 'offset' => 0);
     $params = array_merge($paramsDefault, $paramsSearch);
     $session = erLhcoreClassChat::getSession();
     $q = $session->createFindQuery('erLhcoreClassModelmsg');
     $conditions = array();
     if (isset($params['filter']) && count($params['filter']) > 0) {
         foreach ($params['filter'] as $field => $fieldValue) {
             $conditions[] = $q->expr->eq($field, $q->bindValue($fieldValue));
         }
     }
     if (isset($params['filterin']) && count($params['filterin']) > 0) {
         foreach ($params['filterin'] as $field => $fieldValue) {
             $conditions[] = $q->expr->in($field, $fieldValue);
         }
     }
     if (isset($params['filterlt']) && count($params['filterlt']) > 0) {
         foreach ($params['filterlt'] as $field => $fieldValue) {
             $conditions[] = $q->expr->lt($field, $q->bindValue($fieldValue));
         }
     }
     if (isset($params['filtergt']) && count($params['filtergt']) > 0) {
         foreach ($params['filtergt'] as $field => $fieldValue) {
             $conditions[] = $q->expr->gt($field, $q->bindValue($fieldValue));
         }
     }
     if (count($conditions) > 0) {
         $q->where($conditions);
     }
     $q->limit($params['limit'], $params['offset']);
     $q->orderBy(isset($params['sort']) ? $params['sort'] : 'id ASC');
     $objects = $session->find($q);
     return $objects;
 }
开发者ID:sudogitguy,项目名称:livehelperchat,代码行数:35,代码来源:erlhcoreclassmodelmsg.php

示例3: handle_file_upload

 protected function handle_file_upload($uploaded_file, $name, $size, $type, $error, $index = null, $content_range = null)
 {
     $matches = array();
     if (strpos($name, '.') === false && preg_match('/^image\\/(gif|jpe?g|png)/', $type, $matches)) {
         $name = $uploadFileName = 'clipboard.' . $matches[1];
     } else {
         $uploadFileName = $name;
     }
     if (!preg_match($this->options['accept_file_types_lhc'], $uploadFileName)) {
         $file->error = $this->get_error_message('accept_file_types');
         return false;
     }
     $file = parent::handle_file_upload($uploaded_file, $name, $size, $type, $error, $index, $content_range);
     if (empty($file->error)) {
         $fileUpload = new erLhcoreClassModelChatFile();
         $fileUpload->size = $file->size;
         $fileUpload->type = $file->type;
         $fileUpload->name = $file->name;
         $fileUpload->date = time();
         $fileUpload->user_id = isset($this->options['user_id']) ? $this->options['user_id'] : 0;
         $fileUpload->upload_name = $name;
         $fileUpload->file_path = $this->options['upload_dir'];
         if (isset($this->options['chat']) && $this->options['chat'] instanceof erLhcoreClassModelChat) {
             $fileUpload->chat_id = $this->options['chat']->id;
         } elseif (isset($this->options['online_user']) && $this->options['online_user'] instanceof erLhcoreClassModelChatOnlineUser) {
             $fileUpload->online_user_id = $this->options['online_user']->id;
         }
         $matches = array();
         if (strpos($name, '.') === false && preg_match('/^image\\/(gif|jpe?g|png)/', $fileUpload->type, $matches)) {
             $fileUpload->extension = $matches[1];
         } else {
             $partsFile = explode('.', $fileUpload->upload_name);
             $fileUpload->extension = end($partsFile);
         }
         $fileUpload->saveThis();
         $file->id = $fileUpload->id;
         if (isset($this->options['chat']) && $this->options['chat'] instanceof erLhcoreClassModelChat) {
             // Chat assign
             $chat = $this->options['chat'];
             // Format message
             $msg = new erLhcoreClassModelmsg();
             $msg->msg = '[file=' . $file->id . '_' . md5($fileUpload->name . '_' . $fileUpload->chat_id) . ']';
             $msg->chat_id = $chat->id;
             $msg->user_id = isset($this->options['user_id']) ? $this->options['user_id'] : 0;
             if ($msg->user_id > 0 && isset($this->options['name_support'])) {
                 $msg->name_support = (string) $this->options['name_support'];
             }
             $chat->last_user_msg_time = $msg->time = time();
             erLhcoreClassChat::getSession()->save($msg);
             // Set last message ID
             if ($chat->last_msg_id < $msg->id) {
                 $chat->last_msg_id = $msg->id;
             }
             $chat->has_unread_messages = 1;
             $chat->updateThis();
         }
         $this->uploadedFile = $fileUpload;
     }
     return $file;
 }
开发者ID:sirromas,项目名称:medical,代码行数:60,代码来源:lhfileupload.php

示例4: fetchByHash

 public static function fetchByHash($hash)
 {
     $list = erLhcoreClassChat::getList(array('limit' => 1, 'filter' => array('hash' => $hash)), 'erLhcoreClassModelChatAccept', 'lh_chat_accept');
     if (!empty($list)) {
         return array_pop($list);
     } else {
         return false;
     }
 }
开发者ID:Adeelgill,项目名称:livehelperchat,代码行数:9,代码来源:erlhcoreclassmodelchataccept.php

示例5: validateSendMail

 public static function validateSendMail(erLhAbstractModelEmailTemplate &$sendMail, &$chat, $params = array())
 {
     $Errors = array();
     $validationFields = array();
     $validationFields['Message'] = new ezcInputFormDefinitionElement(ezcInputFormDefinitionElement::OPTIONAL, 'unsafe_raw');
     $validationFields['Subject'] = new ezcInputFormDefinitionElement(ezcInputFormDefinitionElement::OPTIONAL, 'unsafe_raw');
     $validationFields['FromName'] = new ezcInputFormDefinitionElement(ezcInputFormDefinitionElement::OPTIONAL, 'unsafe_raw');
     $validationFields['FromEmail'] = new ezcInputFormDefinitionElement(ezcInputFormDefinitionElement::OPTIONAL, 'validate_email');
     $validationFields['ReplyEmail'] = new ezcInputFormDefinitionElement(ezcInputFormDefinitionElement::OPTIONAL, 'validate_email');
     $validationFields['RecipientEmail'] = new ezcInputFormDefinitionElement(ezcInputFormDefinitionElement::OPTIONAL, 'validate_email');
     $form = new ezcInputForm(INPUT_POST, $validationFields);
     $Errors = array();
     if (isset($params['archive_mode']) && $params['archive_mode'] == true) {
         $messages = array_reverse(erLhcoreClassChat::getList(array('limit' => 100, 'sort' => 'id DESC', 'customfilter' => array('user_id != -1'), 'filter' => array('chat_id' => $chat->id)), 'erLhcoreClassModelChatArchiveMsg', erLhcoreClassModelChatArchiveRange::$archiveMsgTable));
     } else {
         $messages = array_reverse(erLhcoreClassModelmsg::getList(array('limit' => 100, 'sort' => 'id DESC', 'customfilter' => array('user_id != -1'), 'filter' => array('chat_id' => $chat->id))));
     }
     // Fetch chat messages
     $tpl = new erLhcoreClassTemplate('lhchat/messagelist/plain.tpl.php');
     $tpl->set('chat', $chat);
     $tpl->set('messages', $messages);
     $sendMail->content = str_replace(array('{user_chat_nick}', '{messages_content}', '{chat_id}'), array($chat->nick, $tpl->fetch(), $chat->id), $sendMail->content);
     if ($form->hasValidData('Message')) {
         $sendMail->content = str_replace('{additional_message}', $form->Message, $sendMail->content);
     }
     $sendMail->content = erLhcoreClassBBCode::parseForMail($sendMail->content);
     if ($form->hasValidData('FromEmail')) {
         $sendMail->from_email = $form->FromEmail;
     }
     if ($form->hasValidData('ReplyEmail')) {
         $sendMail->reply_to = $form->ReplyEmail;
     }
     if ($form->hasValidData('FromName')) {
         $sendMail->from_name = $form->FromName;
     }
     if ($form->hasValidData('Subject')) {
         $sendMail->subject = $form->Subject;
     }
     if ($form->hasValidData('RecipientEmail')) {
         $sendMail->recipient = $form->RecipientEmail;
     } else {
         $Errors[] = erTranslationClassLhTranslation::getInstance()->getTranslation('chat/sendmail', 'Please enter recipient e-mail!');
     }
     if (empty($sendMail->from_email)) {
         $Errors[] = erTranslationClassLhTranslation::getInstance()->getTranslation('chat/sendmail', 'From e-mail is missing!');
     }
     if (empty($sendMail->reply_to)) {
         $Errors[] = erTranslationClassLhTranslation::getInstance()->getTranslation('chat/sendmail', 'Reply e-mail is missing!');
     }
     if (empty($sendMail->subject)) {
         $Errors[] = erTranslationClassLhTranslation::getInstance()->getTranslation('chat/sendmail', 'Subject is missing!');
     }
     return $Errors;
 }
开发者ID:sirromas,项目名称:medical,代码行数:54,代码来源:lhchatmail.php

示例6: __get

 public function __get($var)
 {
     switch ($var) {
         case 'is_online':
             $this->is_online = erLhcoreClassChat::isOnline($this->id);
             return $this->is_online;
             break;
         case 'is_online_exclipic':
             $this->is_online_exclipic = erLhcoreClassChat::isOnline($this->id, true);
             return $this->is_online_exclipic;
             break;
         case 'inform_options_array':
             $this->inform_options_array = $this->inform_options != '' ? unserialize($this->inform_options) : array();
             return $this->inform_options_array;
             break;
         case 'can_delete':
             $this->can_delete = erLhcoreClassChat::getCount(array('filter' => array('dep_id' => $this->id))) == 0;
             return $this->can_delete;
             break;
         case 'department_transfer':
             $this->department_transfer = false;
             if ($this->department_transfer_id > 0) {
                 try {
                     $this->department_transfer = self::fetch($this->department_transfer_id, true);
                 } catch (Exception $e) {
                 }
             }
             return $this->department_transfer;
             break;
         case 'start_hour_front':
             return floor($this->start_hour / 100);
             break;
         case 'start_minutes_front':
             return $this->start_hour - $this->start_hour_front * 100;
             break;
         case 'end_hour_front':
             return floor($this->end_hour / 100);
             break;
         case 'end_minutes_front':
             return $this->end_hour - $this->end_hour_front * 100;
             break;
         default:
             break;
     }
 }
开发者ID:detain,项目名称:livehelperchat,代码行数:45,代码来源:erlhcoreclassmodeldepartament.php

示例7: afterSave

 public function afterSave()
 {
     $db = ezcDbInstance::get();
     $stmt = $db->prepare('DELETE FROM lh_userdep WHERE dep_group_id = :dep_group_id AND user_id = :user_id');
     $stmt->bindValue(':dep_group_id', $this->dep_group_id);
     $stmt->bindValue(':user_id', $this->user_id);
     $stmt->execute();
     foreach ($this->dep_group->departments_ids as $depId) {
         $stmt = $db->prepare('INSERT INTO lh_userdep (user_id,dep_id,hide_online,last_activity,last_accepted,active_chats,type,dep_group_id) VALUES (:user_id,:dep_id,:hide_online,0,0,:active_chats,1,:dep_group_id)');
         $stmt->bindValue(':user_id', $this->user_id);
         $stmt->bindValue(':dep_id', $depId);
         $stmt->bindValue(':hide_online', $this->user->hide_online);
         $stmt->bindValue(':dep_group_id', $this->dep_group_id);
         $stmt->bindValue(':active_chats', erLhcoreClassChat::getCount(array('filter' => array('user_id' => $this->user_id, 'status' => erLhcoreClassModelChat::STATUS_ACTIVE_CHAT))));
         $stmt->execute();
     }
     erLhcoreClassModelDepartamentGroupMember::updateUserDepartmentsIds($this->user_id);
 }
开发者ID:remdex,项目名称:livehelperchat,代码行数:18,代码来源:erlhcoreclassmodeldepartamentgroupuser.php

示例8: removeInstanceData

 public function removeInstanceData()
 {
     foreach (erLhAbstractModelFormCollected::getList(array('limit' => 1000000)) as $item) {
         $item->removeThis();
     }
     foreach (erLhAbstractModelWidgetTheme::getList(array('limit' => 1000000)) as $item) {
         $item->removeThis();
     }
     foreach (erLhcoreClassChat::getList(array('limit' => 1000000)) as $item) {
         $item->removeThis();
     }
     foreach (erLhcoreClassChat::getList(array('limit' => 1000000), 'erLhcoreClassModelChatFile', 'lh_chat_file') as $item) {
         $item->removeThis();
     }
     foreach (erLhcoreClassModelUser::getUserList(array('limit' => 1000000)) as $item) {
         $item->removeFile();
     }
     // Dispatch event for extensions
     erLhcoreClassChatEventDispatcher::getInstance()->dispatch('instance.destroyed', array('instance' => $this));
     return true;
 }
开发者ID:hgeorge123,项目名称:automated-hosting,代码行数:21,代码来源:erlhcoreclassmodelinstance.php

示例9: __get

 public function __get($var)
 {
     switch ($var) {
         case 'chat':
             $this->chat = false;
             if ($this->chat_id > 0) {
                 try {
                     $this->chat = erLhcoreClassModelChat::fetch($this->chat_id);
                 } catch (Exception $e) {
                     erLhcoreClassChatbox::getSession()->delete($this);
                 }
             } else {
                 $this->chat = new erLhcoreClassModelChat();
                 $this->chat->hash = erLhcoreClassChat::generateHash();
             }
             return $this->chat;
             break;
         default:
             break;
     }
 }
开发者ID:Adeelgill,项目名称:livehelperchat,代码行数:21,代码来源:erlhcoreclassmodelchatbox.php

示例10: afterSave

 public function afterSave()
 {
     $db = ezcDbInstance::get();
     $stmt = $db->prepare('SELECT user_id FROM lh_departament_group_user WHERE dep_group_id = :dep_group_id');
     $stmt->bindValue(':dep_group_id', $this->dep_group_id);
     $stmt->execute();
     $userIds = $stmt->fetchAll(PDO::FETCH_COLUMN);
     foreach ($userIds as $userId) {
         $stmt = $db->prepare('SELECT hide_online FROM lh_users WHERE id = :user_id');
         $stmt->bindValue(':user_id', $userId);
         $stmt->execute();
         $hide_online = $stmt->fetch(PDO::FETCH_COLUMN);
         $stmt = $db->prepare('INSERT INTO lh_userdep (user_id,dep_id,hide_online,last_activity,last_accepted,active_chats,type,dep_group_id) VALUES (:user_id,:dep_id,:hide_online,0,0,:active_chats,1,:dep_group_id)');
         $stmt->bindValue(':user_id', $userId);
         $stmt->bindValue(':dep_id', $this->dep_id);
         $stmt->bindValue(':hide_online', $hide_online);
         $stmt->bindValue(':dep_group_id', $this->dep_group_id);
         $stmt->bindValue(':active_chats', erLhcoreClassChat::getCount(array('filter' => array('user_id' => $userId, 'status' => erLhcoreClassModelChat::STATUS_ACTIVE_CHAT))));
         $stmt->execute();
         self::updateUserDepartmentsIds($userId);
     }
 }
开发者ID:remdex,项目名称:livehelperchat,代码行数:22,代码来源:erlhcoreclassmodeldepartamentgroupmember.php

示例11: addUserDepartaments

 public static function addUserDepartaments($Departaments, $userID = false, $UserData = false)
 {
     $db = ezcDbInstance::get();
     if ($userID === false) {
         $currentUser = erLhcoreClassUser::instance();
         $userID = $currentUser->getUserID();
     }
     $stmt = $db->prepare('DELETE FROM lh_userdep WHERE user_id = :user_id ORDER BY id ASC');
     $stmt->bindValue(':user_id', $userID);
     $stmt->execute();
     foreach ($Departaments as $DepartamentID) {
         $stmt = $db->prepare('INSERT INTO lh_userdep (user_id,dep_id,hide_online,last_activity,last_accepted,active_chats) VALUES (:user_id,:dep_id,:hide_online,0,0,:active_chats)');
         $stmt->bindValue(':user_id', $userID);
         $stmt->bindValue(':dep_id', $DepartamentID);
         $stmt->bindValue(':hide_online', $UserData->hide_online);
         $stmt->bindValue(':active_chats', erLhcoreClassChat::getCount(array('filter' => array('user_id' => $UserData->id, 'status' => erLhcoreClassModelChat::STATUS_ACTIVE_CHAT))));
         $stmt->execute();
     }
     if (isset($_SESSION['lhCacheUserDepartaments_' . $userID])) {
         unset($_SESSION['lhCacheUserDepartaments_' . $userID]);
     }
 }
开发者ID:Adeelgill,项目名称:livehelperchat,代码行数:22,代码来源:lhuserdep.php

示例12: htmlspecialchars

        $tosVariable = 'offline_tos_visible_in_page_widget';
        $tosCheckedVariable = 'tos_checked_offline';
        ?>
	<?php 
        include_once erLhcoreClassDesign::designtpl('lhchat/part/accept_tos.tpl.php');
        ?>

	<div class="btn-group" role="group" aria-label="...">
  		<?php 
        include erLhcoreClassDesign::designtpl('lhchat/part/buttons/leave_a_message_button_widget.tpl.php');
        ?>
  		<?php 
        include erLhcoreClassDesign::designtpl('lhchat/part/offline_button_multiinclude.tpl.php');
        ?>
		<?php 
        if (erLhcoreClassModelChatConfig::fetch('reopen_chat_enabled')->current_value == 1 && ($reopenData = erLhcoreClassChat::canReopenDirectly(array('reopen_closed' => erLhcoreClassModelChatConfig::fetch('allow_reopen_closed')->current_value))) !== false) {
            ?>
		    <?php 
            include erLhcoreClassDesign::designtpl('lhchat/part/buttons/reopen_offline_button_widget.tpl.php');
            ?>
	  	<?php 
        }
        ?>
	</div>
	
	<input type="hidden" value="<?php 
        echo htmlspecialchars($referer);
        ?>
" name="URLRefer"/>
	<input type="hidden" value="1" name="StartChat"/>
开发者ID:Adeelgill,项目名称:livehelperchat,代码行数:30,代码来源:offline_form.tpl.php

示例13: json_encode

<?php

try {
    $chat = erLhcoreClassChat::getSession()->load('erLhcoreClassModelChat', $Params['user_parameters']['chat_id']);
    if ($chat->hash == $Params['user_parameters']['hash'] && ($chat->status == erLhcoreClassModelChat::STATUS_PENDING_CHAT || $chat->status == erLhcoreClassModelChat::STATUS_ACTIVE_CHAT)) {
        $lastMessage = erLhcoreClassChat::getGetLastChatMessageEdit($chat->id, 0);
        if (isset($lastMessage['msg'])) {
            $array['id'] = $lastMessage['id'];
            $array['msg'] = $lastMessage['msg'];
            $array['error'] = 'f';
            echo json_encode($array);
            exit;
        }
    }
} catch (Exception $e) {
}
echo json_encode(array('error' => 't'));
exit;
开发者ID:Topspot,项目名称:livehelperchat,代码行数:18,代码来源:editprevioususer.php

示例14: die

<?php

// Set new chat owner
$currentUser = erLhcoreClassUser::instance();
$currentUser->getUserID();
$chat = erLhcoreClassChat::getSession()->load('erLhcoreClassModelChat', $Params['user_parameters']['chat_id']);
// Chat can be closed only by owner
if ($chat->user_id == $currentUser->getUserID() || $currentUser->hasAccessTo('lhchat', 'allowcloseremote')) {
    if (!$currentUser->validateCSFRToken($Params['user_parameters_unordered']['csfr'])) {
        die('Invalid CSRF Token');
        exit;
    }
    if ($chat->status != erLhcoreClassModelChat::STATUS_CLOSED_CHAT) {
        $chat->status = erLhcoreClassModelChat::STATUS_CLOSED_CHAT;
        $chat->chat_duration = erLhcoreClassChat::getChatDurationToUpdateChatID($chat->id);
        $userData = $currentUser->getUserData(true);
        $msg = new erLhcoreClassModelmsg();
        $msg->msg = (string) $userData . ' ' . erTranslationClassLhTranslation::getInstance()->getTranslation('chat/closechatadmin', 'has closed the chat!');
        $msg->chat_id = $chat->id;
        $msg->user_id = -1;
        $chat->last_user_msg_time = $msg->time = time();
        erLhcoreClassChat::getSession()->save($msg);
        $chat->updateThis();
        erLhcoreClassChat::updateActiveChats($chat->user_id);
        // Execute callback for close chat
        erLhcoreClassChat::closeChatCallback($chat, $userData);
    }
}
CSCacheAPC::getMem()->removeFromArray('lhc_open_chats', (int) $Params['user_parameters']['chat_id']);
header('Location: ' . $_SERVER['HTTP_REFERER']);
exit;
开发者ID:sudogitguy,项目名称:livehelperchat,代码行数:31,代码来源:closechat.php

示例15: array

<?php

if (is_numeric($Params['user_parameters']['chat_id'])) {
    /*
     * If online user mode we have to make different check
     * */
    $browse = false;
    if ($Params['user_parameters_unordered']['cobrowsemode'] == 'onlineuser') {
        $onlineUser = erLhcoreClassModelChatOnlineUser::fetch($Params['user_parameters']['chat_id']);
        $browse = erLhcoreClassCoBrowse::getBrowseInstanceByOnlineUser($onlineUser);
    } else {
        $chat = erLhcoreClassChat::getSession()->load('erLhcoreClassModelChat', $Params['user_parameters']['chat_id']);
        if (erLhcoreClassChat::hasAccessToRead($chat)) {
            $browse = erLhcoreClassCoBrowse::getBrowseInstance($chat);
        }
    }
    if ($browse instanceof erLhcoreClassModelCoBrowse) {
        if ($browse->modifications != '') {
            $changes = json_decode($browse->modifications);
            $changes[] = array('url' => $browse->url);
            $changes[] = array('lmsg' => $browse->mtime > 0 ? $browse->mtime_front : '');
            $changes[] = array('finished' => array('status' => !$browse->is_sharing, 'text' => $browse->is_sharing == 0 ? erTranslationClassLhTranslation::getInstance()->getTranslation('cobrowse/browse', 'Screen sharing session has finished') : erTranslationClassLhTranslation::getInstance()->getTranslation('cobrowse/browse', 'Screen is shared')));
            if ($browse->finished == 1) {
                $changes[] = array('clear' => true);
            }
            array_unshift($changes, array('base' => $browse->url));
            echo json_encode($changes);
            $browse->modifications = '';
            $browse->saveThis();
        } else {
            $changes = array();
开发者ID:detain,项目名称:livehelperchat,代码行数:31,代码来源:checkmirrorchanges.php


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