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


PHP SmrMySqlDatabase::getInt方法代码示例

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


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

示例1: user_nick

/**
 * Someone changed his nick
 */
function user_nick($fp, $rdata)
{
    if (preg_match('/^:(.*)!(.*)@(.*)\\sNICK\\s:(.*)\\s$/i', $rdata, $msg)) {
        $nick = $msg[1];
        $user = $msg[2];
        $host = $msg[3];
        $new_nick = $msg[4];
        echo_r('[NICK] ' . $nick . ' -> ' . $new_nick);
        // database object
        $db = new SmrMySqlDatabase();
        $db2 = new SmrMySqlDatabase();
        $channel_list = array();
        // 'sign off' all active old_nicks (multiple channels)
        $db->query('SELECT * FROM irc_seen WHERE nick = ' . $db->escapeString($nick) . ' AND signed_off = 0');
        while ($db->nextRecord()) {
            $seen_id = $db->getInt('seen_id');
            // remember channels where this nick was active
            array_push($channel_list, $db->getField('channel'));
            $db2->query('UPDATE irc_seen SET signed_off = ' . time() . ' WHERE seen_id = ' . $seen_id);
        }
        // now sign in the new_nick in every channel
        foreach ($channel_list as $channel) {
            // 'sign in' the new nick
            $db->query('SELECT * FROM irc_seen WHERE nick = ' . $db->escapeString($new_nick) . ' AND channel = ' . $db->escapeString($channel));
            if ($db->nextRecord()) {
                // exiting nick?
                $seen_id = $db->getField('seen_id');
                $db->query('UPDATE irc_seen SET ' . 'signed_on = ' . time() . ', ' . 'signed_off = 0, ' . 'user = ' . $db->escapeString($user) . ', ' . 'host = ' . $db->escapeString($host) . ', ' . 'registered = NULL ' . 'WHERE seen_id = ' . $seen_id);
            } else {
                // new nick?
                $db->query('INSERT INTO irc_seen (nick, user, host, channel, signed_on) VALUES(' . $db->escapeString($new_nick) . ', ' . $db->escapeString($user) . ', ' . $db->escapeString($host) . ', ' . $db->escapeString($channel) . ', ' . time() . ')');
            }
        }
        unset($channel_list);
        return true;
    }
    return false;
}
开发者ID:smrealms,项目名称:smrv2.0,代码行数:41,代码来源:user.php

示例2: SmrMySqlDatabase

<?php

// new db object
$db = new SmrMySqlDatabase();
$loginNews = array();
$db->query('SELECT * FROM game_news ORDER BY time DESC LIMIT 2');
while ($db->nextRecord()) {
    $loginNews[] = array('Message' => $db->getField('message'), 'AdminName' => $db->getField('admin_name'), 'Time' => date(DEFAULT_DATE_DATE_SHORT, $db->getField('time')), 'Recent' => TIME - $db->getField('time') < 24 * 3600);
}
if (count($loginNews) > 0) {
    $template->assign('LoginNews', $loginNews);
}
$db->query('SELECT count(*) AS active_sessions FROM active_session WHERE account_id!=0 AND last_accessed > ' . $db->escapeNumber(TIME - SmrSession::TIME_BEFORE_EXPIRY));
$db->nextRecord();
$template->assign('ActiveSessions', $db->getField('active_sessions'));
$gameNews = array();
$db->query('SELECT * FROM news ORDER BY time DESC LIMIT 4');
while ($db->nextRecord()) {
    $overrideGameID = $db->getInt('game_id');
    $gameNews[] = array('Date' => date(DEFAULT_DATE_DATE_SHORT, $db->getField('time')), 'Time' => date(DEFAULT_DATE_TIME_SHORT, $db->getField('time')), 'Message' => bbifyMessage($db->getField('news_message')));
}
unset($overrideGameID);
if (count($gameNews) > 0) {
    $template->assign('GameNews', $gameNews);
}
include_once 'story.php';
$template->display('login_new.inc');
开发者ID:smrealms,项目名称:smrv2.0,代码行数:27,代码来源:loginSmarty.php

