本文整理汇总了PHP中SmrSession类的典型用法代码示例。如果您正苦于以下问题:PHP SmrSession类的具体用法?PHP SmrSession怎么用?PHP SmrSession使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了SmrSession类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: foreach
} else {
$PHP_OUTPUT .= 'Gal_on not found!!';
}
$galaxy =& SmrGalaxy::getGalaxy($var['game_id'], $var['gal_on']);
$galSectors =& $galaxy->getSectors();
//get totals
$numberOfPlanets = 0;
foreach ($galSectors as &$galSector) {
if ($galSector->hasPlanet()) {
$numberOfPlanets++;
}
}
//universe_create_planets.php
$container = $var;
$container['url'] = '1.6/universe_create_save_processing.php';
$container['body'] = '1.6/universe_create_sectors.php';
$PHP_OUTPUT .= create_echo_form($container);
$galaxy =& SmrGalaxy::getGalaxy($var['game_id'], $var['gal_on']);
$PHP_OUTPUT .= 'Working on Galaxy : ' . $galaxy->getName() . ' (' . $galaxy->getGalaxyID() . ')<br />';
$PHP_OUTPUT .= '<table class="standard">';
$PHP_OUTPUT .= '<tr><td class="right">Uninhabited Planets</td><td>';
$PHP_OUTPUT .= '<input type="number" value="' . $numberOfPlanets . '" size="5" name="Uninhab"></td></tr>';
$PHP_OUTPUT .= '<tr><td class="right">NPC Planets - Won\'t work</td><td>';
$PHP_OUTPUT .= '<input type="number" value="' . (isset($planet_info['NPC']) ? $planet_info['NPC'] : 0) . '" size="5" name="NPC"></td></tr>';
$PHP_OUTPUT .= '<tr><td colspan="2" class="center"><input type="submit" name="submit" value="Create Planets">';
$container = $var;
$container['body'] = '1.6/universe_create_sectors.php';
$PHP_OUTPUT .= '<br /><br /><a href="' . SmrSession::getNewHREF($container) . '" class="submitStyle">Cancel</a>';
$PHP_OUTPUT .= '</td></tr></table></form>';
$PHP_OUTPUT .= '<span class="small">Note: When you press "Create Planets" this will rearrange all current planets.<br />';
$PHP_OUTPUT .= 'To add new planets without rearranging everything use the edit sector feature.</span>';
示例2: get_file_loc
<?php
require_once get_file_loc('SmrAlliance.class.inc');
$template->assign('PageTopic', 'Alliance VS Alliance Rankings');
require_once get_file_loc('menu.inc');
create_ranking_menu(1, 3);
$db2 = new SmrMySqlDatabase();
$container = array();
$container['url'] = 'skeleton.php';
$container['body'] = 'rankings_alliance_vs_alliance.php';
$PHP_OUTPUT .= create_echo_form($container);
if (isset($_REQUEST['alliancer'])) {
SmrSession::updateVar('alliancer', $_REQUEST['alliancer']);
}
$alliancer = $var['alliancer'];
$PHP_OUTPUT .= '<div align="center">';
$PHP_OUTPUT .= '<p>Here are the rankings of alliances vs other alliances<br />';
$PHP_OUTPUT .= 'Click on an alliances name for more detailed death stats.</p>';
$PHP_OUTPUT .= '<table class="standard" width="95%">';
$PHP_OUTPUT .= '<tr>';
$PHP_OUTPUT .= '<th rowspan="9">Killed</th><th colspan="8">Killers</th></tr><tr><td></td>';
if (empty($alliancer)) {
$alliance_vs = array();
$db->query('SELECT * FROM alliance WHERE game_id = ' . $db->escapeNumber($player->getGameID()) . ' ORDER BY alliance_kills DESC, alliance_name LIMIT 5');
while ($db->nextRecord()) {
$alliance_vs[] = $db->getField('alliance_id');
}
//$PHP_OUTPUT.=('empty '.$alliancer);
} else {
$alliance_vs = $alliancer;
}
示例3: stripslashes
<?php
$template->assign('PageTopic', 'Edit Photo');
$db->query('SELECT * FROM album WHERE account_id = ' . $db->escapeNumber(SmrSession::$account_id));
if ($db->nextRecord()) {
$albumEntry['Location'] = stripslashes($db->getField('location'));
$albumEntry['Email'] = stripslashes($db->getField('email'));
$albumEntry['Website'] = stripslashes($db->getField('website'));
$albumEntry['Day'] = $db->getInt('day');
$albumEntry['Month'] = $db->getInt('month');
$albumEntry['Year'] = $db->getInt('year');
$albumEntry['Other'] = stripslashes($db->getField('other'));
$approved = $db->getField('approved');
if ($approved == 'TBC') {
$albumEntry['Status'] = '<span style="color:orange;">Waiting approval</span>';
} elseif ($approved == 'NO') {
$albumEntry['Status'] = '<span class="red">Approval denied</span>';
} elseif ($db->getBoolean('disabled')) {
$albumEntry['Status'] = '<span class="red">Disabled</span>';
} elseif ($approved == 'YES') {
$albumEntry['Status'] = '<a href="' . URL . '/album/?' . $account->getHofName() . '" class="dgreen">Online</a>';
}
if (is_readable(UPLOAD . SmrSession::$account_id)) {
$albumEntry['Image'] = URL . '/upload/' . SmrSession::$account_id;
}
$template->assign('AlbumEntry', $albumEntry);
}
$template->assign('AlbumEditHref', SmrSession::getNewHREF(create_container('album_edit_processing.php', '')));
示例4: htmlspecialchars
<?php
if (!isset($var['alliance_id'])) {
SmrSession::updateVar('alliance_id', $player->getAllianceID());
}
$alliance_id = $var['alliance_id'];
$alliance =& SmrAlliance::getAlliance($alliance_id, $player->getGameID());
$template->assign('PageTopic', $alliance->getAllianceName() . ' (' . $alliance->getAllianceID() . ')');
require_once get_file_loc('menu.inc');
create_alliance_menu($alliance_id, $alliance->getLeaderID());
$container = create_container('alliance_stat_processing.php');
$container['alliance_id'] = $alliance_id;
$form = create_form($container, 'Change');
$role_id = $player->getAllianceRole($alliance->getAllianceID());
$db->query('SELECT * FROM alliance_has_roles WHERE alliance_id = ' . $db->escapeNumber($alliance_id) . ' AND game_id = ' . $db->escapeNumber($player->getGameID()) . ' AND role_id = ' . $db->escapeNumber($role_id));
$db->nextRecord();
$PHP_OUTPUT .= $form['form'];
//$PHP_OUTPUT.=create_echo_form(create_container('alliance_stat_processing.php', ''));
$PHP_OUTPUT .= '<table cellspacing="0" cellpadding="0" class="nobord nohpad">';
if ($db->getBoolean('change_pass')) {
$PHP_OUTPUT .= '<tr><td class="top">Password: </td><td><input type="password" name="password" size="30" value="' . htmlspecialchars($alliance->getPassword()) . '"></td></tr>';
}
if ($db->getBoolean('change_mod') || $account->hasPermission(PERMISSION_EDIT_ALLIANCE_DESCRIPTION)) {
$PHP_OUTPUT .= '<tr><td class="top">Description: </td><td><textarea spellcheck="true" name="description">';
$PHP_OUTPUT .= $alliance->getDescription();
$PHP_OUTPUT .= '</textarea></td></tr>';
}
if ($player->isAllianceLeader()) {
$PHP_OUTPUT .= '<tr><td class="top">IRC Channel: </td><td><input type="text" name="irc" size="30" value="' . htmlspecialchars($alliance->getIrcChannel()) . '"> (For Caretaker and autojoining via chat link - works best if you join the channel using the chat link and type "/autoconnect on" as an op)</td></tr>';
}
if ($db->getBoolean('change_mod')) {
示例5: get_file_loc
<?php
require_once get_file_loc('ChessGame.class.inc');
$template->assignByRef('ChessGame', ChessGame::getChessGame($var['ChessGameID']));
$template->assign('ChessMoveHREF', SmrSession::getNewHREF(create_container('chess_move_processing.php', '', array('AJAX' => true, 'ChessGameID' => $var['ChessGameID']))));
示例6: create_ranking_menu
create_ranking_menu(1, 3);
$db->query('SELECT count(*) FROM alliance
WHERE game_id = ' . $db->escapeNumber($player->getGameID()));
$db->nextRecord();
$numAlliances = $db->getInt('count(*)');
$ourRank = 0;
if ($player->hasAlliance()) {
$db->query('SELECT count(*)
FROM alliance
WHERE game_id = ' . $db->escapeNumber($player->getGameID()) . '
AND (
alliance_deaths > ' . $db->escapeNumber($player->getAlliance()->getDeaths()) . '
OR (
alliance_deaths = ' . $db->escapeNumber($player->getAlliance()->getDeaths()) . '
AND alliance_name <= ' . $db->escapeString($player->getAllianceName()) . '
)
)');
$db->nextRecord();
$ourRank = $db->getInt('count(*)');
$template->assign('OurRank', $ourRank);
}
$db->query('SELECT alliance_id, alliance_deaths amount FROM alliance
WHERE game_id = ' . $db->escapeNumber($player->getGameID()) . ' ORDER BY amount DESC, alliance_name LIMIT 10');
$template->assignByRef('Rankings', Rankings::collectAllianceRankings($db, $player, 0));
Rankings::calculateMinMaxRanks($ourRank, $numAlliances);
$lowerLimit = $var['MinRank'] - 1;
$db->query('SELECT alliance_id, alliance_deaths amount FROM alliance
WHERE game_id = ' . $db->escapeNumber($player->getGameID()) . ' ORDER BY amount DESC, alliance_name LIMIT ' . $lowerLimit . ', ' . ($var['MaxRank'] - $lowerLimit));
$template->assignByRef('FilteredRankings', Rankings::collectAllianceRankings($db, $player, 0));
$template->assign('FilterRankingsHREF', SmrSession::getNewHREF(create_container('skeleton.php', 'rankings_alliance_death.php')));
示例7:
<?php
$template->assign('PageTopic', 'Search Trader');
$template->assign('TraderSearchHREF', SmrSession::getNewHREF(create_container('skeleton.php', 'trader_search_result.php')));
示例8: SmrMySqlDatabase
<?php
if (isset($_REQUEST['variable'])) {
SmrSession::updateVar('Variable', $_REQUEST['variable']);
}
$variable = $var['Variable'];
if (isset($_REQUEST['type'])) {
SmrSession::updateVar('Type', $_REQUEST['type']);
}
$type = $var['Type'];
$db2 = new SmrMySqlDatabase();
//used to make sure we don't display deleted accounts
$del_num = 5;
$close_reason = ' ';
if (isset($var['type'])) {
$type = $var['type'];
}
//another script for comp share
if ($type == 'comp_share') {
include get_file_loc('comp_share.php');
} elseif ($type == 'all_acc') {
include get_file_loc('list_all.php');
} elseif ($type == 'list') {
if (isset($var['total'])) {
$total = $var['total'];
}
if (empty($total)) {
$total = 0;
}
if (isset($var['variable'])) {
$variable = $var['variable'];
示例9:
<?php
$template->assign('PageTopic', 'Create Announcement');
$template->assign('AnnouncementCreateFormHref', SmrSession::getNewHREF(create_container('announcement_create_processing.php')));
if (isset($var['preview'])) {
$template->assign('Preview', $var['preview']);
}
示例10: get_file_loc
<?php
$alliance =& SmrAlliance::getAlliance($var['alliance_id'], $player->getGameID());
$template->assign('PageTopic', $alliance->getAllianceName() . ' (' . $alliance->getAllianceID() . ')');
require_once get_file_loc('menu.inc');
create_alliance_menu($alliance->getAllianceID(), $alliance->getLeaderID());
$container = create_container('message_send_processing.php');
$container['alliance_id'] = $var['alliance_id'];
$template->assign('MessageSendFormHref', SmrSession::getNewHREF($container));
$template->assign('Receiver', 'Whole Alliance');
if (isset($var['preview'])) {
$template->assign('Preview', $var['preview']);
}
示例11: get_file_loc
<?php
$template->assign('PageTopic', 'Reply To Reported Messages');
require_once get_file_loc('message.functions.inc');
$container = create_container('notify_reply_processing.php');
transfer('game_id');
transfer('offended');
transfer('offender');
$template->assign('NotifyReplyFormHref', SmrSession::getNewHREF($container));
$offender =& getMessagePlayer($var['offender'], $var['game_id']);
$offended =& getMessagePlayer($var['offended'], $var['game_id']);
if (is_object($offender)) {
$template->assignByRef('OffenderAccount', SmrAccount::getAccount($var['offender']));
}
if (is_object($offended)) {
$template->assignByRef('OffendedAccount', SmrAccount::getAccount($var['offended']));
}
$template->assignByRef('Offender', $offender);
$template->assignByRef('Offended', $offended);
if (isset($var['PreviewOffender'])) {
$template->assign('PreviewOffender', $var['PreviewOffender']);
}
if (isset($var['OffenderBanPoints'])) {
$template->assign('OffenderBanPoints', $var['OffenderBanPoints']);
}
if (isset($var['PreviewOffended'])) {
$template->assign('PreviewOffended', $var['PreviewOffended']);
}
if (isset($var['OffendedBanPoints'])) {
$template->assign('OffendedBanPoints', $var['OffendedBanPoints']);
}
示例12: create_error
<?php
if (!$sector->hasPort()) {
create_error('This sector does not have a port.');
}
if ($sector->getPort()->isDestroyed()) {
forward(create_container('skeleton.php', 'port_attack.php'));
}
$template->assign('PageTopic', 'Port Raid');
$template->assign('PortAttackHREF', SmrSession::getNewHREF(create_container('port_attack_processing.php')));
示例13: get_file_loc
<?php
require_once '../htdocs/config.inc';
require_once LIB . 'Default/Globals.class.inc';
require_once get_file_loc('ChessGame.class.inc');
SmrSession::$game_id = 44;
$db = new SmrMySqlDatabase();
$db->query('DELETE FROM player_hof WHERE type LIKE \'Chess%\'');
$db->query('SELECT chess_game_id FROM chess_game');
while ($db->nextRecord()) {
$chessGameID = $db->getInt('chess_game_id');
$game =& ChessGame::getChessGame($chessGameID);
echo 'Running game ' . $chessGameID . ' for white id "' . $game->getWhiteID() . '", black id "' . $game->getBlackID() . '", winner "' . $game->getWinner() . '"' . EOL;
echoChessMoves($game);
$game->rerunGame(true);
echo 'Finished game ' . $chessGameID . ' for white id "' . $game->getWhiteID() . '", black id "' . $game->getBlackID() . '", winner "' . $game->getWinner() . '"' . EOL;
echoChessMoves($game);
}
function echoChessMoves($game)
{
echo 'Moves: ' . EOL;
$moves = $game->getMoves();
foreach ($moves as $move) {
echo $move . EOL;
}
echo EOL;
}
示例14: create_container
$type = ' saved';
break;
case 6:
$type = ' force';
break;
}
$template->assign('LogType', $type);
$container = create_container('skeleton.php', 'combat_log_viewer.php');
$container['action'] = 5;
$container['old_action'] = $action;
$container['direction'] = 0;
$template->assign('LogFormHREF', SmrSession::getNewHREF($container));
$container = $var;
if ($page > 0) {
$container['page'] = $page - 1;
$template->assign('PreviousPage', SmrSession::getNewHREF($container));
}
if (($page + 1) * COMBAT_LOGS_PER_PAGE < $totalLogs) {
$container['page'] = $page + 1;
$template->assign('NextPage', SmrSession::getNewHREF($container));
}
// Saved logs
$template->assign('CanDelete', $action == 4);
$template->assign('CanSave', $action != 4);
while ($db->nextRecord()) {
$sectorID = $db->getInt('sector_id');
$logs[$db->getField('log_id')] = array('Attacker' => getParticipantName($db->getInt('attacker_id'), $sectorID), 'Defender' => getParticipantName($db->getInt('defender_id'), $sectorID), 'Time' => $db->getInt('timestamp'), 'Sector' => $sectorID);
}
}
$template->assign('Logs', $logs);
}
示例15: get_file_loc
<?php
require_once get_file_loc('smr_sector.inc');
// register game_id
SmrSession::$game_id = $var["game_id"];
// check if hof entry is there
$db->query("SELECT * FROM account_has_stats WHERE account_id = " . SmrSession::$old_account_id);
if (!$db->nf()) {
$db->query("INSERT INTO account_has_stats (account_id, HoF_name, games_joined) VALUES ({$account->account_id}, " . format_string($account->login, true) . ", 1)");
}
$player = new SMR_PLAYER(SmrSession::$old_account_id, $var["game_id"]);
include get_file_loc('out_check.php');
$player->last_sector_id = 0;
$player->last_active = time();
$player->update();
// get rid of old plotted course
$player->delete_plotted_course();
// log
$account->log(2, "Player entered game " . SmrSession::$game_id, $player->sector_id);
$container = array();
$container["url"] = "skeleton.php";
if ($player->land_on_planet == "TRUE") {
$container["body"] = "planet_main.php";
} else {
$container["body"] = "current_sector.php";
}
require_once get_file_loc('smr_alliance.inc');
require_once get_file_loc("smr_force.inc");
require_once get_file_loc("smr_planet.inc");
require_once get_file_loc("smr_port.inc");
require_once get_file_loc('smr_sector.inc');