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


PHP Phpfox::isPhrase方法代码示例

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


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

示例1: _getSignature

 /**
  * Get signature of site when send email out
  * @param $aUser
  * @return string
  */
 private function _getSignature($aUser)
 {
     $sSignature = Phpfox::getParam('core.mail_signature');
     if (Phpfox::isPhrase($sSignature)) {
         return Phpfox::getPhrase($sSignature, array(), false, null, $aUser['language_id']);
     } else {
         return $sSignature;
     }
 }
开发者ID:lev1976g,项目名称:core,代码行数:14,代码来源:mail.class.php

示例2: get


//.........这里部分代码省略.........
         }
     } else {
         $iCnt = $this->database()->select('COUNT(*)')->from($this->_sTable, 'm')->join(Phpfox::getT('mail_text'), 'mt', 'mt.mail_id = m.mail_id')->leftjoin(Phpfox::getT('user'), 'u', 'u.user_id ' . (!$bIsSentbox ? '= m.owner_user_id' : '= m.viewer_user_id'))->where($aConds)->execute('getSlaveField');
     }
     if ($iCnt) {
         ($sPlugin = Phpfox_Plugin::get('mail.service_mail_get')) ? eval($sPlugin) : false;
         if (Phpfox::getParam('mail.threaded_mail_conversation')) {
             if (!defined('PHPFOX_IS_PRIVATE_MAIL')) {
                 if ($bIsSentbox) {
                     $this->database()->where('th.user_id = ' . (int) Phpfox::getUserId() . ' AND th.is_archive = 0 AND th.is_sent = 1');
                 } else {
                     $this->database()->where('th.user_id = ' . (int) Phpfox::getUserId() . ' AND th.is_archive = ' . (int) $iArchiveId . '');
                 }
             } else {
                 $this->database()->where($aConds);
                 $this->database()->group('th.thread_id');
             }
             if ($bIsTextSearch) {
                 $aRows = $this->database()->select('th.*, mt.text AS preview, mt.time_stamp, mt.user_id AS last_user_id')->from(Phpfox::getT('mail_thread_text'), 'mt')->join(Phpfox::getT('mail_thread_user'), 'th', 'th.user_id = mt.user_id')->join(Phpfox::getT('mail_thread'), 't', 't.thread_id = mt.thread_id')->join(Phpfox::getT('user'), 'u', 'u.user_id = mt.user_id')->limit($iPage, $iLimit, $iCnt)->order('t.time_stamp DESC')->execute('getSlaveRows');
             } else {
                 $aRows = $this->database()->select('th.*, tt.text AS preview, tt.time_stamp, tt.user_id AS last_user_id')->from(Phpfox::getT('mail_thread_user'), 'th')->join(Phpfox::getT('mail_thread'), 't', 't.thread_id = th.thread_id')->join(Phpfox::getT('mail_thread_text'), 'tt', 'tt.message_id = t.last_id')->join(Phpfox::getT('user'), 'u', 'u.user_id = tt.user_id')->limit($iPage, $iLimit, $iCnt)->order('t.time_stamp DESC')->execute('getSlaveRows');
             }
             $aFields = Phpfox::getService('user')->getUserFields();
             foreach ($aRows as $iKey => $aRow) {
                 if (Phpfox::getParam('mail.threaded_mail_conversation')) {
                     $aRows[$iKey]['preview'] = strip_tags($aRow['preview']);
                 }
                 $aRows[$iKey]['viewer_is_new'] = $aRow['is_read'] ? false : true;
                 $aRows[$iKey]['users'] = $this->database()->select('th.is_read, ' . Phpfox::getUserField())->from(Phpfox::getT('mail_thread_user'), 'th')->join(Phpfox::getT('user'), 'u', 'u.user_id = th.user_id')->where('th.thread_id = ' . (int) $aRow['thread_id'])->execute('getSlaveRows');
                 $iUserCnt = 0;
                 foreach ($aRows[$iKey]['users'] as $iUserKey => $aUser) {
                     if (!\Core\Route\Controller::$isApi && !defined('PHPFOX_IS_PRIVATE_MAIL') && $aUser['user_id'] == Phpfox::getUserId()) {
                         unset($aRows[$iKey]['users'][$iUserKey]);
                         continue;
                     }
                     $iUserCnt++;
                     if ($iUserCnt == 1) {
                         foreach ($aFields as $sField) {
                             if ($sField == 'server_id') {
                                 $sField = 'user_server_id';
                             }
                             $aRows[$iKey][$sField] = $aUser[$sField];
                         }
                     }
                     if (!isset($aRows[$iKey]['users_is_read'])) {
                         $aRows[$iKey]['users_is_read'] = array();
                     }
                     if ($aUser['is_read']) {
                         $aRows[$iKey]['users_is_read'][] = $aUser;
                     }
                 }
                 if (!$iUserCnt) {
                     unset($aRows[$iKey]);
                 }
             }
         } else {
             if ($bIsTrash) {
                 $this->database()->select(Phpfox::getUserField('u2', 'other_') . ', ')->join(Phpfox::getT('user'), 'u2', 'u2.user_id = m.viewer_user_id');
             }
             $aRows = $this->database()->select('m.*, ' . Phpfox::getUserField())->from($this->_sTable, 'm')->join(Phpfox::getT('mail_text'), 'mt', 'mt.mail_id = m.mail_id')->leftjoin(Phpfox::getT('user'), 'u', 'u.user_id ' . (!$bIsSentbox ? '= m.owner_user_id' : '= m.viewer_user_id'))->where($aConds)->limit($iPage, $iLimit, $iCnt)->order($sSort)->execute('getSlaveRows');
             if (!$bIsSentbox) {
                 foreach ($aRows as $iKey => $aRow) {
                     if ($aRow['viewer_is_new']) {
                         $aInputs['unread'][] = $aRow['mail_id'];
                     } else {
                         $aInputs['read'][] = $aRow['mail_id'];
                     }
                 }
             }
         }
     }
     //thread name
     if (Phpfox::getParam('mail.threaded_mail_conversation')) {
         foreach ($aRows as $iKey => $aRow) {
             $iCntUser = 0;
             $sThreadName = '';
             $iCut = 0;
             foreach ($aRow['users'] as $aUser) {
                 $sMore = \Phpfox_Parse_Output::instance()->shorten($aUser['full_name'], 30, '...');
                 if (strlen($sThreadName . $sMore) < 45) {
                     $sThreadName .= $sMore;
                     $iCut++;
                 }
                 $iCntUser++;
                 if ($iCntUser == $iCut && count($aRow['users']) > 1) {
                     $sThreadName .= ', ';
                 }
             }
             if ($iCntUser > $iCut) {
                 if (Phpfox::isPhrase('mail.and_number_other')) {
                     $sThreadName .= ' ' . Phpfox::getPhrase('mail.and_number_other', array('number' => $iCntUser - $iCut)) . ($iCntUser - $iCut > 1 ? 's' : '');
                 } else {
                     $sThreadName .= ' and ' . ($iCntUser - $iCut) . ' other' . ($iCntUser - $iCut > 1 ? 's' : '');
                 }
             }
             $aRows[$iKey]['thread_name'] = $sThreadName;
         }
     }
     return array($iCnt, $aRows, $aInputs);
 }
开发者ID:lev1976g,项目名称:core,代码行数:101,代码来源:mail.class.php


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