本文整理汇总了PHP中SmrSession::getNewHREF方法的典型用法代码示例。如果您正苦于以下问题:PHP SmrSession::getNewHREF方法的具体用法?PHP SmrSession::getNewHREF怎么用?PHP SmrSession::getNewHREF使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SmrSession
的用法示例。
在下文中一共展示了SmrSession::getNewHREF方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: max
<?php
$template->assign('PageTopic', 'IP Menu');
$db->query('SELECT max(account_id) max_account_id FROM account');
$db->nextRecord();
$template->assign('MaxAccountID', $db->getInt('max_account_id'));
$template->assign('IpFormHref', SmrSession::getNewHREF(create_container('skeleton.php', 'ip_view_results.php')));
示例2: array
<?php
$template->assign('PageTopic', 'Log Console');
$loggedAccounts = array();
$db->query('SELECT account_id as account_id, login, count(*) as number_of_entries
FROM account_has_logs
JOIN account USING(account_id)
GROUP BY account_id');
if ($db->getNumRows()) {
$db2 = new SmrMySqlDatabase();
while ($db->nextRecord()) {
$accountID = $db->getInt('account_id');
$loggedAccounts[$accountID] = array('AccountID' => $accountID, 'Login' => $db->getField('login'), 'TotalEntries' => $db->getInt('number_of_entries'), 'Checked' => is_array($var['account_ids']) && in_array($accountID, $var['account_ids']), 'Notes' => '');
$db2->query('SELECT notes FROM log_has_notes WHERE account_id = ' . $db2->escapeNumber($accountID));
if ($db2->nextRecord()) {
$loggedAccounts[$accountID]['Notes'] = nl2br($db2->getField('notes'));
}
}
// put hidden fields in for log type to have all fields selected on next page.
$logTypes = array();
$db->query('SELECT log_type_id FROM log_type');
while ($db->nextRecord()) {
$logTypes[] = $db->getInt('log_type_id');
}
$template->assignByRef('LogTypes', $logTypes);
$template->assign('LogConsoleFormHREF', SmrSession::getNewHREF(create_container('skeleton.php', 'log_console_detail.php')));
$template->assign('AnonAccessHRE', SmrSession::getNewHREF(create_container('skeleton.php', 'log_anonymous_account.php')));
}
$template->assignByRef('LoggedAccounts', $loggedAccounts);
示例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: 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')));
示例5:
<?php
$template->assign('PageTopic', 'Search Trader');
$template->assign('TraderSearchHREF', SmrSession::getNewHREF(create_container('skeleton.php', 'trader_search_result.php')));
示例6: array
<?php
$template->assign('PageTopic', 'Create Vote');
$template->assign('VoteFormHREF', SmrSession::getNewHREF(create_container('vote_create_processing.php', '')));
$voting = array();
$db->query('SELECT * FROM voting WHERE end > ' . $db->escapeNumber(TIME));
while ($db->nextRecord()) {
$voteID = $db->getField('vote_id');
$voting[$voteID]['ID'] = $voteID;
$voting[$voteID]['Question'] = $db->getField('question');
}
$template->assign('CurrentVotes', $voting);
if (isset($var['PreviewVote'])) {
$template->assign('PreviewVote', $var['PreviewVote']);
}
if (isset($var['Days'])) {
$template->assign('Days', $var['Days']);
}
if (isset($var['PreviewOption'])) {
$template->assign('PreviewOption', $var['PreviewOption']);
}
if (isset($var['VoteID'])) {
$template->assign('VoteID', $var['VoteID']);
}
示例7: array
<?php
$template->assign('PageTopic', 'Naming Your Ship');
if (isset($var['Preview'])) {
$template->assign('Preview', $var['Preview']);
$template->assign('ContinueHref', SmrSession::getNewHREF(create_container('skeleton.php', 'buy_ship_name_processing.php', array('ShipName' => $var['Preview']))));
} else {
$template->assign('ShipNameFormHref', SmrSession::getNewHREF(create_container('skeleton.php', 'buy_ship_name_processing.php')));
}
示例8: Game
<?php
$template->assign('PageTopic', 'Create Universe - Create Game (1/10)');
// create a container that will hold next url and additional variables.
$container = array();
$container['url'] = 'universe_create_game_processing.php';
$template->assign('CreateUniverseFormHref', SmrSession::getNewHREF($container));
$db->query('SELECT * FROM game ORDER BY game_id');
$games = array();
while ($db->nextRecord()) {
$games[] = array('ID' => $db->getField('game_id'), 'Name' => $db->getField('game_name'));
}
$template->assign('Games', $games);
$template->assign('DefaultStartDate', date('Y/m/d', TIME));
$template->assign('DefaultEndDate', date('Y/m/d', TIME + 5184000));
$db->query('SELECT game_name
FROM game
WHERE enabled = \'FALSE\'');
if ($db->getNumRows()) {
$disabledGames = array();
while ($db->nextRecord()) {
$disabledGames[] = $db->getField('game_name');
}
$template->assign('DisabledGames', $disabledGames);
}
示例9: array
AND transaction_id<=' . $db->escapeNumber($maxValue) . '
ORDER BY time LIMIT ' . (1 + $maxValue - $minValue);
} else {
$query .= ' ORDER BY time LIMIT 10';
}
$db->query($query);
// only if we have at least one result
if ($db->getNumRows() > 0) {
$bankTransactions = array();
while ($db->nextRecord()) {
$bankTransactions[$db->getInt('transaction_id')] = array('Time' => $db->getInt('time'), 'Player' => SmrPlayer::getPlayer($db->getInt('payee_id'), $player->getGameID()), 'Reason' => $db->getField('reason'), 'TransactionType' => $db->getField('transaction'), 'Withdrawal' => $db->getField('transaction') == 'Payment' ? $db->getInt('amount') : '', 'Deposit' => $db->getField('transaction') == 'Deposit' ? $db->getInt('amount') : '', 'Exempt' => $db->getInt('exempt') == 1);
}
$template->assignByRef('BankTransactions', $bankTransactions);
$template->assign('MinValue', $minValue);
$template->assign('MaxValue', $maxValue);
$container = create_container('skeleton.php', 'bank_alliance.php');
$container['alliance_id'] = $alliance->getAllianceID();
$template->assign('FilterTransactionsFormHREF', SmrSession::getNewHREF($container));
$container = create_container('bank_alliance_exempt_processing.php');
$container['minVal'] = $minValue;
$container['maxVal'] = $maxValue;
$template->assign('ExemptTransactionsFormHREF', SmrSession::getNewHREF($container));
$template->assignByRef('Alliance', $alliance);
}
$container = create_container('skeleton.php', 'bank_report.php');
$container['alliance_id'] = $alliance->getAllianceID();
$template->assign('BankReportHREF', SmrSession::getNewHREF($container));
$container = create_container('bank_alliance_processing.php');
$container['alliance_id'] = $alliance->getAllianceID();
$template->assign('BankTransactionFormHREF', SmrSession::getNewHREF($container));
示例10: USING
$players[$db->getInt('account_id')] = SmrPlayer::getPlayer($db->getInt('account_id'), $player->getGameID())->getLinkedDisplayName(false);
}
$db->query('SELECT mb_messages FROM player_has_alliance_role JOIN alliance_has_roles USING(game_id,alliance_id,role_id) WHERE account_id = ' . $db->escapeNumber($player->getAccountID()) . ' AND game_id = ' . $db->escapeNumber($player->getGameID()) . ' AND alliance_id=' . $db->escapeNumber($alliance->getAllianceID()) . ' LIMIT 1');
$db->nextRecord();
$thread['CanDelete'] = $db->getBoolean('mb_messages');
$db->query('SELECT text, sender_id, time, reply_id
FROM alliance_thread
WHERE game_id=' . $db->escapeNumber($player->getGameID()) . '
AND alliance_id=' . $db->escapeNumber($alliance->getAllianceID()) . '
AND thread_id=' . $db->escapeNumber($thread_id) . '
ORDER BY reply_id LIMIT ' . $var['thread_replies'][$thread_index]);
$thread['CanDelete'] = $db->getNumRows() > 1 && $thread['CanDelete'];
$thread['Replies'] = array();
$container = create_container('alliance_message_delete_processing.php', '', $var);
$container['thread_id'] = $thread_id;
while ($db->nextRecord()) {
$thread['Replies'][$db->getInt('reply_id')] = array('Sender' => $players[$db->getInt('sender_id')], 'Message' => $db->getField('text'), 'SendTime' => $db->getInt('time'));
if ($thread['CanDelete']) {
$container['reply_id'] = $db->getInt('reply_id');
$thread['Replies'][$db->getInt('reply_id')]['DeleteHref'] = SmrSession::getNewHREF($container);
}
}
if ($mbWrite || in_array($player->getAccountID(), Globals::getHiddenPlayers())) {
$container = create_container('alliance_message_add_processing.php', '', $var);
$container['thread_index'] = $thread_index;
$thread['CreateThreadReplyFormHref'] = SmrSession::getNewHREF($container);
}
$template->assignByRef('Thread', $thread);
if (isset($var['preview'])) {
$template->assign('Preview', $var['preview']);
}
示例11: get_file_loc
<?php
require_once get_file_loc('menu.inc');
create_galactic_post_menu();
$container = create_container('galactic_post_write_article_processing.php');
if (isset($var['id'])) {
$container['id'] = $var['id'];
$template->assign('PageTopic', 'Editing An Article');
if (!isset($var['Preview'])) {
$db->query('SELECT title, text FROM galactic_post_article WHERE game_id = ' . $db->escapeNumber($player->getGameID()) . ' AND article_id = ' . $db->escapeNumber($var['id']) . ' LIMIT 1');
if ($db->nextRecord()) {
SmrSession::updateVar('PreviewTitle', $db->getField('title'));
SmrSession::updateVar('Preview', $db->getField('text'));
}
}
} else {
$template->assign('PageTopic', 'Writing An Article');
}
if (isset($var['Preview'])) {
$template->assign('PreviewTitle', $var['PreviewTitle']);
$template->assign('Preview', $var['Preview']);
}
$template->assign('SubmitArticleHref', SmrSession::getNewHREF($container));
示例12: create_error
<?php
if (!$player->isLandedOnPlanet()) {
create_error('You are not on a planet!');
}
// create planet object
$planet =& $player->getSectorPlanet();
$template->assign('PageTopic', 'Planet : ' . $planet->getName() . ' [Sector #' . $player->getSectorID() . ']');
require_once get_file_loc('menu.inc');
create_planet_menu($planet);
//echo the dump cargo message or other message.
if (isset($var['errorMsg'])) {
$template->assign('ErrorMsg', $var['errorMsg']);
}
if (isset($var['msg'])) {
$template->assign('Msg', bbifyMessage($var['msg']));
}
$template->assignByRef('ThisPlanet', $planet);
doTickerAssigns($template, $player, $db);
$template->assign('LaunchFormLink', SmrSession::getNewHREF(create_container('planet_launch_processing.php', '')));
示例13: elseif
} elseif ($var['Dir'] == 'Down') {
$player->increaseZoom(1);
}
}
$dist = $player->getZoom();
$template->assign('isZoomOn', $zoomOn);
$container = array();
$container['url'] = 'skeleton.php';
$container['Dir'] = 'Down';
$container['rid'] = 'zoom_down';
$container['body'] = 'map_local.php';
$container['valid_for'] = -5;
$template->assign('ZoomDownLink', SmrSession::getNewHREF($container));
$container['Dir'] = 'Up';
$container['rid'] = 'zoom_up';
$template->assign('ZoomUpLink', SmrSession::getNewHREF($container));
$span = 1 + $dist * 2;
$topLeft =& $player->getSector();
$galaxy =& $topLeft->getGalaxy();
$template->assign('GalaxyName', $galaxy->getName());
//figure out what should be the top left and bottom right
//go left then up
for ($i = 0; $i < $dist && $i < (int) ($galaxy->getWidth() / 2); $i++) {
$topLeft =& $topLeft->getNeighbourSector('Left');
}
for ($i = 0; $i < $dist && $i < (int) ($galaxy->getHeight() / 2); $i++) {
$topLeft =& $topLeft->getNeighbourSector('Up');
}
$mapSectors = array();
$leftMostSec =& $topLeft;
for ($i = 0; $i < $span && $i < $galaxy->getHeight(); $i++) {
示例14: get_file_loc
<?php
$template->assign('PageTopic', 'Kill Rankings');
require_once get_file_loc('Rankings.inc');
require_once get_file_loc('menu.inc');
create_ranking_menu(0, 2);
// what rank are we?
$db->query('SELECT count(*) FROM player
WHERE game_id = ' . $db->escapeNumber($player->getGameID()) . '
AND (
kills > ' . $db->escapeNumber($player->getKills()) . '
OR (
kills = ' . $db->escapeNumber($player->getKills()) . '
AND player_name <= ' . $db->escapeString($player->getPlayerName(), true) . '
)
)');
$db->nextRecord();
$ourRank = $db->getInt('count(*)');
$template->assign('OurRank', $ourRank);
$totalPlayers = $player->getGame()->getTotalPlayers();
$db->query('SELECT account_id, kills amount FROM player WHERE game_id = ' . $db->escapeNumber($player->getGameID()) . ' ORDER BY kills DESC, player_name LIMIT 10');
$template->assignByRef('Rankings', Rankings::collectRankings($db, $player, 0));
Rankings::calculateMinMaxRanks($ourRank, $totalPlayers);
$template->assign('FilterRankingsHREF', SmrSession::getNewHREF(create_container('skeleton.php', 'rankings_player_kills.php')));
$lowerLimit = $var['MinRank'] - 1;
$db->query('SELECT account_id, kills amount FROM player WHERE game_id = ' . $db->escapeNumber($player->getGameID()) . ' ORDER BY kills DESC, player_name LIMIT ' . $lowerLimit . ', ' . ($var['MaxRank'] - $lowerLimit));
$template->assignByRef('FilteredRankings', Rankings::collectRankings($db, $player, $lowerLimit));
示例15: 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']);
}