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


PHP erLhcoreClassTemplate::fetch方法代码示例

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


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

示例1: getOutArray

 public static function getOutArray()
 {
     if (self::$outArray == null) {
         $tpl = new erLhcoreClassTemplate();
         $smileys = explode('||', $tpl->fetch('lhbbcode/smiley.tpl.php'));
         self::$outArray = $smileys;
     }
     return self::$outArray;
 }
开发者ID:Topspot,项目名称:livehelperchat,代码行数:9,代码来源:lhbbcode.php

示例2: 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', 'filter' => array('chat_id' => $chat->id)), 'erLhcoreClassModelChatArchiveMsg', erLhcoreClassModelChatArchiveRange::$archiveMsgTable));
     } else {
         $messages = array_reverse(erLhcoreClassModelmsg::getList(array('limit' => 100, 'sort' => 'id DESC', '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}'), array($chat->nick, $tpl->fetch()), $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:nagyistoce,项目名称:livehelperchat,代码行数:54,代码来源:lhchatmail.php

示例3: array

            $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
            $tpl = new erLhcoreClassTemplate('lhchat/messagelist/plain.tpl.php');
            $tpl->set('chat', $chat);
            $tpl->set('messages', $messages);
            $mailTemplate->content = str_replace(array('{user_chat_nick}', '{messages_content}'), array($chat->nick, $tpl->fetch()), $mailTemplate->content);
            erLhcoreClassChatMail::sendMail($mailTemplate, $chat);
            echo json_encode(array('error' => 'false'));
            exit;
        } else {
            $tpl = erLhcoreClassTemplate::getInstance('lhkernel/validation_error.tpl.php');
            $tpl->set('errors', $Errors);
            echo json_encode(array('error' => 'true', 'result' => $tpl->fetch()));
            exit;
        }
    } else {
        $tpl = erLhcoreClassTemplate::getInstance('lhchat/sendchat.tpl.php');
        $tpl->set('chat', $chat);
        echo $tpl->fetch();
    }
}
开发者ID:niravpatel2008,项目名称:north-american-nemesis-new,代码行数:31,代码来源:sendchat.php

示例4: array

                    if ($form->hasValidData('AdminEmail')) {
                        $tpl->set('admin_email', $form->AdminEmail);
                    }
                    $tpl->set('admin_name', $form->AdminName);
                    $tpl->set('admin_surname', $form->AdminSurname);
                    $tpl->set('admin_departament', $form->DefaultDepartament);
                    $tpl->set('errors', $Errors);
                    $tpl->setFile('lhinstall/install3.tpl.php');
                }
            } else {
                $tpl->setFile('lhinstall/install3.tpl.php');
            }
            break;
        case '4':
            $tpl->setFile('lhinstall/install4.tpl.php');
            break;
        default:
            $tpl->setFile('lhinstall/install1.tpl.php');
            break;
    }
    $Result['content'] = $tpl->fetch();
    $Result['pagelayout'] = 'install';
    $Result['path'] = array(array('title' => 'Live helper chat installation'));
} catch (Exception $e) {
    echo "Make sure that &quot;cache/*&quot; is writable and then <a href=\"" . erLhcoreClassDesign::baseurl('install/install') . "\">try again</a>";
    echo "<pre>";
    print_r($e);
    echo "</pre>";
    exit;
    exit;
}
开发者ID:p4prawin,项目名称:livechat,代码行数:31,代码来源:install.php

示例5: chatExportJSON

 public function chatExportJSON(erLhcoreClassModelChat $chat)
 {
     $tpl = new erLhcoreClassTemplate('lhexport/json.tpl.php');
     $tpl->set('chat', $chat);
     return $tpl->fetch();
 }
开发者ID:sirromas,项目名称:medical,代码行数:6,代码来源:lhchatexport.php

