本文整理汇总了PHP中display_page函数的典型用法代码示例。如果您正苦于以下问题:PHP display_page函数的具体用法?PHP display_page怎么用?PHP display_page使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了display_page函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: go
function go()
{
ob_start();
require_once LOCAL_PATH . "conf.php";
require_once LOCAL_PATH . "framework/common/includes.php";
require_once LOCAL_PATH . "routes.php";
// parse the requested page, and make it available globally
if ($_GET["id"] != '') {
$GLOBALS["REQUEST_PARAMS"] = explode("/", $_GET["id"]);
} else {
$GLOBALS["REQUEST_PARAMS"] = array('', '');
}
// "/admin/login" gets exploded as { "", "admin", "login" } but it looks better when not rewriting
// -- so shift off the empty element of the array
if ($GLOBALS["REQUEST_PARAMS"][0] == "") {
array_shift($GLOBALS["REQUEST_PARAMS"]);
}
if (end($GLOBALS["REQUEST_PARAMS"]) == "") {
array_pop($GLOBALS["REQUEST_PARAMS"]);
}
// take out a prefix, if we're not running from /
// TODO: remove in order
function remove_prefix($val)
{
return in_array($val, explode("/", ltrim(rtrim(BASEHREF, '/'), '/')));
}
if (REWRITE_URLS) {
array_filter($GLOBALS["REQUEST_PARAMS"], "remove_prefix");
}
// display the requested page
if (!display_page($GLOBALS["REQUEST_PARAMS"])) {
display_404();
}
ob_end_flush();
}
示例2: display_submod
function display_submod($submod, $mod)
{
if (!$submod->hasVisible()) {
return;
}
echo '<div class="submod">';
?>
<img src="<?php
echo $submod->_img;
?>
_select.png" alt="" style="float:right;" /><?php
/*if (!$submod->_visibility) { //if submod not visible
return;
}*/
echo '<h3>';
$url = urlStr($submod->_defaultpage);
echo "<a style=\"text-decoration: none;\" href=\"{$url}\">" . $submod->getDescription() . "</a><br/>";
echo "</h3>";
print "<ul>";
foreach ($submod->getPages() as $page) {
display_page($page, $submod, $mod);
}
print "</ul>";
echo '</div>';
}
示例3: shortcode_get_our_app
function shortcode_get_our_app()
{
ob_start();
display_page('get-our-app');
$output = ob_get_contents();
ob_end_clean();
return $output;
}
示例4: solidworks
/**
* SolidWorks (entry point)
*
* This function serves as the entry point for the entire application. It opens
* the session, loads the Page object, processes any forms, and invokes any actions
* for the page.
*
* @package SolidWorks
* @author John Diamond <jdiamond@solid-state.org>
*/
function solidworks(&$conf, $smarty)
{
global $page;
// Make the Page object available to smarty_extensions
global $translations;
// Make sure the client is logged in as a valid user before proceeding
validate_client();
// Load the user's language preference
$language = isset($_SESSION['client']['userdbo']) ? $_SESSION['client']['userdbo']->getLanguage() : null;
if ($language != null) {
TranslationParser::load("language/" . $language);
Translator::getTranslator()->setActiveLanguage($language);
}
if ($_SESSION['currentpage'] != $_GET['page']) {
$_SESSION['lastpage'] = $_SESSION['currentpage'];
}
// Get a Page object for the page being requested
$page = null;
$page = get_page_object($conf, $smarty);
if ($page == null) {
// Delete current session
session_destroy();
// Instantiate a generic page object
$page = new Page();
}
// Make sure the client has access to this page
if (!$page->control_access()) {
// Access denied
$page->setError(array("type" => "ACCESS_DENIED"));
$page->goback(1);
}
// Process any forms
if ($_SERVER['REQUEST_METHOD'] == "POST") {
handle_post_request();
}
// Execute any action if present in the URL
if (isset($_GET['action'])) {
$page->action($_GET['action']);
}
// Display
display_page($page);
// Push page onto the navigation stack
$_SESSION['navstack'][] = array("page" => $page->getName(), "url" => $page->getURL());
}
示例5: display_static_page
function display_static_page($page, $pages, $vars = array(), $options = array())
{
if (!isset($pages[$page])) {
// Unlisted page requested.
error_log(' Invalid page (' . $page . ') requested on page.php.');
display_page('404.tpl', '404');
} else {
if (!is_array($pages[$page])) {
$template = "page." . $page . ".tpl";
$title = $page;
// Display_page will prepend with 'Ninja Wars: '
} else {
$page_info = $pages[$page];
$template = first_value(@$page_info['template'], "page." . $page . ".tpl");
$title = $page_info['title'];
$callback = @$page_info['callback'];
// TODO: Merge the vars array instead of overwriting.
if ($callback && function_exists($callback)) {
$vars = array_merge($callback(), $vars);
// Call the callback to return the vars.
}
}
cache_headers(24);
// 24 hour caching.
display_page($template, $title, $vars, $options);
}
}
示例6: is_logged_in
$work_multiplier = 30;
$worked = $new_gold = $not_enough_energy = $use_second_description = null;
$is_logged_in = is_logged_in();
$worked = intval(in('worked'));
$recommended_to_work = 10;
// Store or retrieve the last value of turns worked.
if ($worked && is_numeric($worked)) {
set_setting('turns_worked', $worked);
$recommended_to_work = $worked;
} else {
$last_worked = get_setting('turns_worked');
$recommended_to_work = $last_worked ? $last_worked : 10;
}
// Work only if the work was requested, not just if the setting was set.
if ($worked > 0) {
$turns = get_turns($char_id);
if ($worked > $turns) {
$not_enough_energy = true;
} else {
$new_gold = $worked * $work_multiplier;
// *** calc amount worked ***
add_gold($char_id, $new_gold);
$turns = subtractTurns($char_id, $worked);
$use_second_description = true;
}
}
$gold = get_gold($char_id);
// Get the current/final gold.
$gold_display = number_format($gold);
display_page('work.tpl', 'Working in the Village', get_certain_vars(get_defined_vars(), array()), array('quickstat' => 'player'));
}
示例7: phpAds_SessionDataStore
OX_Admin_Redirect::redirect("{$page}?clientid={$clientid}");
}
}
}
OA_Permission::enforceAccessToObject('clients', $clientid);
OA_Permission::enforceAccessToObject('campaigns', $campaignid);
if (OA_Permission::isAccount(OA_ACCOUNT_ADVERTISER)) {
OA_Permission::enforceAllowed(OA_PERM_BANNER_EDIT);
OA_Permission::enforceAccessToObject('banners', $bannerid);
} else {
OA_Permission::enforceAccessToObject('banners', $bannerid, true);
}
$session['prefs']['inventory_entities'][OA_Permission::getEntityId()]['clientid'] = $clientid;
$session['prefs']['inventory_entities'][OA_Permission::getEntityId()]['campaignid'][$clientid] = $campaignid;
phpAds_SessionDataStore();
display_page($bannerid, $campaignid, $clientid);
function display_page($banner_id, $campaign_id, $client_id)
{
$page_name = basename($_SERVER['PHP_SELF']);
$entities = array('clientid' => $client_id, 'campaignid' => $campaign_id, 'bannerid' => $banner_id);
$entity_id = OA_Permission::getEntityId();
if (OA_Permission::isAccount(OA_ACCOUNT_ADVERTISER)) {
$entity_type = 'advertiser_id';
} else {
$entity_type = 'agency_id';
}
// Display navigation
$other_campaigns = Admin_DA::getPlacements(array($entity_type => $entity_id));
$other_banners = Admin_DA::getAds(array('placement_id' => $campaign_id), false);
displayNavigationBanner($page_name, $other_campaigns, $other_banners, $entities);
if (!empty($banner_id)) {
示例8: query_row
$data = query_row('
SELECT player_id, uname, accounts.verification_number as verification_number, CASE WHEN active = 1 THEN 1 ELSE 0 END AS active, accounts.active_email,
CASE WHEN accounts.confirmed = 1 THEN 1 ELSE 0 END as confirmed, status, member, days, ip, players.created_date
FROM accounts JOIN account_players ON _account_id = account_id JOIN players ON _player_id = player_id
WHERE account_id = :acctId', array(':acctId' => $aid));
if (rco($data)) {
$check = $data['verification_number'];
$confirmed = $data['confirmed'];
$active = $data['active'];
$username = $data['uname'];
} else {
$active = $check = $confirmed = $username = null;
}
//debug($data, $confirm, $check, $confirmed);
//debug($check, $confirm);
$confirmation_confirmed = false;
if ($confirmed == 1) {
// Confirmation state from the database is already confirmed.
} else {
if ($check && $confirm && $confirm == $check || $acceptable_admin_override) {
// Confirmation number matches whats in the database and neither is null, or the admin override was met.
query('UPDATE accounts SET operational = true, confirmed=1 WHERE account_id = :accountID', array(':accountID' => $aid));
$statement = DatabaseConnection::$pdo->prepare('UPDATE players SET active = 1 WHERE player_id in (SELECT _player_id FROM account_players WHERE _account_id = :accountID)');
$statement->bindValue(':accountID', $aid);
$statement->execute();
// todo - test for success
$confirmation_confirmed = true;
}
}
display_page('confirm.tpl', 'Game Confirmation', get_certain_vars(get_defined_vars()), array('quickstat' => false));
}
示例9: subtract_gold
subtract_gold($char_id, $thief_gold);
} else {
if ($thief_attack < 30) {
add_gold($char_id, $thief_gold);
add_item($char_id, 'shuriken', $quantity = 1);
}
}
} else {
$thief_gold = 0;
}
$npc_template = 'npc.thief.tpl';
$combat_data = array('attack' => $thief_attack, 'gold' => $thief_gold, 'victory' => $victory);
}
}
}
}
}
}
}
// ************ End of specific npc logic *******************
// ************ FINAL CHECK FOR DEATH ***********************
if ($player->health() <= 0) {
$health = false;
sendMessage("SysMsg", $username, "DEATH: You have been killed by a " . $victim . " on {$today}");
}
// Subtract the turn cost for attacking an npc, almost always going to be 1 apart from perhaps oni or group-of-thieves
subtractTurns($char_id, $turn_cost);
}
// Add the combat_data into the standard stuff.
display_page('npc.tpl', 'Battle', array('npc_template' => $npc_template, 'attacked' => 1, 'turns' => $turns, 'random_encounter' => $random_encounter, 'health' => $health) + $combat_data, array('quickstat' => 'player'));
}
示例10: get_header
<?php
/**
* @package WordPress
* @subpackage Study Edge
* @since Study Edge 1.0
*/
/*
global $nav;
get_header();
$pages = dirname(__FILE__) . '/pages/';
require(file_exists($f = $pages . $nav->getActive() . '.php') ? $f : $pages . 'home.php');
get_footer();
*/
get_header();
display_page('home');
get_footer();
示例11: display_error
<?php
$private = false;
$alive = false;
if ($error = init($private, $alive)) {
display_error($error);
} else {
require_once LIB_ROOT . "control/lib_player_list.php";
require_once LIB_ROOT . "control/lib_player.php";
$player_size = player_size();
display_page('player-tags.tpl', 'Ninja List', array('player_size' => $player_size), array('quickstat' => false));
}
示例12: max
$limitvalue = (int) max(0, $page * $record_limit - $record_limit);
// Get the ninja information to create the lists.
$sel = "SELECT rank_id, rankings.uname, class.class_name as class, class.identity as class_identity, class.theme as class_theme, rankings.level, rankings.alive, rankings.days, clan_player._clan_id AS clan_id, clan.clan_name, players.player_id\n\tFROM rankings LEFT JOIN clan_player ON player_id = _player_id LEFT JOIN clan ON clan_id = _clan_id JOIN players on rankings.player_id = players.player_id JOIN class on class.class_id = players._class_id " . (count($where_clauses) ? " WHERE active = 1 AND " . implode($where_clauses, ' AND ') : "") . " ORDER BY rank_id ASC, player_id ASC\n\tLIMIT :limit OFFSET :offset";
$ninja_info = DatabaseConnection::$pdo->prepare($sel);
for ($i = 0; $i < count($queryParams); $i++) {
// *** Reformulate if queryParams gets to be more than 3 or for items
$ninja_info->bindValue(':param' . $i, $queryParams[$i]);
}
$ninja_info->bindValue(':limit', $record_limit);
$ninja_info->bindValue(':offset', $limitvalue);
$ninja_info->execute();
$last_page = $totalrows - $record_limit * $page > 0;
if (!$searched) {
// Will not display active ninja on a search page.
$active_ninjas = get_active_players(5, $alive_only);
// get the currently active ninjas
} else {
$active_ninjas = null;
}
// Format each of the player rows, then just pass 'em to the template.
$ninja_count = 0;
$player_rows = '';
$ninja_rows = array();
while ($a_player = $ninja_info->fetch()) {
$ninja_rows[] = format_ninja_row($a_player);
$ninja_rows[$ninja_count]['odd_or_even'] = ($ninja_count + 1) % 2 ? "odd" : "even";
$ninja_count++;
}
$parts = get_certain_vars(get_defined_vars(), $whitelist = array('ninja_rows', 'active_ninjas'));
display_page('list.tpl', 'Ninja List', $parts, array('quickstat' => false));
}
示例13: display_page
<?php
display_page('public.tpl', 'Public Discussion');
示例14: display_publication
function display_publication($query, $pageNum = 1)
{
global $config;
global $db;
$count_sql = 'SELECT COUNT(id) AS c FROM nz WHERE publication LIKE ' . $db->qstr($query . '%');
$sql = "SELECT * FROM nz WHERE publication LIKE " . $db->qstr($query . '%') . " ORDER BY year";
$q = do_query($query, $count_sql, $sql, $pageNum);
display_top($query);
display_search_box('publication');
echo '<h2>Showing results for publication "' . $query . '"</h2>';
display_pagination('publication', $q);
display_page($q);
display_pagination('publication', $q);
display_bottom();
}
示例15: removeItem
//non-covert acts
$player->subtractStatus(STEALTH);
$stealthLost = true;
} else {
$stealthLost = false;
}
}
}
$targetName = $targetObj->vo->uname;
$targetHealth = $targetObj->vo->health;
$targetHealthPercent = $targetObj->health_percent();
$turns_to_take = 1;
if ($item_used) {
// *** remove Item ***
removeItem($user_id, $item->getName(), 1);
// *** Decreases the item amount by 1.
}
if ($victim_alive && $using_item) {
$repeat = true;
}
}
}
}
// *** Take away at least one turn even on attacks that fail to prevent page reload spamming ***
if ($turns_to_take < 1) {
$turns_to_take = 1;
}
$ending_turns = subtractTurns($user_id, $turns_to_take);
assert($item->hasEffect('speed') || $ending_turns < $starting_turns || $starting_turns == 0);
display_page('inventory_mod.tpl', 'Item Usage', get_defined_vars(), array('quickstat' => 'player'));
}