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


PHP getLocaleFormat函数代码示例

本文整理汇总了PHP中getLocaleFormat函数的典型用法代码示例。如果您正苦于以下问题:PHP getLocaleFormat函数的具体用法?PHP getLocaleFormat怎么用?PHP getLocaleFormat使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: init

 function init(&$oDb)
 {
     parent::init($oDb);
     $sUri = $this->getUri();
     $sName = 'bx_' . $sUri;
     $this->_bAutoapprove = $this->_oDb->getParam('news_autoapprove') == 'on';
     $this->_bComments = $this->_oDb->getParam('news_comments') == 'on';
     $this->_sCommentsSystemName = $sName;
     $this->_bVotes = $this->_oDb->getParam('news_votes') == 'on';
     $this->_sVotesSystemName = $sName;
     $this->_sViewsSystemName = $sName;
     $this->_sSubscriptionsSystemName = $sName;
     $this->_sActionsViewSystemName = $sName;
     $this->_sCategoriesSystemName = $sName;
     $this->_sTagsSystemName = $sName;
     $this->_sAlertsSystemName = $sName;
     $this->_sSearchSystemName = $sName;
     $this->_sDateFormat = getLocaleFormat(BX_DOL_LOCALE_DATE_SHORT, BX_DOL_LOCALE_DB);
     $this->_sAnimationEffect = 'fade';
     $this->_iAnimationSpeed = 'slow';
     $this->_iIndexNumber = (int) $this->_oDb->getParam('news_index_number');
     $this->_iMemberNumber = (int) $this->_oDb->getParam('news_member_number');
     $this->_iSnippetLength = 1000;
     $this->_iPerPage = (int) $this->_oDb->getParam('news_per_page');
     $this->_sSystemPrefix = 'news';
     $this->_aJsClasses = array('main' => 'BxNewsMain');
     $this->_aJsObjects = array('main' => 'oNewsMain');
     $this->_iRssLength = (int) $this->_oDb->getParam('news_rss_length');
 }
开发者ID:Gotgot59,项目名称:dolphin.pro,代码行数:29,代码来源:BxNewsConfig.php

示例2: BxSimpleMessengerConfig

 /**
  * Class constructor;
  */
 function BxSimpleMessengerConfig($aModule)
 {
     parent::BxDolConfig($aModule);
     // define the tables prefix ;
     $this->sTablePrefix = $this->getDbPrefix();
     // time (in seconds) script checks for messages ;
     $this->iUpdateTime = getParam('simple_messenger_update_time');
     // number of visible messages into chat box ;
     $this->iVisibleMessages = getParam('simple_messenger_visible_messages');
     // limit of returning messages in message box;
     $this->iCountRetMessages = 10;
     // flashing signals amount of the non-active window ;
     $this->iBlinkCounter = getParam('simple_messenger_blink_counter');
     // save messenger's chat history ;
     $this->bSaveChatHistory = false;
     // allow to procces some smiles code;
     $this->bProccesSmiles = getParam('simple_messenger_procces_smiles');
     // contains block's id where the list of messages will be generated ;
     $this->sOutputBlock = 'extra_area';
     // contain history block's prefix (need for defines the last message);
     $this->sOutputBlockPrefix = 'messages_history_';
     // number of allowed chat boxes;
     $this->iCountAllowedChatBoxes = getParam('simple_messenger_allowed_chatbox');
     $this->sMessageDateFormat = getLocaleFormat(BX_DOL_LOCALE_DATE, BX_DOL_LOCALE_DB);
 }
开发者ID:noormcs,项目名称:studoro,代码行数:28,代码来源:BxSimpleMessengerConfig.php

示例3: BxWallConfig

 /**
  * Constructor
  */
 function BxWallConfig($aModule)
 {
     parent::BxDolConfig($aModule);
     $this->_bFullCompilation = false;
     $this->_sAlertSystemName = "bx_wall";
     $this->_sCommonPostPrefix = 'wall_common_';
     $this->_sCommentSystemName = "bx_wall";
     $this->_sAnimationEffect = 'fade';
     $this->_iAnimationSpeed = 'slow';
     $this->_sDividerDateFormat = getLocaleFormat(BX_DOL_LOCALE_DATE_SHORT, BX_DOL_LOCALE_DB);
 }
开发者ID:dalinhuang,项目名称:shopexts,代码行数:14,代码来源:BxWallConfig.php

示例4: BxPmtConfig

 /**
  * Constructor
  */
 function BxPmtConfig($aModule)
 {
     parent::BxDolConfig($aModule);
     $this->_iAdminId = BX_PMT_ADMINISTRATOR_ID;
     $this->_sAdminUsername = BX_PMT_ADMINISTRATOR_USERNAME;
     $this->_sJsObjectCart = 'oPmtCart';
     $this->_sJsObjectOrders = 'oPmtOrders';
     $this->_sReturnUrl = BX_DOL_URL_ROOT . $this->getBaseUri() . 'cart/';
     $this->_sDataReturnUrl = BX_DOL_URL_ROOT . $this->getBaseUri() . 'act_finalize_checkout/';
     $this->_iOrdersPerPage = 10;
     $this->_iHistoryPerPage = 10;
     $this->_sDateFormatOrders = getLocaleFormat(BX_DOL_LOCALE_DATE_SHORT, BX_DOL_LOCALE_DB);
 }
