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


PHP erLhcoreClassChat::canReopen方法代码示例

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


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

示例1: catch

    } catch (Exception $e) {
    }
} else {
    $defaultTheme = erLhcoreClassModelChatConfig::fetch('default_theme_id')->current_value;
    if ($defaultTheme > 0) {
        try {
            $theme = erLhAbstractModelWidgetTheme::fetch($defaultTheme);
            $Result['theme'] = $theme;
            $modeAppendTheme = '/(theme)/' . $theme->id;
        } catch (Exception $e) {
        }
    }
}
try {
    $chat = erLhcoreClassChat::getSession()->load('erLhcoreClassModelChat', $Params['user_parameters']['chat_id']);
    if ($chat->hash == $Params['user_parameters']['hash'] && erLhcoreClassChat::canReopen($chat, true)) {
        // Is IP blocked directly?
        if (erLhcoreClassModelChatBlockedUser::getCount(array('filter' => array('ip' => erLhcoreClassIPDetect::getIP()))) > 0) {
            header('Location: ' . $_SERVER['HTTP_REFERER']);
            exit;
        }
        /**
         * is IP range blocked
         * */
        $ignorable_ip = erLhcoreClassModelChatConfig::fetch('banned_ip_range')->current_value;
        if ($ignorable_ip != '' && erLhcoreClassIPDetect::isIgnored(erLhcoreClassIPDetect::getIP(), explode(',', $ignorable_ip))) {
            header('Location: ' . $_SERVER['HTTP_REFERER']);
            exit;
        }
        if ($chat->status != erLhcoreClassModelChat::STATUS_ACTIVE_CHAT && $chat->status != erLhcoreClassModelChat::STATUS_PENDING_CHAT) {
            if (erLhcoreClassModelChatConfig::fetch('reopen_as_new')->current_value == 1 || $chat->user_id == 0) {
开发者ID:detain,项目名称:livehelperchat,代码行数:31,代码来源:reopen.php

示例2:

    ?>
</h4>
		<?php 
} else {
    ?>
			<h4><?php 
    echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/chat', 'Pending confirm');
    ?>
</h4>
		<?php 
}
?>
		</div>
				
		<?php 
if (erLhcoreClassModelChatConfig::fetch('reopen_chat_enabled')->current_value == 1 && erLhcoreClassModelChatConfig::fetch('allow_reopen_closed')->current_value == 1 && erLhcoreClassChat::canReopen($chat)) {
    ?>
			<a href="<?php 
    echo erLhcoreClassDesign::baseurl('chat/reopen');
    ?>
/<?php 
    echo $chat->id;
    ?>
/<?php 
    echo $chat->hash;
    if (isset($chat_widget_mode) && $chat_widget_mode == true) {
        ?>
/(mode)/widget<?php 
    }
    if (isset($chat_embed_mode) && $chat_embed_mode == true) {
        ?>
开发者ID:niravpatel2008,项目名称:north-american-nemesis-new,代码行数:31,代码来源:chat.tpl.php

示例3: catch

<?php

/**
 * Override
 * */
try {
    $chat = erLhcoreClassChat::getSession()->load('erLhcoreClassModelChat', $Params['user_parameters']['chat_id']);
} catch (Exception $e) {
    $chat = false;
}
if ((int) erLhcoreClassModelChatConfig::fetch('disable_send')->current_value == 1) {
    exit;
}
if (is_object($chat) && $chat->hash == $Params['user_parameters']['hash'] && ($chat->status == erLhcoreClassModelChat::STATUS_ACTIVE_CHAT || erLhcoreClassChat::canReopen($chat, true))) {
    if (ezcInputForm::hasPostData()) {
        $definition = array('email' => new ezcInputFormDefinitionElement(ezcInputFormDefinitionElement::OPTIONAL, 'validate_email'));
        $form = new ezcInputForm(INPUT_POST, $definition);
        $Errors = array();
        if (!$form->hasValidData('email')) {
            $Errors[] = erTranslationClassLhTranslation::getInstance()->getTranslation('user/edit', 'Wrong email address');
        }
        if (!isset($_SERVER['HTTP_X_CSRFTOKEN']) || !isset($_POST['csfr_token']) || $_POST['csfr_token'] != $_SERVER['HTTP_X_CSRFTOKEN']) {
            $Errors[] = erTranslationClassLhTranslation::getInstance()->getTranslation('user/edit', 'Invalid CSRF token!');
        }
        if (empty($Errors)) {
            $tpl = erLhcoreClassTemplate::getInstance('lhchat/sendmail.tpl.php');
            $mailTemplate = erLhAbstractModelEmailTemplate::fetch(3);
            erLhcoreClassChatMail::prepareSendMail($mailTemplate);
            $mailTemplate->recipient = $form->email;
            $messages = array_reverse(erLhcoreClassModelmsg::getList(array('customfilter' => array('user_id != -1'), 'limit' => 500, 'sort' => 'id DESC', 'filter' => array('chat_id' => $chat->id))));
            // Fetch chat messages
开发者ID:niravpatel2008,项目名称:north-american-nemesis-new,代码行数:31,代码来源:sendchat.php

示例4: catch

<?php

$tpl = erLhcoreClassTemplate::getInstance('lhchat/chatpreview.tpl.php');
try {
    $chat = erLhcoreClassChat::getSession()->load('erLhcoreClassModelChat', $Params['user_parameters']['chat_id']);
    if ($chat->hash == $Params['user_parameters']['hash'] && ($chat->status == erLhcoreClassModelChat::STATUS_ACTIVE_CHAT || erLhcoreClassChat::canReopen($chat, true) || $chat->status == erLhcoreClassModelChat::STATUS_CLOSED_CHAT && $chat->time > time() - 1800)) {
        erLhcoreClassChat::setTimeZoneByChat($chat);
        $tpl->set('chat', $chat);
    } else {
        $tpl->setFile('lhchat/errors/chatnotexists.tpl.php');
    }
} catch (Exception $e) {
    $tpl->setFile('lhchat/errors/chatnotexists.tpl.php');
}
echo $tpl->fetch();
exit;
开发者ID:Adeelgill,项目名称:livehelperchat,代码行数:16,代码来源:chatpreview.php


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