本文整理汇总了PHP中display函数的典型用法代码示例。如果您正苦于以下问题:PHP display函数的具体用法?PHP display怎么用?PHP display使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了display函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: index
public function index()
{
global $_FANWE;
clearTempImage();
include template('page/index_index');
display();
}
示例2: run
public function run()
{
$project = 'test';
// Check for requested file
if (!empty($this->config->filename) && !file_exists($this->config->filename)) {
throw new NoSuchFile($this->config->filename);
} elseif (!empty($this->config->dirname) && !file_exists($this->config->dirname)) {
throw new NoSuchDir($this->config->filename);
}
// Check for requested analyze
$analyzer = $this->config->program;
if (Analyzer::getClass($analyzer)) {
$analyzers_class = array($analyzer);
} else {
$r = Analyzer::getSuggestionClass($analyzer);
if (count($r) > 0) {
echo 'did you mean : ', implode(', ', str_replace('_', '/', $r)), "\n";
}
throw new NoSuchAnalyzer($analyzer);
}
display("Cleaning DB\n");
$clean = new CleanDb($this->gremlin, $this->config, Tasks::IS_SUBTASK);
$clean->run();
$load = new Load($this->gremlin, $this->config, Tasks::IS_SUBTASK);
$load->run();
unset($load);
display("Project loaded\n");
$analyze = new Analyze($this->gremlin, $this->config, Tasks::IS_SUBTASK);
$analyze->run();
unset($analyze);
$results = new Results($this->gremlin, $this->config, Tasks::IS_SUBTASK);
$results->run();
unset($results);
display("Analyzed project\n");
}
示例3: message
function message($mes, $title = 'Error', $dest = "", $time = "3", $show_header = true)
{
$parse['title'] = $title;
$parse['mes'] = $mes;
$page .= parsetemplate(gettemplate('message_body'), $parse);
display($page, $title, $show_header, $dest != "" ? "<meta http-equiv=\"refresh\" content=\"{$time};url={$dest}\">" : "", false);
}
示例4: ShowGouv
function ShowGouv($user)
{
global $dpath, $lang;
includeLang('INGAME');
$mode = $_GET['mode'];
if ($_POST && $mode == "change") {
$iduser = $user["id"];
$SetSort = intval($_POST['settings_sort']);
if ($user['staatsform'] < 1) {
doquery("UPDATE {{table}} SET `staatsform` = '.{$SetSort}.' WHERE `id` = '.{$iduser}.' LIMIT 1", 'users');
message($lang['erfolgreichestaatsformwahl'], $lang['Staatsform']);
dispay(gettemplate('staatsform_confirm'), 'Confirmation', false);
} else {
message($lang['badstaatsformwahl'], $lang['Staatsform']);
}
} else {
$parse = $lang;
$parse['dpath'] = $dpath;
$parse['staatsformeins'] = "<option value =\"1\"" . ($user['staatsform'] == 1 ? " selected" : "") . ">" . $lang['barbarisch'] . "</option>";
$parse['staatsformeins'] .= "<option value =\"2\"" . ($user['staatsform'] == 2 ? " selected" : "") . ">" . $lang['demokratie'] . "</option>";
$parse['staatsformeins'] .= "<option value =\"3\"" . ($user['staatsform'] == 3 ? " selected" : "") . ">" . $lang['monarchie'] . "</option>";
$parse['staatsformeins'] .= "<option value =\"4\"" . ($user['staatsform'] == 4 ? " selected" : "") . ">" . $lang['diktatur'] . "</option>";
$parse['staatsformeins'] .= "<option value =\"5\"" . ($user['staatsform'] == 5 ? " selected" : "") . ">" . $lang['imperialisme'] . "</option>";
$parse['staatsformeins'] .= "<option value =\"6\"" . ($user['staatsform'] == 6 ? " selected" : "") . ">" . $lang['aristocratie'] . "</option>";
display(parsetemplate(gettemplate('staatsform_body'), $parse), 'Gouvernement', false);
}
}
示例5: decentNumber
function decentNumber($n)
{
$fives = 0;
$threes = 0;
$max = 0;
if ($n / 3 == 0) {
$fives = $n;
display($fives, $threes);
return true;
}
$max = floor($n / 3);
for ($max; $max > 0; $max--) {
$fives = $max * 3;
$threes = $n - $fives;
if ($threes % 5 == 0) {
display($fives, $threes);
return true;
}
}
$max = floor($n / 5);
for ($max; $max >= 1; $max--) {
$threes = $max * 5;
$fives = $n - $threes;
if ($fives % 3 == 0) {
display($fives, $threes);
return true;
}
}
return false;
}
示例6: ShowTechTreePage
function ShowTechTreePage($CurrentUser, $CurrentPlanet)
{
global $resource, $requeriments, $lang;
$parse = $lang;
foreach ($lang['tech'] as $Element => $ElementName) {
$parse = array();
$parse['tt_name'] = $ElementName;
if (!isset($resource[$Element])) {
$parse['Requirements'] = $lang['tt_requirements'];
$page .= parsetemplate(gettemplate('techtree/techtree_head'), $parse);
} else {
if (isset($requeriments[$Element])) {
$parse['required_list'] = "";
foreach ($requeriments[$Element] as $ResClass => $Level) {
if (isset($CurrentUser[$resource[$ResClass]]) && $CurrentUser[$resource[$ResClass]] >= $Level) {
$parse['required_list'] .= "<font color=\"#00ff00\">";
} elseif (isset($CurrentPlanet[$resource[$ResClass]]) && $CurrentPlanet[$resource[$ResClass]] >= $Level) {
$parse['required_list'] .= "<font color=\"#00ff00\">";
} else {
$parse['required_list'] .= "<font color=\"#ff0000\">";
}
$parse['required_list'] .= $lang['tech'][$ResClass] . " (" . $lang['tt_lvl'] . $Level . ")";
$parse['required_list'] .= "</font><br>";
}
} else {
$parse['required_list'] = "";
$parse['tt_detail'] = "";
}
$parse['tt_info'] = $Element;
$page .= parsetemplate(gettemplate('techtree/techtree_row'), $parse);
}
}
$parse['techtree_list'] = $page;
return display(parsetemplate(gettemplate('techtree/techtree_body'), $parse));
}
示例7: display
public function display($tpl = '')
{
foreach ($this->arrays as $key => $value) {
${$key} = $value;
}
include display($tpl);
}
示例8: run
public function run()
{
if ($this->config->project === 'default') {
throw new ProjectNeeded();
}
$path = $this->config->projects_root . '/projects/' . $this->config->project;
if (!file_exists($path)) {
throw new NoSuchProject($this->config->project);
}
display("Cleaning project {$this->config->project}\n");
$dirsToErase = array('log', 'report', 'Premier-ace', 'faceted', 'faceted2', 'ambassador');
foreach ($dirsToErase as $dir) {
$dirPath = $path . '/' . $dir;
if (file_exists($dirPath)) {
display('removing ' . $dir);
rmdirRecursive($dirPath);
}
}
// rebuild log
mkdir($path . '/log', 0755);
$filesToErase = array('Flat-html.html', 'Flat-markdown.md', 'Flat-sqlite.sqlite', 'Flat-text.txt', 'Premier-ace.zip', 'Premier-html.html', 'Premier-markdown.md', 'Premier-sqlite.sqlite', 'Premier-text.txt', 'datastore.sqlite', 'magicnumber.sqlite', 'report.html', 'report.md', 'report.odt', 'report.pdf', 'report.sqlite', 'report.txt', 'report.zip', 'EchoWithConcat.json', 'PhpFunctions.json', 'bigArrays.txt', 'counts.sqlite', 'stats.txt', 'dump.sqlite', 'faceted.zip', 'faceted2.zip');
$total = 0;
foreach ($filesToErase as $file) {
$filePath = $path . '/' . $file;
if (file_exists($filePath)) {
display('removing ' . $file);
unlink($filePath);
++$total;
}
}
display("Removed {$total} files\n");
$this->datastore = new Datastore($this->config, Datastore::CREATE);
display("Recreating database\n");
}
示例9: learn
function learn($letters, Perceptron $perceptron)
{
$learnFor = 11;
$iterations = 100;
display($perceptron->weights);
for ($i = 0; $i <= $iterations; $i++) {
foreach ($letters as $letterNumber => $fonts) {
$isCorrect = $letterNumber == $learnFor;
foreach ($fonts as $letter) {
//if ($i % 250 == 0)
// display($letter, '#999');
$perceptronResponse = $perceptron->calculate($letter);
if ($perceptronResponse == $isCorrect) {
//if ($i % 250 == 0)
// display($perceptron->weights, 'green');
continue;
}
//if ($i % 250 == 0)
//display($perceptron->weights, 'red');
$perceptron->correctWeights($letter, (int) $isCorrect, (int) $perceptronResponse);
}
}
//if ($i % 250 == 0)
// display($perceptron->weights);
}
display($perceptron->weights);
}
示例10: DisplayGameSettingsPage
function DisplayGameSettingsPage($CurrentUser)
{
global $lang, $game_config, $_POST, $Adminerlaubt, $user;
includeLang('admin/einstellung/einstellung_az');
if ($user['authlevel'] >= 1 and in_array($user['id'], $Adminerlaubt)) {
if ($_POST['opt_save'] == "1") {
if (isset($_POST['angriffszone']) && $_POST['angriffszone'] == 'on') {
$game_config['angriffszone'] = "1";
} else {
$game_config['angriffszone'] = "0";
}
doquery("UPDATE {{table}} SET `config_value` = '" . $game_config['angriffszone'] . "' WHERE `config_name` = 'angriffszone';", 'config');
AdminMessage($lang['speichern'][100], $lang['speichern'][101], '?');
} else {
$parse = $lang;
$parse['angriffszone'] = $game_config['angriffszone'] == 1 ? " checked = 'checked' " : "";
$PageTPL = gettemplate('admin/einstellung/einstellung_az');
$Page .= parsetemplate($PageTPL, $parse);
display($Page, $lang['adm_opt_title'], false, '', true);
}
} else {
AdminMessage($lang['system'][9000], $lang['system'][9001]);
}
return $Page;
}
示例11: authorize
function authorize()
{
//如果未登录,展示登录页
display('oauth_response_user_check');
//如果已登录,展示授权页
display('oauth_response_user_check');
}
示例12: __construct
public function __construct($data)
{
if (isset($data['session'])) {
$guid = $data['guid'];
$title = $data['blog_title'];
$description = $data['description'];
$access_id = $data['access_id'];
$user = getUserFromSession($data['session']);
if (!$guid) {
$blog = new Blog();
$blog->owner_guid = $user->guid;
$blog->save();
} else {
$blog = getEntity($guid);
}
if ($blog->owner_guid == $user->guid) {
$blog->title = $title;
$blog->description = $description;
$blog->access_id = $access_id;
$blog->status = "draft";
$guid = $blog->save();
$blog = getEntity($guid);
echo json_encode(array("guid" => $guid, "timeago" => display("output/friendly_time", array("timestamp" => $blog->last_updated))));
}
}
}
示例13: index
function index()
{
$space_id = false;
$location_id = false;
$exact_date = date('Y-m-d');
$spaces = $this->spacemodel->wpGetSpacesList();
$locations = $this->locationmodel->wpGetLocationsList();
// Process a user reservation
if (!empty($_REQUEST['data'])) {
$data = $_REQUEST['data'];
if (!empty($data['space_id'])) {
$space_id = (int) $data['space_id'];
}
if (!empty($data['location_id'])) {
$location_id = (int) $data['location_id'];
}
if (!isset($spaces[(int) $space_id])) {
$space_id = false;
}
if (!isset($locations[(int) $location_id])) {
$location_id = false;
}
if (!empty($data['exact_date'])) {
$exact_date = date('Y-m-d', strtotime((string) $data['exact_date']));
}
}
// Get data for the page
$reservations = $this->reservationmodel->wpGetReservations(compact('space_id', 'location_id', 'exact_date'));
list($capacity, $spacesLeft) = $this->reservationmodel->reservationsLeft($exact_date, $location_id);
$data = compact('spaces', 'locations', 'reservations', 'location_id', 'space_id', 'exact_date', 'capacity', 'spacesLeft');
display('admin/reservations', $data, "Reservations");
}
示例14: dashboard
function dashboard()
{
$this->load->model("locationmodel");
$this->load->model("billing/planmodel", '', true);
$this->load->model("issuesmodel");
$this->load->model("lookuptablemodel");
/*****************************************
* CHECKIN MODULE
****************************************/
$locationId = $this->locationmodel->getCurrentLocation();
//echo "locationId = $locationId";
$data["location"] = $this->locationmodel->getLocation($locationId);
$data["signedInMembers"] = $this->locationmodel->whosHere($locationId, 12);
/*****************************************
* ISSUES MODULE
****************************************/
$data["issues"] = $this->issuesmodel->getMemberIssues(true, 0, 5);
/*****************************************
* CONFERENCE ROOMS MODULE
****************************************/
$data["location"]->conferencerooms = $this->locationmodel->getConferenceRooms(true, $locationId);
/*****************************************
* PRICING MODULE
****************************************/
$data["accesspricing"] = $this->locationmodel->getAccessPricing();
$data["plans"] = $this->planmodel->get_plans();
$data["admin_only"] = true;
display('admin/dashboard.php', $data, "Front Desk Dashboard");
}
示例15: ShowTopKB
function ShowTopKB()
{
global $lang;
//anzeige der Top 100 Liste
includeLang('INGAME');
$parse = $lang;
$RowsTPL = gettemplate('topkb/topkb_rows');
$top = doquery("SELECT * FROM {{table}} ORDER BY gesamtunits DESC LIMIT 100;", 'topkb');
$a = 0;
while ($data = mysql_fetch_array($top)) {
$a++;
$timedeut = date("D d M H:i:s", $data['time']);
$user1 = doquery("SELECT * FROM {{table}} WHERE username='" . $data[2] . "';", 'users', true);
if ($data['fleetresult'] == "a" and $user1['hof'] == 1) {
$bloc['top_fighters'] = "<a href=\"javascript:f('topkbuser.php?mode=" . $data['rid'] . "', '');\"><font color=\"green\">" . $data['angreifer'] . "</font><b> VS </b><font color=\"red\">" . $data['defender'] . "</font></a>";
} else {
if ($data['fleetresult'] == "r" and $user1['hof'] == 1) {
$bloc['top_fighters'] = "<a href=\"javascript:f('topkbuser.php?page=showtopkb&mode=" . $data['rid'] . "', '');\"><font color=\"red\">" . $data['angreifer'] . "</font><b> VS </b><font color=\"green\">" . $data['defender'] . "</font></a>";
} else {
if ($data['fleetresult'] == "w" and $user1['hof'] == 1) {
$bloc['top_fighters'] = "<a href=\"javascript:f('topkbuser.php?mode=" . $data['rid'] . "', '');\">" . $data['angreifer'] . "<b> VS </b>" . $data['defender'] . "</a>";
}
}
}
$bloc['top_rank'] = $a;
$bloc['top_time'] = $timedeut;
$bloc['top_units'] = pretty_number($data['gesamtunits']);
$bloc['underrow'] = $lang['grata'] . "test";
// date("r", $data['time']);
$parse['top_list'] .= parsetemplate($RowsTPL, $bloc);
}
display(parsetemplate(gettemplate('topkb/topkb'), $parse), false);
}