开发者ID:noormcs,项目名称:studoro,代码行数:16,代码来源:BxPmtConfig.php

示例5: BxWallConfig

 /**
  * Constructor
  */
 function BxWallConfig($aModule)
 {
     parent::BxDolConfig($aModule);
     $this->_bJsMode = false;
     $this->_sAlertSystemName = "bx_wall";
     $this->_sCommonPostPrefix = 'wall_common_';
     $this->_sCommentSystemName = "bx_wall";
     $this->_sAnimationEffect = 'fade';
     $this->_iAnimationSpeed = 'slow';
     $this->_sDividerDateFormat = getLocaleFormat(BX_DOL_LOCALE_DATE_SHORT, BX_DOL_LOCALE_DB);
     $this->_aHideTimeline = array();
     $this->_aHideOutline = array();
     $this->_aHandlers = array();
     $this->_aJsObjects = array('post' => 'oWallPost', 'view' => 'oWallView', 'outline' => 'oWallOutline');
 }
开发者ID:noormcs,项目名称:studoro,代码行数:18,代码来源:BxWallConfig.php

示例6: __construct

 /**
  * Constructor
  */
 function __construct($aModule)
 {
     parent::__construct($aModule);
     $this->_iAdminId = BX_PMT_ADMINISTRATOR_ID;
     $this->_sAdminUsername = BX_PMT_ADMINISTRATOR_USERNAME;
     $this->_sJoinUrl = $this->getBaseUri() . 'join/';
     $this->_sReturnUrl = $this->getBaseUri() . 'cart/';
     $this->_sDataReturnUrl = $this->getBaseUri() . 'act_finalize_checkout/';
     $this->_iOrdersPerPage = 10;
     $this->_iHistoryPerPage = 10;
     $this->_sDateFormatOrders = getLocaleFormat(BX_DOL_LOCALE_DATE_SHORT, BX_DOL_LOCALE_DB);
     $this->_sAnimationEffect = 'fade';
     $this->_iAnimationSpeed = 'slow';
     $this->_aPrefixes = array('general' => 'bx_pmt_', 'langs' => '_payment_', 'options' => 'pmt_');
     $this->_aJsClasses = array('cart' => 'BxPmtCart', 'orders' => 'BxPmtOrders');
     $this->_aJsObjects = array('cart' => 'oPmtCart', 'orders' => 'oPmtOrders');
     $this->_sOptionsCategory = 'Payment';
 }
开发者ID:Prashank25,项目名称:dolphin.pro,代码行数:21,代码来源:BxPmtConfig.php

示例7: init

 function init(&$oDb)
 {
     parent::init($oDb);
     $this->_bAutoapprove = $this->_oDb->getParam('feedback_autoapprove') == 'on';
     $this->_bComments = $this->_oDb->getParam('feedback_comments') == 'on';
     $this->_sCommentsSystemName = "bx_feedback";
     $this->_bVotes = $this->_oDb->getParam('feedback_votes') == 'on';
     $this->_sVotesSystemName = "bx_feedback";
     $this->_sDateFormat = getLocaleFormat(BX_DOL_LOCALE_DATE_SHORT, BX_DOL_LOCALE_DB);
     $this->_sAnimationEffect = 'fade';
     $this->_iAnimationSpeed = 'slow';
     $this->_iIndexNumber = (int) $this->_oDb->getParam('feedback_index_number');
     $this->_iSnippetLength = (int) $this->_oDb->getParam('feedback_snippet_length');
     $this->_iPerPage = (int) $this->_oDb->getParam('feedback_per_page');
     $this->_sSystemPrefix = 'feedback';
     $this->_aJsClasses = array('main' => 'BxFeedbackMain');
     $this->_aJsObjects = array('main' => 'oFeedbackMain');
     $this->_iRssLength = (int) $this->_oDb->getParam('feedback_rss_length');
 }
开发者ID:dalinhuang,项目名称:shopexts,代码行数:19,代码来源:BxFdbConfig.php