示例3: SmrMySqlDatabase

<?php

require_once '../htdocs/config.inc';
require_once LIB . 'Default/SmrMySqlDatabase.class.inc';
require_once LIB . 'Default/Globals.class.inc';
require_once LIB . 'Default/SmrPort.class.inc';
$db = new SmrMySqlDatabase();
$db->query('SELECT account_id,sector_id,game_id FROM player_visited_port');
while ($db->nextRecord()) {
    SmrPort::getCachedPort($db->getInt('game_id'), $db->getInt('sector_id'), $db->getInt('account_id'))->addCachePort($db->getInt('account_id'));
    SmrPort::clearCache();
}
开发者ID:smrealms,项目名称:smrv2.0,代码行数:12,代码来源:updatePortCache.php

示例4: strtolower

$PHP_OUTPUT .= '<p>&nbsp;</p>';
$PHP_OUTPUT .= '<p>';
while ($db->nextRecord()) {
    if ($anon_id != $db->getField('anon_id')) {
        // if this is not the first entry we have to close previous list
        if ($anon_id > 0) {
            $PHP_OUTPUT .= '</ul>';
        }
        // set current anon_id
        $anon_id = $db->getInt('anon_id');
        // start topic for it
        $PHP_OUTPUT .= 'Account #' . $anon_id;
        $PHP_OUTPUT .= '<ul>';
    }
    $curr_account =& SmrAccount::getAccount($db->getInt('account_id'));
    $transaction_id = $db->getInt('transaction_id');
    $db2->query('SELECT * FROM anon_bank_transactions
				 WHERE account_id = ' . $db2->escapeNumber($curr_account->getAccountID()) . ' AND
					   anon_id = ' . $db2->escapeNumber($anon_id) . ' AND
					   transaction_id = ' . $db2->escapeNumber($transaction_id));
    if ($db2->nextRecord()) {
        $text = strtolower($db2->getField('transaction')) . ' ' . number_format($db2->getInt('amount')) . ' credits';
    }
    $PHP_OUTPUT .= '<li>' . $curr_account->getLogin() . ' ' . $text . '</li>';
}
$PHP_OUTPUT .= '</ul>';
$PHP_OUTPUT .= '</p>';
$PHP_OUTPUT .= '<p>&nbsp;</p>';
$PHP_OUTPUT .= '<p>';
$PHP_OUTPUT .= create_link(create_container('skeleton.php', 'log_console.php'), '<b>&lt; Back</b>');
$PHP_OUTPUT .= '</p>';
开发者ID:smrealms,项目名称:smrv2.0,代码行数:31,代码来源:log_anonymous_account.php

示例5: while

    while ($db2->nextRecord()) {
        $votedFor[$db2->getField('vote_id')] = $db2->getField('option_id');
    }
    $voting = array();
    while ($db->nextRecord()) {
        $voteID = $db->getField('vote_id');
        $voting[$voteID]['ID'] = $voteID;
        $container = array();
        $container['body'] = 'game_play.php';
        $container['url'] = 'vote_processing.php';
        $container['vote_id'] = $voteID;
        $voting[$voteID]['HREF'] = SmrSession::getNewHREF($container);
        $voting[$voteID]['Question'] = $db->getField('question');
        $voting[$voteID]['TimeRemaining'] = format_time($db->getField('end') - TIME, true);
        $voting[$voteID]['Options'] = array();
        $db2->query('SELECT option_id,text,count(account_id) FROM voting_options LEFT OUTER JOIN voting_results USING(vote_id,option_id) WHERE vote_id = ' . $db->escapeNumber($db->getInt('vote_id')) . ' GROUP BY option_id');
        while ($db2->nextRecord()) {
            $voting[$voteID]['Options'][$db2->getField('option_id')]['ID'] = $db2->getField('option_id');
            $voting[$voteID]['Options'][$db2->getField('option_id')]['Text'] = $db2->getField('text');
            $voting[$voteID]['Options'][$db2->getField('option_id')]['Chosen'] = isset($votedFor[$db->getField('vote_id')]) && $votedFor[$voteID] == $db2->getField('option_id');
            $voting[$voteID]['Options'][$db2->getField('option_id')]['Votes'] = $db2->getField('count(account_id)');
        }
    }
    $template->assign('Voting', $voting);
}
// ***************************************
// ** Donation Link
// ***************************************
$template->assign('DonateLink', SmrSession::getNewHREF(create_container('skeleton.php', 'donation.php')));
// ***************************************
// ** Announcements View
开发者ID:smrealms,项目名称:smrv2.0,代码行数:31,代码来源:game_play.php

