本文整理汇总了PHP中erLhcoreClassChat::getList方法的典型用法代码示例。如果您正苦于以下问题:PHP erLhcoreClassChat::getList方法的具体用法?PHP erLhcoreClassChat::getList怎么用?PHP erLhcoreClassChat::getList使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类erLhcoreClassChat
的用法示例。
在下文中一共展示了erLhcoreClassChat::getList方法的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');
}
示例2: 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;
}
}
示例3: 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;
}
示例4: 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;
}
示例5: array
<?php
$online_user = erLhcoreClassModelChatOnlineUser::fetchByVid($Params['user_parameters']['vid']);
if ($online_user !== false) {
$tpl = erLhcoreClassTemplate::getInstance('lhfile/chatfileslistuser.tpl.php');
$tpl->set('items', erLhcoreClassChat::getList(array('filter' => array('online_user_id' => $online_user->id), 'limit' => 100, 'sort' => 'id DESC'), 'erLhcoreClassModelChatFile', 'lh_chat_file'));
echo json_encode(array('result' => $tpl->fetch()));
}
exit;
示例6: array
?>
<ul class="list-unstyled"><li ng-repeat="operator in online_op.list track by operator.id" ><a ng-show="operator.user_id != <?php
echo erLhcoreClassUser::instance()->getUserID();
?>
" href="#" ng-click="lhc.startChatOperator(operator.user_id)" class="small button round">Start chat</a> {{operator.name_support}} | Last activity: {{operator.lastactivity_ago}} ago.</li></ul><?php
}
?>
</div></div><?php
}
}
}
?>
</div></div></div><script>$( document ).ready(function() {lhinst.attachTabNavigator();$('#right-column-page').removeAttr('id');$('#tabs a:first').tab('show')});<?php
$chatsOpen = CSCacheAPC::getMem()->getArray('lhc_open_chats');
if (!empty($chatsOpen)) {
$chats = erLhcoreClassChat::getList(array('filterin' => array('id' => $chatsOpen)));
$deleteKeys = array_diff($chatsOpen, array_keys($chats));
foreach ($deleteKeys as $chat_id) {
CSCacheAPC::getMem()->removeFromArray('lhc_open_chats', $chat_id);
}
foreach ($chats as $chat) {
if (erLhcoreClassChat::hasAccessToRead($chat)) {
echo "lhinst.startChat('{$chat->id}',\$('#tabs'),'" . erLhcoreClassDesign::shrt($chat->nick, 10, '...', 30, ENT_QUOTES) . "');";
} else {
CSCacheAPC::getMem()->removeFromArray('lhc_open_chats', $chat->id);
}
}
}
?>
</script><?php
} else {
开发者ID:niravpatel2008,项目名称:north-american-nemesis-new,代码行数:31,代码来源:5d0370c4f43d45420ba48ede3ad4b44f.php
示例7: lhPaginator
<?php
$tpl = erLhcoreClassTemplate::getInstance('lhchatarchive/list.tpl.php');
$pages = new lhPaginator();
$pages->serverURL = erLhcoreClassDesign::baseurl('chatarchive/list');
$pages->items_total = erLhcoreClassChat::getCount(array(), 'lh_chat_archive_range', 'count(id)');
$pages->setItemsPerPage(20);
$pages->paginate();
$items = array();
if ($pages->items_total > 0) {
$items = erLhcoreClassChat::getList(array('offset' => $pages->low, 'limit' => $pages->items_per_page, 'sort' => 'id ASC'), 'erLhcoreClassModelChatArchiveRange', 'lh_chat_archive_range');
}
$tpl->set('items', $items);
$tpl->set('pages', $pages);
$Result['content'] = $tpl->fetch();
$Result['path'] = array(array('url' => erLhcoreClassDesign::baseurl('system/configuration'), 'title' => erTranslationClassLhTranslation::getInstance()->getTranslation('department/departments', 'System configuration')), array('url' => erLhcoreClassDesign::baseurl('chatarchive/archive'), 'title' => erTranslationClassLhTranslation::getInstance()->getTranslation('chatarchive/archive', 'Chat archive')));
$Result['path'][] = array('title' => erTranslationClassLhTranslation::getInstance()->getTranslation('chatarchive/list', 'Archives list'));
示例8: foreach
<div role="tabpanel" class="tab-pane" id="userchats">
<ul class="foot-print-content list-unstyled" style="max-height: 170px;">
<?php
foreach (erLhcoreClassChat::getList(array('limit' => 100, 'filter' => array('online_user_id' => $online_user->id))) as $chatPrev) {
?>
<?php
if (!isset($chat) || $chat->id != $chatPrev->id) {
?>
<li>
<?php
if (!empty($chatPrev->country_code)) {
?>
<img src="<?php
echo erLhcoreClassDesign::design('images/flags');
?>
/<?php
echo $chatPrev->country_code;
?>
.png" alt="<?php
echo htmlspecialchars($chatPrev->country_name);
?>
" title="<?php
echo htmlspecialchars($chatPrev->country_name);
?>
" /> <?php
}
?>
<a title="<?php
echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/syncadmininterface', 'Open in a new window');
?>
" class="material-icons" onclick="lhinst.startChatNewWindow('<?php
示例9: createArchive
public function createArchive()
{
$items = erLhcoreClassChat::getList(array('filter' => array('range_from' => $this->range_from, 'range_to' => $this->range_to)), 'erLhcoreClassModelChatArchiveRange', 'lh_chat_archive_range');
if (empty($items)) {
$this->saveThis();
} else {
$item = array_shift($items);
$this->id = $item->id;
}
$db = ezcDbInstance::get();
$stmt = $db->prepare("SHOW TABLES LIKE 'lh_chat_archive_{$this->id}'");
$stmt->execute();
$exists = $stmt->fetch();
if ($exists === false) {
// Create archive chat table
$stmt = $db->prepare('SHOW CREATE TABLE `lh_chat`;');
$stmt->execute();
$rows = $stmt->fetch();
$command = $rows[1];
$command = preg_replace('/AUTO_INCREMENT\\=[0-9]+/i', 'AUTO_INCREMENT=1', $command);
$command = str_replace("`lh_chat`", "`lh_chat_archive_{$this->id}`", $command);
$db->query($command);
// Create archive msg table
$stmt = $db->prepare('SHOW CREATE TABLE `lh_msg`;');
$stmt->execute();
$rows = $stmt->fetch();
$command = $rows[1];
$command = preg_replace('/AUTO_INCREMENT\\=[0-9]+/i', 'AUTO_INCREMENT=1', $command);
$command = str_replace("`lh_msg`", "`lh_chat_archive_msg_{$this->id}`", $command);
$db->query($command);
}
return $this->id;
}
示例10: array
$tpl->set('items', $items);
$Result['content'] = $tpl->fetch();
$Result['pagelayout'] = 'popup';
return;
}
if (in_array($Params['user_parameters_unordered']['xls'], array(1, 2))) {
erLhcoreClassChatExport::chatListExportXLS(erLhcoreClassChat::getList(array_merge($filterParams['filter'], array('limit' => 100000, 'offset' => 0))), array('type' => (int) $Params['user_parameters_unordered']['xls']));
exit;
}
$append = erLhcoreClassSearchHandler::getURLAppendFromInput($filterParams['input_form']);
$pages = new lhPaginator();
$pages->items_total = erLhcoreClassChat::getCount($filterParams['filter']);
$pages->translationContext = 'chat/pendingchats';
$pages->serverURL = erLhcoreClassDesign::baseurl('chat/list') . $append;
$pages->paginate();
$tpl->set('pages', $pages);
if ($pages->items_total > 0) {
$items = erLhcoreClassChat::getList(array_merge($filterParams['filter'], array('limit' => $pages->items_per_page, 'offset' => $pages->low)));
erLhcoreClassChat::setOnlineStatusDirectly($items);
$tpl->set('items', $items);
}
$filterParams['input_form']->form_action = erLhcoreClassDesign::baseurl('chat/list');
$tpl->set('input', $filterParams['input_form']);
$tpl->set('inputAppend', $append);
$tpl->set('can_delete_global', $currentUser->hasAccessTo('lhchat', 'deleteglobalchat'));
$tpl->set('can_delete_general', $currentUser->hasAccessTo('lhchat', 'deletechat'));
$tpl->set('can_close_global', $currentUser->hasAccessTo('lhchat', 'allowcloseremote'));
$tpl->set('current_user_id', $currentUser->getUserID());
$Result['content'] = $tpl->fetch();
$Result['path'] = array(array('url' => erLhcoreClassDesign::baseurl('chat/list'), 'title' => erTranslationClassLhTranslation::getInstance()->getTranslation('chat/pendingchats', 'Chats list')));
erLhcoreClassChatEventDispatcher::getInstance()->dispatch('chat.list_path', array('result' => &$Result));
示例11: array
<?php
$tpl = erLhcoreClassTemplate::getInstance('lhchatarchive/viewarchivedchat.tpl.php');
$archive = erLhcoreClassModelChatArchiveRange::fetch($Params['user_parameters']['archive_id']);
$archive->setTables();
$chat = erLhcoreClassModelChatArchive::fetch($Params['user_parameters']['chat_id']);
$tpl->set('chat', $chat);
$tpl->set('messages', erLhcoreClassChat::getList(array('limit' => 1000, 'filter' => array('chat_id' => $chat->id)), 'erLhcoreClassModelChatArchiveMsg', erLhcoreClassModelChatArchiveRange::$archiveMsgTable));
$tpl->set('archive', $archive);
$Result['content'] = $tpl->fetch();
$Result['path'] = array(array('url' => erLhcoreClassDesign::baseurl('system/configuration'), 'title' => erTranslationClassLhTranslation::getInstance()->getTranslation('department/departments', 'System configuration')), array('url' => erLhcoreClassDesign::baseurl('chatarchive/archive'), 'title' => erTranslationClassLhTranslation::getInstance()->getTranslation('chatarchive/archive', 'Chat archive')), array('url' => erLhcoreClassDesign::baseurl('chatarchive/list'), 'title' => erTranslationClassLhTranslation::getInstance()->getTranslation('chatarchive/list', 'Archives list')), array('url' => erLhcoreClassDesign::baseurl('chatarchive/listarchivechats') . '/' . $archive->id, 'title' => erTranslationClassLhTranslation::getInstance()->getTranslation('chatarchive/list', 'Archived chats')));
$Result['path'][] = array('title' => erTranslationClassLhTranslation::getInstance()->getTranslation('chatarchive/viewarchivedchat', 'View archived chat'));
示例12: validateChatList
/**
* Chat's list
*/
public static function validateChatList()
{
$validAttributes = array('int' => array('departament_id' => array('type' => 'filter', 'field' => 'dep_id', 'validator' => new ezcInputFormDefinitionElement(ezcInputFormDefinitionElement::OPTIONAL, 'int', array('min_range' => 1))), 'user_id' => array('type' => 'filter', 'field' => 'user_id', 'validator' => new ezcInputFormDefinitionElement(ezcInputFormDefinitionElement::OPTIONAL, 'int', array('min_range' => 1))), 'status' => array('type' => 'filter', 'field' => 'status', 'validator' => new ezcInputFormDefinitionElement(ezcInputFormDefinitionElement::OPTIONAL, 'int', array('min_range' => 1)))));
$filter = self::formatFilter($validAttributes);
$limitation = self::getLimitation();
// Does not have any assigned department
if ($limitation === false) {
return array('list' => array(), 'list_count' => 0);
}
if ($limitation !== true) {
$filter['customfilter'][] = $limitation;
}
// Get chats list
$chats = erLhcoreClassChat::getList($filter);
// Get chats count
$chatsCount = erLhcoreClassChat::getCount($filter);
// Chats list
return array('list' => array_values($chats), 'list_count' => $chatsCount, 'error' => false);
}
示例13: getTablesStatus
public static function getTablesStatus($definition)
{
$db = ezcDbInstance::get();
$tablesStatus = array();
// Get archive tables
$archives = erLhcoreClassChat::getList(array('offset' => 0, 'limit' => 1000000, 'sort' => 'id ASC'), 'erLhcoreClassModelChatArchiveRange', 'lh_chat_archive_range');
// Update archives tables also
foreach ($archives as $archive) {
$archive->setTables();
$definition['tables'][erLhcoreClassModelChatArchiveRange::$archiveTable] = $definition['tables']['lh_chat'];
$definition['tables'][erLhcoreClassModelChatArchiveRange::$archiveMsgTable] = $definition['tables']['lh_msg'];
}
foreach ($definition['tables'] as $table => $tableDefinition) {
$tablesStatus[$table] = array('error' => false, 'status' => '', 'queries' => array());
try {
$sql = 'SHOW COLUMNS FROM ' . $table;
$stmt = $db->prepare($sql);
$stmt->execute();
$columnsData = $stmt->fetchAll(PDO::FETCH_ASSOC);
$columnsDesired = (array) $tableDefinition;
$status = array();
foreach ($columnsDesired as $columnDesired) {
$columnFound = false;
$typeMatch = true;
foreach ($columnsData as $column) {
if ($columnDesired['field'] == $column['field']) {
$columnFound = true;
if ($columnDesired['type'] != $column['type']) {
$typeMatch = false;
}
}
}
if ($typeMatch == false) {
$tablesStatus[$table]['error'] = true;
$status[] = "[{$columnDesired['field']}] column type is not correct";
$extra = '';
if ($columnDesired['extra'] == 'auto_increment') {
$extra = ' AUTO_INCREMENT';
}
$tablesStatus[$table]['queries'][] = "ALTER TABLE `{$table}`\r\n\t\t\t\t\t\tCHANGE `{$columnDesired['field']}` `{$columnDesired['field']}` {$columnDesired['type']} NOT NULL{$extra};";
}
if ($columnFound == false) {
$tablesStatus[$table]['error'] = true;
$status[] = "[{$columnDesired['field']}] column was not found";
$default = '';
if ($columnDesired['default'] != null) {
$default = " DEFAULT '{$columnDesired['default']}'";
}
$tablesStatus[$table]['queries'][] = "ALTER TABLE `{$table}`\r\n\t\t\t\t\t\tADD `{$columnDesired['field']}` {$columnDesired['type']} NOT NULL{$default},\r\n\t\t\t\t\t\tCOMMENT='';";
}
}
if (!empty($status)) {
$tablesStatus[$table]['status'] = implode(", ", $status);
$tablesStatus[$table]['error'] = true;
}
} catch (Exception $e) {
$tablesStatus[$table]['error'] = true;
$tablesStatus[$table]['status'] = "table does not exists";
$tablesStatus[$table]['queries'][] = $definition['tables_create'][$table];
}
}
foreach ($definition['tables_indexes'] as $table => $dataTableIndex) {
try {
$sql = 'SHOW INDEX FROM ' . $table;
$stmt = $db->prepare($sql);
$stmt->execute();
$columnsData = $stmt->fetchAll(PDO::FETCH_ASSOC);
$status = array();
$existingIndexes = array();
foreach ($columnsData as $indexData) {
$existingIndexes[] = $indexData['key_name'];
}
$existingIndexes = array_unique($existingIndexes);
$newIndexes = array_diff(array_keys($dataTableIndex['new']), $existingIndexes);
foreach ($newIndexes as $newIndex) {
$tablesStatus[$table]['queries'][] = $dataTableIndex['new'][$newIndex];
$status[] = "{$newIndex} index was not found";
}
$removeIndexes = array_intersect($dataTableIndex['old'], $existingIndexes);
foreach ($removeIndexes as $removeIndex) {
$tablesStatus[$table]['queries'][] = "ALTER TABLE `{$table}` DROP INDEX `{$removeIndex}`;";
$tablesStatus[$table]['error'] = true;
$status[] = "{$removeIndex} legacy index was found";
}
if (!empty($status)) {
$tablesStatus[$table]['status'] = implode(", ", $status);
$tablesStatus[$table]['error'] = true;
}
} catch (Exception $e) {
// Just not existing table perhaps
}
}
foreach ($definition['tables_data'] as $table => $dataTable) {
$tableIdentifier = $definition['tables_data_identifier'][$table];
$status = array();
// Check that table has all required records
foreach ($dataTable as $record) {
try {
$sql = "SELECT COUNT(*) as total_records FROM `{$table}` WHERE `{$tableIdentifier}` = :identifier_value";
$stmt = $db->prepare($sql);
//.........这里部分代码省略.........
示例14: autoInformVisitor
public static function autoInformVisitor($minutesTimeout)
{
if ($minutesTimeout > 0) {
$items = erLhcoreClassChat::getList(array('limit' => 10, 'filterlt' => array('last_op_msg_time' => time() - 1 * 60), 'filter' => array('has_unread_op_messages' => 1, 'unread_op_messages_informed' => 0)));
// Update chats instantly
foreach ($items as $item) {
$item->has_unread_op_messages = 0;
$item->unread_op_messages_informed = 1;
$item->updateThis();
}
// Now inform visitors
foreach ($items as $item) {
erLhcoreClassChatMail::informVisitorUnreadMessage($item);
}
}
}
示例15: time
*
* */
echo "Starting chat/workflow\n";
if (erLhcoreClassModelChatConfig::fetch('run_departments_workflow')->current_value == 1) {
echo "Starting departments workflow\n";
$ts = time();
foreach (erLhcoreClassChat::getList(array('limit' => 500, 'customfilter' => array('transfer_timeout_ts < (' . $ts . '-transfer_timeout_ac)'), 'filter' => array('status' => erLhcoreClassModelChat::STATUS_PENDING_CHAT, 'transfer_if_na' => 1))) as $chat) {
$canExecuteWorkflow = true;
if (erLhcoreClassModelChatConfig::fetch('pro_active_limitation')->current_value >= 0) {
if ($chat->department !== false && $chat->department->department_transfer_id > 0) {
$canExecuteWorkflow = erLhcoreClassChat::getPendingChatsCountPublic($chat->department->department_transfer_id) <= erLhcoreClassModelChatConfig::fetch('pro_active_limitation')->current_value;
}
}
if ($canExecuteWorkflow == true) {
erLhcoreClassChatWorkflow::transferWorkflow($chat);
echo "executing department transfer workflow for - ", $chat->id, "\n";
} else {
echo "Skipping transfer because dedicated department queue is full\n";
}
}
echo "Ended departments workflow\n";
}
// Unanswered chats callback
echo erLhcoreClassChatWorkflow::mainUnansweredChatWorkflow();
echo "Closed chats - ", erLhcoreClassChatWorkflow::automaticChatClosing(), "\n";
echo "Purged chats - ", erLhcoreClassChatWorkflow::automaticChatPurge(), "\n";
foreach (erLhcoreClassChat::getList(array('limit' => 500, 'filter' => array('status' => erLhcoreClassModelChat::STATUS_PENDING_CHAT))) as $chat) {
erLhcoreClassChatWorkflow::autoAssign($chat, $chat->department);
erLhcoreClassChatEventDispatcher::getInstance()->dispatch('chat.pending_process_workflow', array('chat' => &$chat));
}
echo "Ended chat/workflow\n";