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


PHP PMF_Utils::resolveMarkers方法代码示例

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


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

示例1: _createHeaders

 /**
  * Create the headers of the email.
  *
  * @return void     
  */
 private function _createHeaders()
 {
     // Cleanup headers
     $this->headers = array();
     // Check if the message consists of just a "plain" single item
     if (false === strpos($this->contentType, 'multipart')) {
         // Content-Disposition: inline
         $this->headers['Content-Disposition'] = $this->contentDisposition;
         // Content-Type
         $this->headers['Content-Type'] = $this->contentType . '; format=flowed; charset="' . $this->charset . '"';
         // Content-Transfer-Encoding: 7bit
         $this->headers['Content-Transfer-Encoding'] = '7bit';
     } else {
         // Content-Type
         $this->headers['Content-Type'] = $this->contentType . '; boundary="' . $this->boundary . '"';
     }
     // Date
     $this->headers['Date'] = self::getDate(self::getTime());
     // Disposition-Notification-To, RFC 3798
     $notifyTos = array();
     foreach ($this->_notifyTo as $address => $name) {
         $notifyTos[] = (empty($name) ? '' : $name . ' ') . '<' . $address . '>';
     }
     $notifyTo = implode(',', $notifyTos);
     if (!empty($notifyTo)) {
         $this->headers['Disposition-Notification-To'] = $notifyTo;
     }
     // From
     foreach ($this->_from as $address => $name) {
         $this->headers['From'] = (empty($name) ? '' : $name . ' ') . '<' . $address . '>';
     }
     // CC
     foreach ($this->_cc as $address => $name) {
         $this->headers['CC'] = (empty($name) ? '' : $name . ' ') . '<' . $address . '>';
     }
     // BCC
     foreach ($this->_bcc as $address => $name) {
         $this->headers['BCC'] = (empty($name) ? '' : $name . ' ') . '<' . $address . '>';
     }
     // Message-Id
     $this->headers['Message-ID'] = $this->messageId;
     // MIME-Version: 1.0
     $this->headers['MIME-Version'] = '1.0';
     // Reply-To
     $this->headers['Reply-To'] = $this->headers['From'];
     foreach ($this->_replyTo as $address => $name) {
         $this->headers['Reply-To'] = (empty($name) ? '' : $name . ' ') . '<' . $address . '>';
     }
     // Return-Path
     foreach ($this->_from as $address => $name) {
         $this->headers['Return-Path'] = '<' . $address . '>';
     }
     foreach ($this->_returnPath as $address => $name) {
         $this->headers['Return-Path'] = '<' . $address . '>';
     }
     // Sender
     $this->headers['Sender'] = $this->headers['From'];
     foreach ($this->_sender as $address => $name) {
         $this->headers['Sender'] = (empty($name) ? '' : $name . ' ') . '<' . $address . '>';
     }
     // Subject. Note: it must be RFC 2047 compliant
     // TODO: wrap mb_encode_mimeheader() to add other content encodings
     $this->headers['Subject'] = PMF_Utils::resolveMarkers(html_entity_decode($this->subject, ENT_COMPAT, 'UTF-8'), $this->_config);
     // X-Mailer
     $this->headers['X-Mailer'] = $this->_mailer;
     // X-MSMail-Priority
     if (isset($this->priorities[(int) $this->priority])) {
         $this->headers['X-MSMail-Priority'] = $this->priorities[(int) $this->priority];
     }
     // X-Originating-IP
     if (isset($_SERVER['REMOTE_ADDR'])) {
         $this->headers['X-Originating-IP'] = $_SERVER['REMOTE_ADDR'];
     }
     // X-Priority
     $this->headers['X-Priority'] = $this->priority;
 }
开发者ID:kapljr,项目名称:Jay-Kaplan-Farmingdale-BCS-Projects,代码行数:81,代码来源:Mail.php

