本文整理汇总了PHP中Globals::getGameName方法的典型用法代码示例。如果您正苦于以下问题:PHP Globals::getGameName方法的具体用法?PHP Globals::getGameName怎么用?PHP Globals::getGameName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Globals
的用法示例。
在下文中一共展示了Globals::getGameName方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: get_file_loc
<?php
require_once get_file_loc('SmrPlanet.class.inc');
$db2 = new SmrMySqlDatabase();
$db3 = new SmrMySqlDatabase();
$game_id = $_REQUEST['game_id'];
//first get file name
$file = Globals::getGameName($game_id) . '.txt';
//we need to make a file for the SMC thing.
header('Content-Type: text/plain; charset=ISO-8859-1');
header('Content-Disposition: attachment; filename="' . $file . '"');
header('Content-transfer-encoding: base64');
//game heading and info
echo '[GAME]' . EOL;
echo $game_id . '=' . Globals::getGameName($game_id) . EOL;
//get races
echo '[RACES]' . EOL;
$db->query('SELECT * FROM race ORDER BY race_id');
while ($db->nextRecord()) {
$id = $db->getField('race_id');
$name = $db->getField('race_name');
echo 'R' . $id . '=' . $name . EOL;
}
//galaxies
echo '[GALAXIES]' . EOL;
$i = 1;
$gameGals =& SmrGalaxy::getGameGalaxies($game_id);
foreach ($gameGals as &$gameGal) {
echo 'GAL' . $i . '=' . $gameGal->getName() . ',' . $gameGal->getWidth() . ',' . $gameGal->getHeight() . EOL;
$i++;
}
示例2: create_link
//To: $receiver_acc->getLogin() ($receiver_acc->getAccountID())');
$offended = 'To: ';
if (is_object($receiver)) {
$offended .= $receiver_acc->getLogin() . ' (' . $receiver_acc->getAccountID() . ')';
if ($receiver_acc->getLogin() != $receiver->getPlayerName()) {
$offended .= ' a.k.a ' . $receiver->getPlayerName();
}
} else {
$offended .= $receiver;
}
$PHP_OUTPUT .= create_link($container, $offended);
$PHP_OUTPUT .= '</td><td>';
if (!Globals::isValidGame($gameID)) {
$PHP_OUTPUT .= 'Game no longer exists';
} else {
$PHP_OUTPUT .= Globals::getGameName($gameID);
}
$PHP_OUTPUT .= '</td></tr><tr><td colspan="2">';
$PHP_OUTPUT .= 'Sent at ' . date(DATE_FULL_SHORT, $db->getField('sent_time'));
$PHP_OUTPUT .= '</td><td colspan="2">';
$PHP_OUTPUT .= 'Notified at ' . date(DATE_FULL_SHORT, $db->getField('notify_time'));
//$PHP_OUTPUT.=create_link($container, $trader);
$PHP_OUTPUT .= '</td>';
$PHP_OUTPUT .= '</tr>';
$PHP_OUTPUT .= '<tr>';
$PHP_OUTPUT .= '<td width="100%" colspan="4">';
$message = $db->getField('text');
$PHP_OUTPUT .= bbifyMessage($message);
$PHP_OUTPUT .= '</td></tr>';
}
$PHP_OUTPUT .= '</table>';
示例3: foreach
}
if ($adminCreate === false && $sector->hasFriendlyForces($player)) {
$forcesString = 'FriendlyForces=';
$friendlyForces =& $sector->getFriendlyForces($player);
foreach ($friendlyForces as &$forces) {
$forcesString .= inify($forces->getOwner()->getPlayerName()) . '=' . inify(Globals::getHardwareName(HARDWARE_MINE)) . '=' . $forces->getMines() . ';' . inify(Globals::getHardwareName(HARDWARE_COMBAT)) . '=' . $forces->getCDs() . ';' . inify(Globals::getHardwareName(HARDWARE_SCOUT)) . '=' . $forces->getSDs() . ',';
}
unset($forces);
unset($friendlyForces);
$file .= substr($forcesString, 0, -1) . EOL;
}
}
unset($sector);
}
unset($galaxy);
$size = strlen($file);
header('Pragma: public');
header('Expires: 0');
header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
header('Cache-Control: private', false);
header('Content-Type: application/force-download');
header('Content-Disposition: attachment; filename="' . Globals::getGameName($gameID) . '.smr"');
header('Content-Transfer-Encoding: binary');
header('Content-Length: ' . $size);
echo $file;
release_lock();
exit;
function inify($text)
{
return str_replace(',', '', html_entity_decode($text));
}
示例4: header
<?php
header('Content-Type: text/plain; charset=ISO-8859-1');
header('Content-Disposition: attachment; filename="Game.ini"');
header('Content-transfer-encoding: base64');
$game_id = $_REQUEST['game_id'];
echo '[Settings]' . EOL;
echo 'Name=' . Globals::getGameName($game_id) . EOL;
echo 'ID=' . $game_id . EOL . EOL;
echo '[Galaxy]' . EOL;
$gameGals =& SmrGalaxy::getGameGalaxies($game_id);
foreach ($gameGals as &$gameGal) {
echo $gameGal->getName() . '=' . $gameGal->getWidth() . ';' . $gameGal->getHeight() . EOL;
}
unset($gameGal);
// expire all forces first
$db->query('DELETE FROM sector_has_forces WHERE expire_time < ' . TIME);
echo EOL . '[Marks]' . EOL;
$db->query('SELECT * FROM sector_has_forces WHERE game_id = ' . $game_id . ' GROUP BY sector_id ORDER BY sector_id');
while ($db->nextRecord()) {
$owner =& SmrPlayer::getPlayer($db->getField('owner_id'), $game_id);
$user =& SmrPlayer::getPlayer($account->getAccountID(), $game_id);
$sector = $db->getField('sector_id');
if ($owner->sameAlliance($user)) {
echo $sector . '=2' . EOL;
} else {
echo $sector . '=1' . EOL;
}
}
示例5: array
$account_id = $var['account_id'];
} else {
$account_id = $account->getAccountID();
}
$game_id = null;
if (isset($var['game_id'])) {
$game_id = $var['game_id'];
}
$base = array();
if (isset($var['game_id'])) {
try {
$hofPlayer =& SmrPlayer::getPlayer($account_id, $var['game_id']);
} catch (Exception $e) {
create_error('That player has not yet joined this game.');
}
$template->assign('PageTopic', $hofPlayer->getPlayerName() . '\'s Personal Hall of Fame For ' . Globals::getGameName($var['game_id']));
} else {
$template->assign('PageTopic', $account->getHofName() . '\'s All Time Personal Hall of Fame');
}
$PHP_OUTPUT .= '<div class="center">';
$allowedVisibities = array(HOF_PUBLIC);
if ($account->getAccountID() == $account_id) {
$allowedVisibities[] = HOF_ALLIANCE;
$allowedVisibities[] = HOF_PRIVATE;
} else {
if (isset($hofPlayer) && $hofPlayer->sameAlliance($player)) {
$allowedVisibities[] = HOF_ALLIANCE;
}
}
$db->query('SELECT type FROM hof_visibility WHERE visibility IN (' . $db->escapeArray($allowedVisibities) . ') ORDER BY type');
//$db->query('SELECT DISTINCT type FROM player_hof JOIN hof_visibility USING(type) WHERE visibility IN (' . $db->escapeArray($allowedVisibities) . ') AND account_id='.$account_id . (isset($var['game_id']) ? ' AND game_id='.$var['game_id'] : '').' ORDER BY type');
示例6: while
$container['box_type_id'] = $var['box_type_id'];
$template->assign('DeleteHREF', SmrSession::getNewHREF($container));
while ($db->nextRecord()) {
$gameID = $db->getInt('game_id');
$validGame = $gameID > 0 && Globals::isValidGame($gameID);
$messageID = $db->getInt('message_id');
$messages[$messageID] = array('ID' => $messageID);
$senderAccount =& SmrAccount::getAccount($db->getField('sender_id'));
$senderName = $senderAccount->getLogin() . ' (' . $senderAccount->getAccountID() . ')';
if ($validGame) {
$senderPlayer =& SmrPlayer::getPlayer($senderAccount->getAccountID(), $gameID);
if ($senderAccount->getLogin() != $senderPlayer->getPlayerName()) {
$senderName .= ' a.k.a ' . $senderPlayer->getPlayerName();
}
$container = create_container('skeleton.php', 'box_reply.php');
$container['sender_id'] = $senderAccount->getAccountID();
$container['game_id'] = $gameID;
$messages[$messageID]['ReplyHREF'] = SmrSession::getNewHREF($container);
}
$messages[$messageID]['SenderName'] = $senderName;
if (!$validGame) {
$messages[$messageID]['GameName'] = 'Game no longer exists';
} else {
$messages[$messageID]['GameName'] = Globals::getGameName($gameID);
}
$messages[$messageID]['SendTime'] = date(DATE_FULL_SHORT, $db->getField('send_time'));
$messages[$messageID]['Message'] = bbifyMessage(htmliseMessage($db->getField('message_text')));
}
$template->assign('Messages', $messages);
}
}
示例7: get_file_loc
<?php
require_once get_file_loc('hof.functions.inc');
$game_id = null;
if (isset($var['game_id'])) {
$game_id = $var['game_id'];
}
$base = array();
if (empty($game_id)) {
$topic = 'All Time Hall of Fame';
} else {
$topic = Globals::getGameName($game_id) . ' Hall of Fame';
}
$template->assign('PageTopic', $topic);
$PHP_OUTPUT .= '<div class="center">';
$container = array();
$container['url'] = 'skeleton.php';
$container['body'] = 'hall_of_fame_player_detail.php';
if (isset($var['game_id'])) {
$container['game_id'] = $var['game_id'];
}
$PHP_OUTPUT .= 'Welcome to the Hall of Fame ' . $account->getHofName() . '!<br />The Hall of Fame is a comprehensive ' . 'list of player accomplishments. Here you can view how players rank in many different ' . 'aspects of the game rather than just kills, deaths, and experience with the rankings system.<br />' . create_link($container, 'You can also view your Personal Hall of Fame here.') . '<br /><br />';
$db->query('SELECT type FROM hof_visibility WHERE visibility != ' . $db->escapeString(HOF_PRIVATE) . ' ORDER BY type');
//$db->query('SELECT DISTINCT type FROM player_hof JOIN hof_visibility USING(type) WHERE visibility != '. $db->escapeString(HOF_PRIVATE) . (isset($var['game_id']) ? ' AND game_id='.$db->escapeNumber($var['game_id']) : '').' ORDER BY type');
define('DONATION_NAME', 'Money Donated To SMR');
define('USER_SCORE_NAME', 'User Score');
$hofTypes = array(DONATION_NAME => true, USER_SCORE_NAME => true);
while ($db->nextRecord()) {
$hof =& $hofTypes;
$typeList = explode(':', $db->getField('type'));
foreach ($typeList as $type) {
示例8: bbifyMessage
<div align="center">
<table class="standard">
<tr>
<td align="center">General Info</td>
<td align="center">Other Info</td>
</tr>
<tr>
<td valign="top" align="center">
<table class="nobord">
<tr>
<td align="right">Name</td>
<td> </td>
<td align="left"><?php
echo Globals::getGameName($StatsGameID);
?>
</td>
</tr>
<tr>
<td align="right">Description</td>
<td> </td>
<td align="left"><?php
echo bbifyMessage(Globals::getGameDescription($StatsGameID));
?>
</td>
</tr>
<tr>
<td align="right">Start Date</td>
<td> </td>
<td align="left"><?php
echo date(DATE_FULL_SHORT, Globals::getGameStartDate($StatsGameID));
?>