本文整理汇总了PHP中erLhcoreClassChat::getPendingMessagesChatbox方法的典型用法代码示例。如果您正苦于以下问题:PHP erLhcoreClassChat::getPendingMessagesChatbox方法的具体用法?PHP erLhcoreClassChat::getPendingMessagesChatbox怎么用?PHP erLhcoreClassChat::getPendingMessagesChatbox使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类erLhcoreClassChat
的用法示例。
在下文中一共展示了erLhcoreClassChat::getPendingMessagesChatbox方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: time
$timeCurrent = time();
$pollingEnabled = (int) erLhcoreClassModelChatConfig::fetch('sync_sound_settings')->data['long_polling_enabled'];
$pollingServerTimeout = (int) erLhcoreClassModelChatConfig::fetch('sync_sound_settings')->data['connection_timeout'];
$pollingMessageTimeout = (double) erLhcoreClassModelChatConfig::fetch('sync_sound_settings')->data['polling_chat_message_sinterval'];
$content = 'false';
$status = 'true';
$blocked = 'false';
$ott = '';
$LastMessageID = 0;
$userOwner = 'true';
$breakSync = false;
if (is_object($chat) && $chat->hash == $Params['user_parameters']['hash']) {
while (true) {
// Check for new messages only if chat last message id is greater than user last message id
if ((int) $Params['user_parameters']['message_id'] < $chat->last_msg_id) {
$Messages = erLhcoreClassChat::getPendingMessagesChatbox((int) $Params['user_parameters']['chat_id'], (int) $Params['user_parameters']['message_id']);
if ($Params['user_parameters']['message_id'] == 0 && count($Messages) > 0 || count($Messages) > 1) {
$prevNick = '';
if ($Params['user_parameters']['message_id'] > 0 && count($Messages) > 1) {
$lastMessage = array_shift($Messages);
if ($lastMessage['id'] == $Params['user_parameters']['message_id']) {
$prevNick = $lastMessage['user_id'] == 0 ? $lastMessage['name_support'] : $chat->nick;
} else {
array_unshift($Messages, $lastMessage);
}
}
$tpl = erLhcoreClassTemplate::getInstance('lhchatbox/syncuser.tpl.php');
$tpl->set('messages', $Messages);
$tpl->set('chat', $chat);
$tpl->set('prev_nick', $prevNick);
$tpl->set('sync_mode', isset($Params['user_parameters_unordered']['mode']) ? $Params['user_parameters_unordered']['mode'] : '');