示例6: addSMSMessageSend

 public function addSMSMessageSend($number)
 {
     $this->sms_left -= $number;
     $this->sms_processed += $number;
     if ($this->soft_limit_in_effect == true && $this->soft_warning_send == 0) {
         $this->soft_warning_send = 1;
         // Send mail to global administrator
         $mail = new PHPMailer(true);
         $mail->CharSet = "UTF-8";
         $mail->Subject = erTranslationClassLhTranslation::getInstance()->getTranslation('instance/edit', 'Instance has reached soft SMS limit') . ' - ' . $this->id;
         $mail->AddReplyTo($this->email, (string) $this->address);
         $tpl = new erLhcoreClassTemplate();
         $tpl->set('instance', $this);
         // Remove new line characters
         $content = str_replace("\n", "", $tpl->fetch('lhinstance/mail/phone_soft_limit.tpl.php'));
         // Replace br with new line characters
         $content = str_replace("<br/>", "\n", $content);
         $mail->Body = $content;
         $mail->AddAddress(erConfigClassLhConfig::getInstance()->getSetting('site', 'support_mail'));
         erLhcoreClassChatMail::setupSMTP($mail);
         try {
             $mail->Send();
         } catch (Exception $e) {
         }
         $mail->ClearAddresses();
         // Send mail to instance admin
         $mail = new PHPMailer(true);
         $mail->CharSet = "UTF-8";
         $mail->Subject = erTranslationClassLhTranslation::getInstance()->getTranslation('instance/edit', 'You have reached soft SMS limit');
         $mail->AddReplyTo($this->email, (string) $this->address);
         $tpl = new erLhcoreClassTemplate();
         $tpl->set('instance', $this);
         // Remove new line characters
         $content = str_replace("\n", "", $tpl->fetch('lhinstance/mail/phone_soft_limit_user.tpl.php'));
         // Replace br with new line characters
         $content = str_replace("<br/>", "\n", $content);
         $mail->Body = $content;
         $mail->AddAddress($this->email);
         erLhcoreClassChatMail::setupSMTP($mail);
         try {
             $mail->Send();
         } catch (Exception $e) {
         }
         $mail->ClearAddresses();
     }
     if ($this->hard_limit_in_effect == true && $this->hard_warning_send == 0) {
         $this->hard_warning_send = 1;
         // Send mail to global administrator
         $mail = new PHPMailer(true);
         $mail->CharSet = "UTF-8";
         $mail->Subject = erTranslationClassLhTranslation::getInstance()->getTranslation('instance/edit', 'Instance has reached hard SMS limit') . ' - ' . $this->id;
         $mail->AddReplyTo($this->email, (string) $this->address);
         $tpl = new erLhcoreClassTemplate();
         $tpl->set('instance', $this);
         // Remove new line characters
         $content = str_replace("\n", "", $tpl->fetch('lhinstance/mail/phone_hard_limit.tpl.php'));
         // Replace br with new line characters
         $content = str_replace("<br/>", "\n", $content);
         $mail->Body = $content;
         $mail->AddAddress(erConfigClassLhConfig::getInstance()->getSetting('site', 'support_mail'));
         erLhcoreClassChatMail::setupSMTP($mail);
         try {
             $mail->Send();
         } catch (Exception $e) {
         }
         $mail->ClearAddresses();
         // Send mail to instance admin
         $mail = new PHPMailer(true);
         $mail->CharSet = "UTF-8";
         $mail->Subject = erTranslationClassLhTranslation::getInstance()->getTranslation('instance/edit', 'You have reached hard SMS limit');
         $mail->AddReplyTo($this->email, (string) $this->address);
         $tpl = new erLhcoreClassTemplate();
         $tpl->set('instance', $this);
         // Remove new line characters
         $content = str_replace("\n", "", $tpl->fetch('lhinstance/mail/phone_hard_limit_user.tpl.php'));
         // Replace br with new line characters
         $content = str_replace("<br/>", "\n", $content);
         $mail->Body = $content;
         $mail->AddAddress($this->email);
         erLhcoreClassChatMail::setupSMTP($mail);
         try {
             $mail->Send();
         } catch (Exception $e) {
         }
         $mail->ClearAddresses();
     }
     $this->saveToInstanceThis();
 }
开发者ID:hgeorge123,项目名称:automated-hosting,代码行数:88,代码来源:erlhcoreclassmodelinstance.php


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