示例8: BxWallConfig

 function BxWallConfig($aModule)
 {
     parent::BxDolConfig($aModule);
     $sName = 'bx_wall';
     $this->_bJsMode = false;
     $this->_sAlertSystemName = $sName;
     $this->_sCommentSystemName = $sName;
     $this->_sVotingSystemName = $sName;
     $this->_aRepostDefaults = array('show_do_repost_as_button' => false, 'show_do_repost_as_button_small' => false, 'show_do_repost_icon' => false, 'show_do_repost_label' => true, 'show_counter' => true);
     $this->_sCommonPostPrefix = 'wall_common_';
     $this->_aPrefixes = array('style' => 'wall', 'language' => '_wall', 'option' => 'wall_', 'common_post' => $this->_sCommonPostPrefix);
     $this->_sAnimationEffect = 'fade';
     $this->_iAnimationSpeed = 'slow';
     $this->_sDividerDateFormat = getLocaleFormat(BX_DOL_LOCALE_DATE_SHORT, BX_DOL_LOCALE_DB);
     $this->_aHideTimeline = array();
     $this->_aHideOutline = array();
     $this->_aHandlers = array();
     $this->_aJsClasses = array('post' => 'BxWallPost', 'repost' => 'BxWallRepost', 'view' => 'BxWallView', 'outline' => 'BxWallOutline');
     $this->_aJsObjects = array('post' => 'oWallPost', 'repost' => 'oWallRepost', 'view' => 'oWallView', 'outline' => 'oWallOutline', 'voting' => 'oWallVoting');
     $sHtmlPrefix = str_replace('_', '-', $sName);
     $this->_aHtmlIds = array('repost' => array('main' => $sHtmlPrefix . '-repost-', 'counter' => $sHtmlPrefix . '-repost-counter-', 'by_popup' => $sHtmlPrefix . '-repost-by-'));
 }
开发者ID:Gotgot59,项目名称:dolphin.pro,代码行数:22,代码来源:BxWallConfig.php

示例9: getLocaleDate

/**
 * Convert date(timestamp) in accordance with requested format code.
 *
 * @param string $sTimestamp - timestamp
 * @param integer $iCode - format code
 *                  1(4) - short date format. @see sys_options -> short_date_format_php
 *                  2 - time format. @see sys_options -> time_format_php
 *                  3(5) - long date format. @see sys_options -> date_format_php
 *                  6 - RFC 2822 date format.
 */
function getLocaleDate($sTimestamp = '', $iCode = BX_DOL_LOCALE_DATE_SHORT)
{
    $sFormat = (int) $iCode == 6 ? 'r' : getLocaleFormat($iCode);
    return date($sFormat, $sTimestamp);
}
开发者ID:blas-dmx,项目名称:dolphin.pro,代码行数:15,代码来源:utils.inc.php

示例10: array

 * Overwrite necessary variables or add new in this file
 *
 *******************************************************************************/
global $gConf;
$dir = array();
$aPathInfo = pathinfo(__FILE__);
require_once $aPathInfo['dirname'] . '/../../../../../inc/header.inc.php';
$path = BX_DIRECTORY_PATH_ROOT . 'modules/boonex/forum/';
// path to orca files
/**
 * forum tweaks
 */
require_once BX_DIRECTORY_PATH_INC . 'db.inc.php';
require_once BX_DIRECTORY_PATH_INC . 'design.inc.php';
require_once BX_DIRECTORY_PATH_INC . 'profiles.inc.php';
$gConf['date_format'] = getLocaleFormat(BX_DOL_LOCALE_DATE, BX_DOL_LOCALE_DB);
// time/date format
/**
 * directories configuration
 */
$gConf['dir']['error_log'] = $path . 'log/orca.error.log';
// error log file path
$gConf['dir']['classes'] = $path . 'classes/';
// classes directiry path
$gConf['dir']['js'] = $path . 'js/';
// js directiry path
$gConf['dir']['inc'] = $path . 'inc/';
// include files path
$gConf['dir']['xmlcache'] = $path . 'xml/';
// not used
$gConf['dir']['xml'] = $path . 'integrations/' . BX_ORCA_INTEGRATION . '/';
开发者ID:dalinhuang,项目名称:shopexts,代码行数:31,代码来源:config.php

示例11: filterDateUTC

 function filterDateUTC($sTimestamp)
 {
     return gmdate(getLocaleFormat(BX_DOL_LOCALE_DATE), $sTimestamp);
 }
开发者ID:gorenc,项目名称:dolphin.pro,代码行数:4,代码来源:BxEventsTemplate.php

示例12: getMembers