示例2: array

     // Create user account (login and password)
     // Note: password be automatically generated
     //       and sent by email as soon if admin switch user to "active"
     if (!$user->createUser($user_name, '')) {
         $messages[] = $user->error();
     } else {
         // set user data (realname, email)
         $user->userdata->set(array('display_name', 'email'), array($user_realname, $user_email));
         // set user status
         $user->setStatus($defaultUserStatus);
         $text = sprintf("New user has been registrated:\n\nUsername: %s\nLoginname: %s\n\n" . "To activate this user do please use the administration interface.", $lastname, $loginname);
         $mail = new PMF_Mail();
         $mail->unsetFrom();
         $mail->setFrom($user_email);
         $mail->addTo($faqconfig->get('main.administrationMail'));
         $mail->subject = PMF_Utils::resolveMarkers($PMF_LANG['emailRegSubject']);
         $mail->message = $text;
         $result = $mail->send();
         unset($mail);
         header("Location: index.php?action=thankyou");
         exit;
     }
 }
 // no errors, show list
 if (count($messages) == 0) {
     $userAction = $defaultUserAction;
     // display error messages and show form again
 } else {
     $tpl->processTemplate('writeContent', array('regErrors' => sprintf("<strong>%s</strong> <br /> - %s <br /><br />", $PMF_LANG['msgRegError'], implode("<br />- ", $messages)), 'msgUserData' => $PMF_LANG['msgUserData'], 'login_errorRegistration' => !is_null($loginname) ? $PMF_LANG['errorRegistration'] : '', 'name_errorRegistration' => !is_null($lastname) ? $PMF_LANG['errorRegistration'] : '', 'email_errorRegistration' => !is_null($email) ? $PMF_LANG['errorRegistration'] : '', 'loginname' => $PMF_LANG["ad_user_loginname"], 'lastname' => $PMF_LANG["ad_user_realname"], 'email' => $PMF_LANG["ad_entry_email"], 'loginname_value' => $loginname, 'lastname_value' => $lastname, 'email_value' => $email, 'submitRegister' => $PMF_LANG['submitRegister'], 'captchaFieldset' => printCaptchaFieldset($PMF_LANG['msgCaptcha'], $captcha->printCaptcha('add'), $captcha->caplength, isset($captchaError) ? $captchaError : '')));
     $tpl->includeTemplate('writeContent', 'index');
 }
开发者ID:noon,项目名称:phpMyFAQ,代码行数:31,代码来源:register.php

示例3: PMF_User

     if (!is_null($loginname) && !empty($loginname) && !is_null($email) && !empty($email) && !is_null($realname) && !empty($realname)) {
         $message = [];
         $user = new PMF_User($faqConfig);
         // Create user account (login and password)
         // Note: password be automatically generated and sent by email as soon if admin switch user to "active"
         if (!$user->createUser($loginname, '')) {
             $message = array('error' => $user->error());
         } else {
             $user->userdata->set(array('display_name', 'email'), array($realname, $email));
             // set user status
             $user->setStatus('blocked');
             $text = sprintf("New user has been registrated:\n\nName: %s\nLogin name: %s\n\n" . "To activate this user do please use the administration interface at %s.", $realname, $loginname, $faqConfig->get('main.referenceURL'));
             $mail = new PMF_Mail($faqConfig);
             $mail->setReplyTo($email, $realname);
             $mail->addTo($faqConfig->get('main.administrationMail'));
             $mail->subject = PMF_Utils::resolveMarkers($PMF_LANG['emailRegSubject'], $faqConfig);
             $mail->message = $text;
             $result = $mail->send();
             unset($mail);
             $message = array('success' => trim($PMF_LANG['successMessage']) . ' ' . trim($PMF_LANG['msgRegThankYou']));
         }
     } else {
         $message = array('error' => $PMF_LANG['err_sendMail']);
     }
     break;
 case 'savevoting':
     $faq = new PMF_Faq($faqConfig);
     $type = PMF_Filter::filterInput(INPUT_POST, 'type', FILTER_SANITIZE_STRING, 'faq');
     $recordId = PMF_Filter::filterInput(INPUT_POST, 'id', FILTER_VALIDATE_INT, 0);
     $vote = PMF_Filter::filterInput(INPUT_POST, 'vote', FILTER_VALIDATE_INT);
     $userIp = PMF_Filter::filterVar($_SERVER['REMOTE_ADDR'], FILTER_VALIDATE_IP);
开发者ID:ae120,项目名称:phpMyFAQ,代码行数:31,代码来源:ajaxservice.php


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