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


PHP Globals::getCompatibilityDatabases方法代码示例

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


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

示例1: SmrMySqlDatabase

 $db = new SmrMySqlDatabase();
 if (SmrSession::$account_id > 0) {
     $account =& SmrAccount::getAccount(SmrSession::$account_id);
     $disabled = $account->isDisabled();
     if ($disabled !== false) {
         $reason = $disabled['Reason'];
         if ($disabled['Time'] > 0) {
             $reason .= '  Your account is set to reopen on ' . date(DEFAULT_DATE_FULL_LONG, $disabled['Time']) . '.';
         } else {
             $reason .= '  Your account is set to never reopen.  If you believe this is wrong contact an admin.';
         }
     }
     //	SmrSession::destroy();
 } else {
     if (USE_COMPATIBILITY && SmrSession::$old_account_id > 0) {
         foreach (Globals::getCompatibilityDatabases('Game') as $databaseClassName => $gameType) {
             require_once get_file_loc($databaseClassName . '.class.inc');
             $db = new $databaseClassName();
             $db->query('SELECT * FROM account_is_closed JOIN closing_reason USING(reason_id) WHERE account_id = ' . $db->escapeNumber(SmrSession::$old_account_id));
             if ($db->nextRecord()) {
                 $time = $db->getField('expires');
                 $reason = $db->getField('reason');
                 if ($time > 0) {
                     $reason .= '  Your account is set to reopen ' . date(DEFAULT_DATE_FULL_LONG, $time) . '.';
                 } else {
                     $reason .= '  Your account is set to never reopen.  If you believe this is wrong contact an admin.';
                 }
             }
         }
         //	SmrSession::destroy();
     } else {
开发者ID:smrealms,项目名称:smrv2.0,代码行数:31,代码来源:disabled.php

示例2: array

        $container = array();
        $container['game_id'] = $container['GameID'] = $game_id;
        $container['url'] = 'skeleton.php';
        $container['game_name'] = $games['Previous'][$game_id]['Name'];
        $container['body'] = 'games_previous.php';
        //		$games['Previous'][$game_id]['PreviousGameLink'] = SmrSession::getNewHREF($container);
        $container['body'] = 'hall_of_fame_new.php';
        $games['Previous'][$game_id]['PreviousGameHOFLink'] = SmrSession::getNewHREF($container);
        $container['body'] = 'news_read.php';
        $games['Previous'][$game_id]['PreviousGameNewsLink'] = SmrSession::getNewHREF($container);
        $container['body'] = 'games_previous_detail.php';
        //		$games['Previous'][$game_id]['PreviousGameStatsLink'] = SmrSession::getNewHREF($container);
    }
}
if (USE_COMPATIBILITY) {
    foreach (Globals::getCompatibilityDatabases('History') as $databaseClassName => $databaseInfo) {
        require_once get_file_loc($databaseClassName . '.class.inc');
        //Old previous games
        $historyDB = new $databaseClassName();
        $historyDB->query('SELECT start_date, end_date, game_name, speed, game_id
							FROM game ORDER BY game_id DESC');
        if ($historyDB->getNumRows()) {
            while ($historyDB->nextRecord()) {
                $game_id = $historyDB->getField('game_id');
                $index = $databaseClassName . $game_id;
                $games['Previous'][$index]['ID'] = $game_id;
                $games['Previous'][$index]['Name'] = $historyDB->getField('game_name');
                $games['Previous'][$index]['StartDate'] = date(DATE_DATE_SHORT, $historyDB->getField('start_date'));
                $games['Previous'][$index]['EndDate'] = date(DATE_DATE_SHORT, $historyDB->getField('end_date'));
                $games['Previous'][$index]['Speed'] = $historyDB->getField('speed');
                // create a container that will hold next url and additional variables.
开发者ID:smrealms,项目名称:smrv2.0,代码行数:31,代码来源:game_play.php


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