function getMembers($aParams)
{
    if (!isset($aParams['view_start']) || empty($aParams['view_start'])) {
        $aParams['view_start'] = 0;
    }
    if (!isset($aParams['view_per_page']) || empty($aParams['view_per_page'])) {
        $aParams['view_per_page'] = BX_DOL_ADM_MP_PER_PAGE;
    }
    $aParams['view_order_way'] = 'ASC';
    if (!isset($aParams['view_order']) || empty($aParams['view_order'])) {
        $aParams['view_order'] = 'ID';
    } else {
        $aOrder = explode(' ', $aParams['view_order']);
        if (count($aOrder) > 1) {
            $aParams['view_order'] = $aOrder[0];
            $aParams['view_order_way'] = $aOrder[1];
        }
    }
    $sDateFormat = getLocaleFormat(BX_DOL_LOCALE_DATE, BX_DOL_LOCALE_DB);
    $sSelectClause = $sJoinClause = $sWhereClause = $sGroupClause = '';
    switch ($aParams['ctl_type']) {
        case 'qlinks':
            switch ($aParams['ctl_params']['by']) {
                case 'status':
                    $sWhereClause .= " AND `tp`.`Status`='" . ucfirst($aParams['ctl_params']['value']) . "'";
                    break;
                case 'featured':
                    $sWhereClause .= " AND `tp`.`Featured`='1'";
                    break;
                case 'banned':
                    $sWhereClause .= " AND (`tbl`.`Time`='0' OR (`tbl`.`Time`<>'0' AND DATE_ADD(`tbl`.`DateTime`, INTERVAL `tbl`.`Time` HOUR)>NOW()))";
                    break;
                case 'type':
                    $sWhereClause .= $aParams['ctl_params']['value'] == 'single' ? " AND `tp`.`Couple`='0'" : " AND `tp`.`Couple`<>'0' AND `tp`.`Couple`>`tp`.`ID`";
                    break;
                case 'role':
                    $iRole = BX_DOL_ROLE_MEMBER;
                    if ($aParams['ctl_params']['value'] == 'admins') {
                        $iRole = BX_DOL_ROLE_ADMIN;
                    }
                    $sWhereClause .= " AND `tp`.`Role` & " . $iRole . "";
                    break;
                case 'sex':
                    $sWhereClause .= " AND LOWER(`tp`.`Sex`)='" . strtolower($aParams['ctl_params']['value']) . "'";
                    break;
                case 'membership':
                    $sWhereClause .= " AND LOWER(`tl`.`Name`)='" . strtolower($aParams['ctl_params']['value']) . "'";
                    break;
            }
            break;
        case 'tags':
            $sWhereClause .= " AND `tp`.`Tags` LIKE '%" . $aParams['ctl_params']['value'] . "%'";
            break;
        case 'search':
            $sWhereClause .= " AND (\r\n            \t`tp`.`ID` LIKE '%" . $aParams['ctl_params']['value'] . "%' OR\r\n                `tp`.`NickName` LIKE '%" . $aParams['ctl_params']['value'] . "%' OR \r\n                `tp`.`Email` LIKE '%" . $aParams['ctl_params']['value'] . "%' OR \r\n                `tp`.`Headline` LIKE '%" . $aParams['ctl_params']['value'] . "%' OR \r\n                `tp`.`DescriptionMe` LIKE '%" . $aParams['ctl_params']['value'] . "%' OR \r\n                `tp`.`Tags` LIKE '%" . $aParams['ctl_params']['value'] . "%' OR \r\n                `tp`.`DateReg` LIKE '%" . $aParams['ctl_params']['value'] . "%' OR \r\n                `tp`.`DateLastLogin` LIKE '%" . $aParams['ctl_params']['value'] . "%'\r\n            )";
            break;
    }
    //--- Get Paginate ---//
    $oPaginate = new BxDolPaginate(array('start' => $aParams['view_start'], 'count' => (int) db_value("SELECT COUNT(`tp`.`ID`) FROM `Profiles` AS `tp` LEFT JOIN `sys_admin_ban_list` AS `tbl` ON `tp`.`ID`=`tbl`.`ProfID` LEFT JOIN `sys_acl_levels_members` AS `tlm` ON `tp`.`ID`=`tlm`.`IDMember` AND `tlm`.`DateStarts` < NOW() AND (`tlm`.`DateExpires`>NOW() || ISNULL(`tlm`.`DateExpires`)) LEFT JOIN `sys_acl_levels` AS `tl` ON `tlm`.`IDLevel`=`tl`.`ID` " . $sJoinClause . " WHERE 1 AND (`tp`.`Couple`=0 OR `tp`.`Couple`>`tp`.`ID`)" . $sWhereClause), 'per_page' => $aParams['view_per_page'], 'page_url' => $GLOBALS['site']['url_admin'] . 'profiles.php?start={start}', 'on_change_page' => BX_DOL_ADM_MP_JS_NAME . '.changePage({start})'));
    $sPaginate = $oPaginate->getPaginate();
    //--- Get Items ---//
    $sQuery = "\r\n    \tSELECT\r\n    \t\t`tp`.`ID` as `id`,\r\n    \t\t`tp`.`NickName` AS `username`,\r\n    \t\t`tp`.`Headline` AS `headline`,\r\n    \t\t`tp`.`Sex` AS `sex`,\r\n    \t\t`tp`.`DateOfBirth` AS `date_of_birth`,\r\n    \t\t`tp`.`Country` AS `country`,\r\n    \t\t`tp`.`City` AS `city`,\r\n    \t\t`tp`.`DescriptionMe` AS `description`,\r\n    \t\t`tp`.`Email` AS `email`,\r\n    \t\tDATE_FORMAT(`tp`.`DateReg`,  '" . $sDateFormat . "' ) AS `registration`,\r\n    \t\tDATE_FORMAT(`tp`.`DateLastLogin`,  '" . $sDateFormat . "' ) AS `last_login`,\r\n    \t\t`tp`.`Status` AS `status`,\r\n    \t\tIF(`tbl`.`Time`='0' OR DATE_ADD(`tbl`.`DateTime`, INTERVAL `tbl`.`Time` HOUR)>NOW(), 1, 0) AS `banned`, \r\n    \t\t`tl`.`ID` AS `ml_id`, \r\n    \t\tIF(ISNULL(`tl`.`Name`),'', `tl`.`Name`) AS `ml_name`\r\n    \t\t" . $sSelectClause . "\r\n    \tFROM `Profiles` AS `tp` \r\n        LEFT JOIN `sys_admin_ban_list` AS `tbl` ON `tp`.`ID`=`tbl`.`ProfID`\r\n        LEFT JOIN `sys_acl_levels_members` AS `tlm` ON `tp`.`ID`=`tlm`.`IDMember` AND `tlm`.`DateStarts` < NOW() AND (`tlm`.`DateExpires`>NOW() || ISNULL(`tlm`.`DateExpires`))  \r\n        LEFT JOIN `sys_acl_levels` AS `tl` ON `tlm`.`IDLevel`=`tl`.`ID` \r\n    \t" . $sJoinClause . "\r\n    \tWHERE\r\n    \t\t1 AND (`tp`.`Couple`=0 OR `tp`.`Couple`>`tp`.`ID`)" . $sWhereClause . "\r\n    \t" . $sGroupClause . "\r\n    \tORDER BY `tp`.`" . $aParams['view_order'] . "` " . $aParams['view_order_way'] . "\r\n    \tLIMIT " . $aParams['view_start'] . ", " . $aParams['view_per_page'];
    $aProfiles = $GLOBALS['MySQL']->getAll($sQuery);
    //--- Display ---//
    $sFunction = 'getMembers' . ucfirst($aParams['view_type']);
    return $sFunction($aProfiles, $sPaginate);
}
开发者ID:dalinhuang,项目名称:shopexts,代码行数:67,代码来源:profiles.php