示例6: getFeaturesCount

    $commentsContainer['body'] = 'feature_request_comments.php';
    $db2 = new SmrMySqlDatabase();
    $featureRequests = array();
    while ($db->nextRecord()) {
        $featureRequestID = $db->getInt('feature_request_id');
        $featureRequests[$featureRequestID] = array('RequestID' => $featureRequestID, 'Message' => $db->getField('text'), 'Votes' => array('FAVOURITE' => $db->getInt('fav'), 'YES' => $db->getInt('yes'), 'NO' => $db->getInt('no')), 'VotedFor' => isset($featureVotes[$featureRequestID]) ? $featureVotes[$featureRequestID] : false);
        if ($featureModerator) {
            $featureRequests[$featureRequestID]['RequestAccount'] =& SmrAccount::getAccount($db->getInt('poster_id'));
        }
        if ($var['Status'] == 'Opened') {
            $db2->query('SELECT COUNT(*), vote_type
						FROM account_votes_for_feature
						WHERE feature_request_id=' . $db2->escapeNumber($featureRequestID) . '
						GROUP BY vote_type');
            while ($db2->nextRecord()) {
                $featureRequests[$featureRequestID]['Votes'][$db2->getField('vote_type')] = $db2->getInt('COUNT(*)');
            }
        }
        $db2->query('SELECT COUNT(*)
					FROM feature_request_comments
					WHERE feature_request_id=' . $db2->escapeNumber($featureRequestID));
        while ($db2->nextRecord()) {
            $featureRequests[$featureRequestID]['Comments'] = $db2->getInt('COUNT(*)');
        }
        $commentsContainer['RequestID'] = $featureRequestID;
        $featureRequests[$featureRequestID]['CommentsHREF'] = SmrSession::getNewHREF($commentsContainer);
    }
    $template->assignByRef('FeatureRequests', $featureRequests);
}
$template->assign('FeatureRequestFormHREF', SmrSession::getNewHREF(create_container('feature_request_processing.php', '')));
function getFeaturesCount($status, $onlyCurrent = false)
开发者ID:smrealms,项目名称:smrv2.0,代码行数:31,代码来源:feature_request.php

示例7: SmrMySqlDatabase

			WHERE ' . $db->escapeNumber(TIME) . ' < end_time
			AND game_id = ' . $db->escapeNumber($player->getGameID()) . '
			AND race_id_1 = ' . $db->escapeNumber($player->getRaceID()));
if ($db->getNumRows() > 0) {
    $db2 = new SmrMySqlDatabase();
    while ($db->nextRecord()) {
        $otherRaceID = $db->getField('race_id_2');
        $container = create_container('council_vote_processing.php', '', array('race_id' => $otherRaceID));
        // get 'yes' votes
        $db2->query('SELECT count(*) FROM player_votes_pact
					WHERE game_id = ' . $db2->escapeNumber($player->getGameID()) . '
						AND race_id_1 = ' . $db2->escapeNumber($player->getRaceID()) . '
						AND race_id_2 = ' . $db2->escapeNumber($otherRaceID) . '
						AND vote = \'YES\'');
        $db2->nextRecord();
        $yesVotes = $db2->getInt('count(*)');
        // get 'no' votes
        $db2->query('SELECT count(*) FROM player_votes_pact
					WHERE game_id = ' . $db2->escapeNumber($player->getGameID()) . '
						AND race_id_1 = ' . $db2->escapeNumber($player->getRaceID()) . '
						AND race_id_2 = ' . $db2->escapeNumber($otherRaceID) . '
						AND vote = \'NO\'');
        $db2->nextRecord();
        $noVotes = $db2->getInt('count(*)');
        $db2->query('SELECT vote FROM player_votes_pact
					WHERE account_id = ' . $db->escapeNumber($player->getAccountID()) . '
						AND game_id = ' . $db->escapeNumber($player->getGameID()) . '
						AND race_id_1 = ' . $db->escapeNumber($player->getRaceID()) . '
						AND race_id_2 = ' . $db->escapeNumber($otherRaceID));
        $votedFor = '';
        if ($db2->nextRecord()) {
开发者ID:smrealms,项目名称:smrv2.0,代码行数:31,代码来源:council_vote.php

示例8: channel_msg_op_list

function channel_msg_op_list($fp, $rdata, $account, $player)
{
    if (preg_match('/^:(.*)!(.*)@(.*)\\sPRIVMSG\\s(.*)\\s:!op list\\s$/i', $rdata, $msg)) {
        $nick = $msg[1];
        $user = $msg[2];
        $host = $msg[3];
        $channel = $msg[4];
        echo_r('[OP_LIST] by ' . $nick . ' in ' . $channel);
        // get the op info from db
        $db = new SmrMySqlDatabase();
        $db->query('SELECT 1
					FROM alliance_has_op
					WHERE alliance_id = ' . $player->getAllianceID() . '
						AND game_id = ' . $player->getGameID());
        if (!$db->nextRecord()) {
            fputs($fp, 'PRIVMSG ' . $channel . ' :' . $nick . ', your leader has not scheduled an OP.' . EOL);
            return true;
        }
        $yes = array();
        $no = array();
        $maybe = array();
        $db->query('SELECT account_id, response
					FROM alliance_has_op_response
					WHERE alliance_id = ' . $player->getAllianceID() . '
						AND game_id = ' . $player->getGameID());
        while ($db->nextRecord()) {
            $respondingPlayer = SmrPlayer::getPlayer($db->getInt('account_id'), $player->getGameID());
            if (!$player->sameAlliance($respondingPlayer)) {
                continue;
            }
            switch ($db->getField('response')) {
                case 'YES':
                    $yes[] = $respondingPlayer;
                    break;
                case 'NO':
                    $no[] = $respondingPlayer;
                    break;
                case 'MAYBE':
                    $maybe[] = $respondingPlayer;
                    break;
            }
        }
        if (count($yes) + count($no) + count($maybe) == 0) {
            fputs($fp, 'PRIVMSG ' . $channel . ' :Noone has signed up for the upcoming OP.' . EOL);
            return true;
        }
        if (count($yes) > 0) {
            fputs($fp, 'PRIVMSG ' . $channel . ' :YES (' . count($yes) . '):' . EOL);
            foreach ($yes as $attendee) {
                fputs($fp, 'PRIVMSG ' . $channel . ' :  * ' . $attendee->getPlayerName() . EOL);
            }
        }
        if (count($no) > 0) {
            fputs($fp, 'PRIVMSG ' . $channel . ' :NO (' . count($no) . '):' . EOL);
            foreach ($no as $attendee) {
                fputs($fp, 'PRIVMSG ' . $channel . ' :  * ' . $attendee->getPlayerName() . EOL);
            }
        }
        if (count($maybe) > 0) {
            fputs($fp, 'PRIVMSG ' . $channel . ' :MAYBE (' . count($maybe) . '):' . EOL);
            foreach ($maybe as $attendee) {
                fputs($fp, 'PRIVMSG ' . $channel . ' :  * ' . $attendee->getPlayerName() . EOL);
            }
        }
        return true;
    }
    return false;
}
开发者ID:smrealms,项目名称:smrv2.0,代码行数:68,代码来源:channel_msg_op.php

示例9: while

}
if ($action == 'Yes') {
    // get game id
    $game_id = $var['game_id'];
    if ($save) {
        $db->query('SELECT * FROM alliance WHERE game_id = ' . $db->escapeNumber($game_id));
        while ($db->nextRecord()) {
            $id = $db->getInt('alliance_id');
            //we need info for forces
            //populate alliance list
            $db2->query('SELECT * FROM player
						WHERE alliance_id = ' . $db2->escapeNumber($id) . '
							AND game_id = ' . $db2->escapeNumber($game_id));
            $list = array(0);
            while ($db2->nextRecord()) {
                $list[] = $db2->getInt('account_id');
            }
            $db2->query('SELECT sum(mines) as sum_m, sum(combat_drones) as cds, sum(scout_drones) as sds
						FROM sector_has_forces
						WHERE owner_id IN (' . $db2->escapeArray($list) . ') AND game_id = ' . $db2->escapeNumber($game_id));
            if ($db2->nextRecord()) {
                $mines = $db2->getInt('sum_m');
                $cds = $db2->getInt('cds');
                $sds = $db2->getInt('sds');
            } else {
                $mines = 0;
                $cds = 0;
                $sds = 0;
            }
            // get info we want
            $name = $db->getField('alliance_name');
开发者ID:smrealms,项目名称:smrv2.0,代码行数:31,代码来源:game_delete_processing.php

示例10:

					AND thread_id=' . $db2->escapeNumber($threadID) . '
					AND time>' . $db2->escapeNumber($db->getInt('sendtime')) . ' LIMIT 1');
        $threads[$i]['Unread'] = $db2->getNumRows() == 0;
        if ($db->getInt('sender_id') > 0) {
            $db2->query('SELECT
						player.player_name as player_name,
						alliance_thread.sender_id as sender_id
						FROM player
						JOIN alliance_thread ON alliance_thread.game_id = player.game_id AND player.account_id=alliance_thread.sender_id
						WHERE player.game_id=' . $db2->escapeNumber($player->getGameID()) . '
						AND alliance_thread.alliance_id=' . $db2->escapeNumber($alliance->getAllianceID()) . '
						AND alliance_thread.thread_id=' . $db2->escapeNumber($threadID) . '
						AND alliance_thread.reply_id=1 LIMIT 1
						');
            if ($db2->nextRecord()) {
                $sender_id = $db2->getInt('sender_id');
                $author =& SmrPlayer::getPlayer($sender_id, $player->getGameID());
                $playerName = $author->getLinkedDisplayName(false);
            } else {
                $playerName = 'Unknown';
            }
        } else {
            $sender_id = $db->getInt('sender_id');
            if ($sender_id == 0) {
                $playerName = 'Planet Reporter';
            }
            if ($sender_id == -1) {
                $playerName = 'Bank Reporter';
            }
            if ($sender_id == -2) {
                $playerName = 'Forces Reporter';
开发者ID:smrealms,项目名称:smrv2.0,代码行数:31,代码来源:alliance_message.php

示例11: USING

$db->query('SELECT location_name, location_type_id
			FROM location JOIN location_type USING(location_type_id)
			WHERE location_type_id > ' . $db->escapeNumber(UNDERGROUND) . '
				AND location_type_id < ' . $db->escapeNumber(FED) . '
				AND game_id = ' . $db->escapeNumber($var['game_id']) . '
			ORDER BY location_type_id');
$races = array();
while ($db->nextRecord()) {
    // get the name for this race
    // HACK! cut ' Headquarters' from location name!
    $race_name = substr(stripslashes($db->getField('location_name')), 0, -13);
    $curr_race_id = $db->getField('location_type_id') - 101;
    if (in_array($curr_race_id, $only)) {
        continue;
    }
    $only[] = $curr_race_id;
    // get number of traders in game
    $db2->query('SELECT count(*) as number_of_race FROM player WHERE race_id = ' . $db2->escapeNumber($curr_race_id) . ' AND game_id = ' . $db2->escapeNumber($var['game_id']));
    $db2->nextRecord();
    $races[$curr_race_id]['ID'] = $curr_race_id;
    $races[$curr_race_id]['Name'] = $race_name;
    $races[$curr_race_id]['NumberOfPlayers'] = $db2->getInt('number_of_race');
    $races[$curr_race_id]['Selected'] = false;
}
if (count($races) > 1) {
    do {
        $raceKey = array_rand($races);
    } while ($races[$raceKey]['ID'] == RACE_ALSKANT);
    $races[$raceKey]['Selected'] = true;
}
$template->assign('Races', $races);
开发者ID:smrealms,项目名称:smrv2.0,代码行数:31,代码来源:game_join.php

示例12: SmrMySqlDatabase

<?php

$template->assign('PageTopic', 'Voting');
$db->query('SELECT * FROM voting ORDER BY end DESC');
if ($db->getNumRows() > 0) {
    $db2 = new SmrMySqlDatabase();
    $votedFor = array();
    $db2->query('SELECT * FROM voting_results WHERE account_id = ' . $db2->escapeNumber($account->getAccountID()));
    while ($db2->nextRecord()) {
        $votedFor[$db2->getInt('vote_id')] = $db2->getInt('option_id');
    }
    $voting = array();
    while ($db->nextRecord()) {
        $voteID = $db->getField('vote_id');
        $voting[$voteID]['ID'] = $voteID;
        $container = create_container('vote.php', 'vote_processing.php');
        $container['vote_id'] = $voteID;
        $voting[$voteID]['HREF'] = SmrSession::getNewHREF($container);
        $voting[$voteID]['Question'] = $db->getField('question');
        if ($db->getField('end') > TIME) {
            $voting[$voteID]['TimeRemaining'] = format_time($db->getField('end') - TIME, true);
        }
        $voting[$voteID]['Options'] = array();
        $db2->query('SELECT option_id,text,count(account_id) FROM voting_options LEFT OUTER JOIN voting_results USING(vote_id,option_id) WHERE vote_id = ' . $db2->escapeNumber($db->getInt('vote_id')) . ' GROUP BY option_id');
        while ($db2->nextRecord()) {
            $voting[$voteID]['Options'][$db2->getInt('option_id')]['ID'] = $db2->getInt('option_id');
            $voting[$voteID]['Options'][$db2->getInt('option_id')]['Text'] = $db2->getField('text');
            $voting[$voteID]['Options'][$db2->getInt('option_id')]['Chosen'] = isset($votedFor[$db->getField('vote_id')]) && $votedFor[$voteID] == $db2->getInt('option_id');
            $voting[$voteID]['Options'][$db2->getInt('option_id')]['Votes'] = $db2->getInt('count(account_id)');
        }
    }
开发者ID:smrealms,项目名称:smrv2.0,代码行数:31,代码来源:vote.php

示例13: forward

<?php

if (!isset($var['CheckType']) || $var['CheckType'] == 'Validate') {
    // is account validated?
    if (!$account->isValidated()) {
        forward(create_container('skeleton.php', 'validate.php'));
    } else {
        $var['CheckType'] = 'Announcements';
    }
}
$db = new SmrMySqlDatabase();
if ($var['CheckType'] == 'Announcements') {
    $db->query('SELECT 1 FROM account JOIN announcement ON last_login < time
				WHERE account_id = ' . $db->escapeNumber(SmrSession::$account_id) . ' LIMIT 1');
    // do we have announcements?
    if ($db->nextRecord()) {
        forward(create_container('skeleton.php', 'announcements.php'));
    } else {
        $var['CheckType'] = 'Updates';
    }
}
if ($var['CheckType'] == 'Updates') {
    $db->query('SELECT last_login FROM account JOIN version ON last_login < went_live
				WHERE account_id = ' . $db->escapeNumber(SmrSession::$account_id) . ' LIMIT 1');
    // do we have updates?
    if ($db->nextRecord()) {
        forward(create_container('skeleton.php', 'changelog_view.php', array('Since' => $db->getInt('last_login'))));
    }
}
forward(create_container('logged_in.php'));
开发者ID:smrealms,项目名称:smrv2.0,代码行数:30,代码来源:login_check_processing.php

示例14: SocialLogin

        if (isset($_REQUEST['loginType'])) {
            require_once LIB . 'Login/SocialLogin.class.inc';
            $socialLogin = new SocialLogin($_REQUEST['loginType']);
            if (!$socialLogin->isValid()) {
                $msg = 'Error validating login.';
                header('Location: ' . URL . '/login.php?msg=' . rawurlencode(htmlspecialchars($msg, ENT_QUOTES)));
                exit;
            }
            $loginType = $socialLogin->getLoginType();
            $authKey = $socialLogin->getUserID();
            $db->query('SELECT account_id,old_account_id FROM account JOIN account_auth USING(account_id)
						WHERE login_type = ' . $db->escapeString($loginType) . '
						   AND auth_key = ' . $db->escapeString($authKey) . ' LIMIT 1');
            if ($db->nextRecord()) {
                // register session
                SmrSession::$account_id = $db->getInt('account_id');
                SmrSession::$old_account_id = $db->getInt('old_account_id');
            } else {
                if ($socialLogin->getEmail() != null) {
                    $db->query('SELECT account_id,old_account_id FROM account ' . 'WHERE email = ' . $db->escapeString($socialLogin->getEmail()) . ' LIMIT 1');
                }
                if ($socialLogin->getEmail() != null && $db->nextRecord()) {
                    //Email already has an account so let's link.
                    $account =& SmrAccount::getAccount($db->getField('account_id'));
                    $account->addAuthMethod($socialLogin->getLoginType(), $socialLogin->getUserID());
                    $account->setValidated(true);
                    SmrSession::$account_id = $db->getField('account_id');
                    SmrSession::$old_account_id = $db->getField('old_account_id');
                } else {
                    session_start();
                    //Pass the data in a standard session as we don't want to initialise a normal one.
开发者ID:smrealms,项目名称:smrv2.0,代码行数:31,代码来源:login_processing2.php

示例15: SmrMySqlDatabase

    if ($db->getNumRows()) {
        $PHP_OUTPUT .= '<br /><h2>Your accounts</h2><br />';
        $PHP_OUTPUT .= '<div align=center>';
        $PHP_OUTPUT .= '<table class="standard inset" ><tr><th>ID</th><th>Password</th><th>Last Transaction</th><th>Balance</th><th>Option</th></tr>';
        $container = create_container('skeleton.php', 'bank_anon.php');
        $db2 = new SmrMySqlDatabase();
        while ($db->nextRecord()) {
            $PHP_OUTPUT .= '<tr><td class="shrink center">';
            $PHP_OUTPUT .= $db->getInt('anon_id');
            $PHP_OUTPUT .= '</td><td>';
            $PHP_OUTPUT .= $db->getField('password');
            $PHP_OUTPUT .= '</td><td class="shrink noWrap">';
            $db2->query('SELECT MAX(time) FROM anon_bank_transactions
						WHERE game_id=' . $db2->escapeNumber($player->getGameID()) . '
						AND anon_id=' . $db2->escapeNumber($db->getInt('anon_id')) . ' LIMIT 1');
            if ($db2->nextRecord() && $db2->getInt('MAX(time)')) {
                $PHP_OUTPUT .= date(DATE_FULL_SHORT, $db2->getInt('MAX(time)'));
            } else {
                $PHP_OUTPUT .= 'No transactions';
            }
            $PHP_OUTPUT .= '</td><td class="right shrink">';
            $PHP_OUTPUT .= $db->getInt('amount');
            $PHP_OUTPUT .= '</td><td class="button">';
            $container['AccountNumber'] = $db->getInt('anon_id');
            $container['Password'] = $db->getField('password');
            $PHP_OUTPUT .= create_button($container, 'Access Account');
            $PHP_OUTPUT .= '</td></tr>';
        }
        $PHP_OUTPUT .= '</table></div><br /><br />';
    }
    $container = create_container('skeleton.php', 'bank_anon.php');
开发者ID:smrealms,项目名称:smrv2.0,代码行数:31,代码来源:bank_anon.php


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