示例13: getBlockCode_ViewMessage

 /**
  * Function will generate the view message block ;
  *
  * @return   : Html presentation data ;
  */
 function getBlockCode_ViewMessage()
 {
     global $oSysTemplate;
     global $oFunctions;
     global $site;
     global $oTemplConfig;
     // init some needed variables;
     $sOutputHtml = null;
     $sActionsList = null;
     // generate page toggle ellements ;
     $aToggleItems = array('inbox' => _t('_Inbox'), 'outbox' => _t('_Outbox'), 'trash' => _t('_Trash'), 'compose' => _t('_Compose'));
     $sRequest = 'mail.php' . '?';
     foreach ($aToggleItems as $sKey => $sValue) {
         $aTopToggleEllements[$sValue] = array('href' => $sRequest . '&mode=' . $sKey, 'dynamic' => false, 'active' => false);
     }
     // language keys ;
     $aLanguageKeys = array('back_inbox' => _t('_Back') . ' ' . _t('_to') . ' ' . _t('_Inbox'), 'back_outbox' => _t('_Back') . ' ' . _t('_to') . ' ' . _t('_Outbox'), 'back_trash' => _t('_Back') . ' ' . _t('_to') . ' ' . _t('_Trash'), 'spam_message' => _t('_Report'), 'delete_message' => _t('_Delete'), 'reply_message' => _t('_Reply'), 'restore_message' => _t('_Restore'), 'are_you_sure' => _t('_Are you sure?'), 'more' => _t('_More actions'), 'mark_read' => _t('_Mark as old'), 'mark_unread' => _t('_Mark as New'));
     $sQuery = "\n                SELECT\n                    *,\n                    DATE_FORMAT(`Date`, '" . getLocaleFormat(BX_DOL_LOCALE_DATE, BX_DOL_LOCALE_DB) . "') AS `Date`\n                FROM\n                    `sys_messages`\n                WHERE\n                    `ID` = {$this->aMailBoxSettings['messageID']}\n                AND\n                    (\n                        `Sender` = {$this->aMailBoxSettings['member_id']}\n                            OR\n                        `Recipient` = {$this->aMailBoxSettings['member_id']}\n                    )\n            ";
     $rResult = db_res($sQuery);
     while (true == ($aRow = mysql_fetch_assoc($rResult))) {
         // ** generate member's information ;
         $sMemberIcon = get_member_thumbnail($aRow['Sender'], 'none');
         $aMemberInfo = getProfileInfo($aRow['Sender']);
         // define the back link;
         if ($aRow['Trash'] == 'recipient') {
             $sBackCaption = $aLanguageKeys['back_trash'];
             $sBackUrl = 'mail.php' . '?mode=trash';
         } else {
             if ($aRow['Sender'] == $this->aMailBoxSettings['member_id']) {
                 $sBackCaption = $aLanguageKeys['back_outbox'];
                 $sBackUrl = 'mail.php' . '?mode=outbox';
             } else {
                 $sBackCaption = $aLanguageKeys['back_inbox'];
                 $sBackUrl = 'mail.php' . '?mode=inbox';
             }
         }
         $sMemberNickName = getNickName($aMemberInfo['ID']);
         $sMemberLocation = getProfileLink($aMemberInfo['ID']);
         $sMemberSexImage = isset($aMemberInfo['Sex']) ? $oFunctions->genSexIcon($aMemberInfo['Sex']) : null;
         $sMemberAge = isset($aMemberInfo['DateOfBirth']) && $aMemberInfo['DateOfBirth'] != "0000-00-00" ? _t("_y/o", age($aMemberInfo['DateOfBirth'])) : null;
         $sMemberCountry = isset($aMemberInfo['Country']) && $aMemberInfo['Country'] ? $aMemberInfo['Country'] : null;
         $sMemberFlag = $sMemberCountry ? $site['flags'] . strtolower($sMemberCountry) . $this->sMembersFlagExtension : null;
         if ($sMemberCountry) {
             $sMemberCountryFlag = '<img src="' . $sMemberFlag . '" alt="' . $sMemberCountry . '" />';
         }
         $sCity = isset($aMemberInfo['City']) && $aMemberInfo['City'] ? $aMemberInfo['City'] . ', ' : null;
         // member's city and country;
         $sMemberCountry = $sCity . $sMemberCountry;
         // generate the member's actions list;
         if ($aRow['Sender'] != $this->aMailBoxSettings['member_id']) {
             // prepare all needed keywords ;
             $aMemberInfo['anonym_mode'] = $oTemplConfig->bAnonymousMode;
             $aMemberInfo['member_pass'] = $aMemberInfo['Password'];
             $aMemberInfo['member_id'] = $aMemberInfo['ID'];
             $aMemberInfo['url'] = BX_DOL_URL_ROOT;
             //--- Subscription integration ---//
             $oSubscription = new BxDolSubscription();
             $sAddon = $oSubscription->getData();
             $aButton = $oSubscription->getButton((int) $this->aMailBoxSettings['member_id'], 'profile', '', (int) $aRow['Sender']);
             $aMemberInfo['sbs_profile_title'] = $aButton['title'];
             $aMemberInfo['sbs_profile_script'] = $aButton['script'];
             //--- Subscription integration ---//
             $aMemberInfo['cpt_edit'] = '';
             $aMemberInfo['cpt_send_letter'] = _t('_SendLetter');
             $aMemberInfo['cpt_remove_friend'] = _t('_Remove friend');
             $aMemberInfo['cpt_fave'] = _t('_Fave');
             $aMemberInfo['cpt_remove_fave'] = _t('_Remove Fave');
             $aMemberInfo['cpt_befriend'] = _t('_Befriend');
             $aMemberInfo['cpt_greet'] = _t('_Greet');
             $aMemberInfo['cpt_get_mail'] = _t('_Get E-mail');
             $aMemberInfo['cpt_share'] = _t('_Share');
             $aMemberInfo['cpt_report'] = _t('_Report');
             $aMemberInfo['cpt_block'] = _t('_Block');
             $aMemberInfo['cpt_unblock'] = _t('_Unblock');
             $aMemberInfo['member_id'] = $this->aMailBoxSettings['member_id'];
             $sActionsList = $sAddon . $oFunctions->genObjectsActions($aMemberInfo, 'Profile');
         }
         // try to define the message status ;
         if ($aRow['Sender'] == $this->aMailBoxSettings['member_id']) {
             if (strstr($aRow['Trash'], 'sender')) {
                 $this->aMailBoxSettings['mailbox_mode'] = 'trash';
             } else {
                 $this->aMailBoxSettings['mailbox_mode'] = 'outbox';
             }
             $sRelocateParameter = 'outbox';
         } else {
             if ($aRow['Sender'] != $this->aMailBoxSettings['member_id']) {
                 if (strstr($aRow['Trash'], 'recipient')) {
                     $this->aMailBoxSettings['mailbox_mode'] = 'trash';
                 } else {
                     $this->aMailBoxSettings['mailbox_mode'] = 'inbox';
                 }
                 $sRelocateParameter = 'inbox';
             }
         }
//.........这里部分代码省略.........
开发者ID:noormcs,项目名称:studoro,代码行数:101,代码来源:BxBaseMailBox.php

示例14: getMessages

 /**
  * Function will get array with messages ;
  *
  * @return   : hash array with messages ;
  */
 function getMessages()
 {
     // init some needed variables ;
     $sWhereParameter = null;
     $sTypeMessages = null;
     // define the sort parameter ;
     $sSortParameter = array_key_exists($this->aMailBoxSettings['sort_mode'], $this->aSortCriterias) ? $this->aSortCriterias[$this->aMailBoxSettings['sort_mode']] : $this->aSortCriterias['date_desc'];
     // define mailbox mode ;
     switch ($this->aMailBoxSettings['mailbox_mode']) {
         case 'inbox':
             $sWhereParameter = " AND `sys_messages`.`Recipient` = {$this->aMailBoxSettings['member_id']} AND NOT FIND_IN_SET('Recipient', `sys_messages`.`Trash`) ";
             break;
         case 'inbox_new':
             $sWhereParameter = " AND `sys_messages`.`Recipient`={$this->aMailBoxSettings['member_id']} AND NOT FIND_IN_SET('Recipient', `sys_messages`.`Trash`) AND `New`='1' ";
             break;
         case 'outbox':
             $sWhereParameter = " AND `sys_messages`.`Sender` = {$this->aMailBoxSettings['member_id']} AND NOT FIND_IN_SET('Sender', `sys_messages`.`Trash`)";
             break;
         case 'trash':
             $sWhereParameter = "\n                              AND\n                              (\n                                   (\n                                        `sys_messages`.`Sender` = {$this->aMailBoxSettings['member_id']}\n                                             AND\n                                        FIND_IN_SET('Sender', `sys_messages`.`Trash`)\n                                   )\n                                   OR\n                                   (\n                                        `sys_messages`.`Recipient` = {$this->aMailBoxSettings['member_id']}\n                                             AND\n                                        FIND_IN_SET('Recipient', `sys_messages`.`Trash`)\n                                   )\n                              )\n                              AND\n                              (\n                                    (\n                                        `sys_messages`.`Sender` = {$this->aMailBoxSettings['member_id']}\n                                             AND\n                                        NOT FIND_IN_SET('Sender', `sys_messages`.`TrashNotView`)\n                                   )\n                                   OR\n                                   (\n                                        `sys_messages`.`Recipient` = {$this->aMailBoxSettings['member_id']}\n                                             AND\n                                        NOT FIND_IN_SET('Recipient', `sys_messages`.`TrashNotView`)\n                                   )\n                              )\n                         ";
             break;
     }
     // define messages types
     if (is_array($this->aReceivedMessagesTypes) and !empty($this->aReceivedMessagesTypes)) {
         foreach ($this->aReceivedMessagesTypes as $sKey) {
             if ($sKey) {
                 $sTypeMessages .= "`sys_messages`.`Type` = '{$sKey}' OR";
             }
         }
         $sTypeMessages = 'AND (' . preg_replace("/OR\$/", '', $sTypeMessages) . ')';
     } else {
         return;
     }
     // if defined all needed parameters ;
     if ($sWhereParameter) {
         // count of all messages ;
         $this->iTotalMessageCount = db_value("\n                         SELECT\n                              COUNT(`sys_messages`.`ID`)\n                         FROM\n                              `sys_messages`\n                         WHERE\n                              1\n                              {$sWhereParameter}\n                              {$sTypeMessages}\n                    ");
         if ($this->iTotalMessageCount) {
             // define number of maximum message for per page ;
             if ($this->aMailBoxSettings['page'] < 1) {
                 $this->aMailBoxSettings['page'] = 1;
             }
             $sLimitFrom = ($this->aMailBoxSettings['page'] - 1) * $this->aMailBoxSettings['per_page'];
             $sSqlLimit = "LIMIT {$sLimitFrom}, {$this->aMailBoxSettings['per_page']}";
             $sFieldName = $this->aMailBoxSettings['mailbox_mode'] == 'outbox' ? 'Recipient' : 'Sender';
             $sQuery = "\n                              SELECT\n                                   `sys_messages`.`ID`, DATE_FORMAT(`sys_messages`.`Date`, '" . getLocaleFormat(BX_DOL_LOCALE_DATE, BX_DOL_LOCALE_DB) . "') AS `Date`,\n                                   UNIX_TIMESTAMP() - UNIX_TIMESTAMP(`sys_messages`.`Date`) AS `DateUTS`,\n                                   UNIX_TIMESTAMP(`sys_messages`.`Date`) AS `DateTS`,\n                                   `sys_messages`.`Sender`, `sys_messages`.`Recipient`, `sys_messages`.`Text`,\n                                   `sys_messages`.`Subject`, `sys_messages`.`New`, `sys_messages`.`Type`\n                              FROM\n                                   `sys_messages`\n                              INNER JOIN\n                                   `Profiles`\n                              ON\n                                   `Profiles`.`ID` = `sys_messages`.`{$sFieldName}`\n                              WHERE\n                                   1\n                                   {$sWhereParameter}\n                                   {$sTypeMessages}\n                              ORDER BY {$sSortParameter}\n                              {$sSqlLimit}\n                         ";
             $aMessages = array();
             $rResult = db_res($sQuery);
             // generate array with messages ;
             while (true == ($aRow = $rResult->fetch())) {
                 $aMessages[] = $aRow;
             }
             // return generated array ;
             return $aMessages;
         }
     }
 }
开发者ID:toxalot,项目名称:dolphin.pro,代码行数:62,代码来源:BxDolMailBox.php

示例15: getRequests

 /**
 * Function will return array with needed requests ;
 *
 * @param   : $sTableName (string) - DB's table name;
 * @param   : $aRequestTypes (array) - contain language keys for differences person's mode ;
                [ from ]  - needed if person mode = 'from' ;
                [ to ]    - needed if person mode = 'to'   ;
 * @param   : $sAdditionalParam (string) - additional SQL query ;
 * @param   : $sAdditionalField (string) - additional table's field ;
 * @return  : (array) array with all requests ;
                [ member_id ] -  member's ID ;
                [ date ]      -  request's date ;
                [ type ]      -  type of request ;
 */
 function getRequests($sTableName, &$aRequestTypes, $sAdditionalParam = null, $sAdditionalField = null)
 {
     $sTableName = process_db_input($sTableName);
     $sAdditionalParam = process_db_input($sAdditionalParam);
     $sAdditionalField = process_db_input($sAdditionalField);
     // ** init some needed variables ;
     $aRequests = array();
     // init all sort criterias ;
     $aSortCriterias = array('date' => "`{$sTableName}`.`When` ASC", 'author' => '`Profiles`.`NickName`  ASC', 'date_desc' => "`{$sTableName}`.`When` DESC", 'author_desc' => '`Profiles`.`NickName`  DESC');
     // define the sort parameter ;
     $sSortParameter = array_key_exists($this->aCommunicatorSettings['sorting'], $aSortCriterias) ? $aSortCriterias[$this->aCommunicatorSettings['sorting']] : $aSortCriterias['date_desc'];
     // define the person mode ;
     switch ($this->aCommunicatorSettings['person_switcher']) {
         case 'from':
             $sFieldName = '`ID`';
             break;
         case 'to':
             $sFieldName = '`Profile`';
             break;
         default:
             $sFieldName = '`ID`';
     }
     // count of all requests ;
     $this->iTotalRequestsCount = db_value("\n                SELECT\n                    COUNT(*)\n                FROM\n                    `{$sTableName}`\n                WHERE\n                    `{$sTableName}`.{$sFieldName}  = {$this->aCommunicatorSettings['member_id']}\n                    {$sAdditionalParam}\n            ");
     if ($this->iTotalRequestsCount) {
         // lang keys ;
         $sRequestFrom = $GLOBALS['MySQL']->escape($aRequestTypes['from']);
         $sRequestTo = $GLOBALS['MySQL']->escape($aRequestTypes['to']);
         // define number of maximum rows for per page ;
         if ($this->aCommunicatorSettings['page'] < 1) {
             $this->aCommunicatorSettings['page'] = 1;
         }
         $sLimitFrom = ($this->aCommunicatorSettings['page'] - 1) * $this->aCommunicatorSettings['per_page'];
         $sSqlLimit = "LIMIT {$sLimitFrom}, {$this->aCommunicatorSettings['per_page']}";
         // define the additional table's field ;
         $sExtFieldName = $sAdditionalField ? ", `{$sTableName}`.`{$sAdditionalField}`" : null;
         $sQuery = "\n                    SELECT\n                        IF(`{$sTableName}`.`ID` = {$this->aCommunicatorSettings['member_id']},\n                            `{$sTableName}`.`Profile`, `{$sTableName}`.`ID`) AS `iMemberID`,\n\n                        IF(`{$sTableName}`.`ID` = {$this->aCommunicatorSettings['member_id']}, '{$sRequestFrom}', '{$sRequestTo}')\n                            AS `sType`,\n\n                        DATE_FORMAT(`{$sTableName}`.`When`, '" . getLocaleFormat(BX_DOL_LOCALE_DATE, BX_DOL_LOCALE_DB) . "') AS `sDate`\n                        {$sExtFieldName}\n                    FROM\n                        `{$sTableName}`\n                    LEFT JOIN\n                        `Profiles`\n                    ON\n                        `Profiles`.`ID` = IF(`{$sTableName}`.`ID` = {$this->aCommunicatorSettings['member_id']},\n                            `{$sTableName}`.`Profile`, `{$sTableName}`.`ID`)\n                    WHERE\n                        `{$sTableName}`.{$sFieldName} = {$this->aCommunicatorSettings['member_id']}\n                        {$sAdditionalParam}\n                    ORDER BY\n                       {$sSortParameter}\n                       {$sSqlLimit}\n                ";
         $rResult = db_res($sQuery);
         while (true == ($aRow = mysql_fetch_assoc($rResult))) {
             $sExtType = (!empty($aRequestTypes['specific_key']) and $sAdditionalField) ? ' ' . _t($aRequestTypes['specific_key'], $aRow[$sAdditionalField]) : null;
             $aRequests[] = array('member_id' => $aRow['iMemberID'], 'date' => $aRow['sDate'], 'type' => $aRow['sType'] . $sExtType);
         }
     }
     return $aRequests;
 }
开发者ID:newton27,项目名称:dolphin.pro,代码行数:59,代码来源:BxDolCommunicator.php


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