本文整理汇总了PHP中Core::display方法的典型用法代码示例。如果您正苦于以下问题:PHP Core::display方法的具体用法?PHP Core::display怎么用?PHP Core::display使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Core
的用法示例。
在下文中一共展示了Core::display方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: run
public function run()
{
$static_found = false;
foreach (Core::get_system('static_views') as $view) {
/** Verify a static template for the url does not exist */
$dir = opendir(Core::get_system('views') . '/' . $view);
while ($file = readdir($dir)) {
/** This is a template file that has a url specific extension */
$exploded = explode('.', $file);
if (strpos($file, '.tpl') && $exploded[1] === current(Core::get_args())) {
$static_found = true;
}
}
closedir($dir);
if ($static_found) {
break;
}
}
/** Handle 404 Errors */
if (current(Core::get_args()) !== 'default' && $static_found === false) {
Core::error('404');
} else {
/** Display the default page or 404*/
Core::display();
}
}
示例2: run
/** Default test functionality */
public function run()
{
$value = Core::get_args(1);
$use = array('date', 'email', 'ip', 'url', 'password', 'username', 'name', 'alpha', 'numeric', 'int', 'float', 'alphanumeric');
$results = array();
foreach (get_class_methods(get_class($this)) as $method) {
if (method_exists($this, $method) && in_array($method, $use)) {
$results[$method] = $this->{$method}($value);
}
}
Core::set_response($results);
Core::display('json');
}
示例3: foreach
foreach ($itemsdb as $item) {
$val = explode("=", $item);
$opvalue += $allitems[$val[0]] * $val[1];
}
$opvalue = number_format($opvalue, 0);
// Display to the user
$core->assign("opdate", $opdate);
$core->assign("players", $players);
$core->assign("items", $itemsdisplay);
$core->assign("notes", $notes);
$core->assign("opvalue", $opvalue);
}
$result = $core->SQL("SELECT * FROM `operations_groups` WHERE Active = 1 ORDER BY `DisplayOrder`, `GroupID`");
while ($row = mysql_fetch_assoc($result)) {
$ogroupid[$row['id']] = $row['id'];
$ogroupName[$row['id']] = $core->SQLUnEscape($row['Name']);
$ogroupSubtext[$row['id']] = $core->SQLUnEscape($row['Subtext']);
$ogroupGroupID[$row['id']] = $row['GroupID'];
$ogroupDisplayOrder[$row['id']] = $row['DisplayOrder'];
$ogroupCheckbox[$row['id']] = $row['Checkbox'];
}
$core->assign("ogroupid", $ogroupid);
$core->assign("ogroupName", $ogroupName);
$core->assign("ogroupSubtext", $ogroupSubtext);
$core->assign("ogroupGroupID", $ogroupGroupID);
$core->assign("ogroupDisplayOrder", $ogroupDisplayOrder);
$core->assign("ogroupCheckbox", $ogroupCheckbox);
$core->assign("action", $action);
$core->assign("result", @$_GET["result"]);
$core->display($core->PlugInPath . "payoutsubmission/payoutsubmission.tpl");
示例4: cmp
$ops = array();
$total = 0;
while ($row = mysql_fetch_assoc($result)) {
$opvalue = 0;
$players = array();
$playersdb = explode(",", $row["Players"]);
foreach ($playersdb as $player) {
$players[] = $names[$player];
}
$items = array();
$itemsdb = explode(",", $row["Items"]);
foreach ($itemsdb as $item) {
$val = explode("=", $item);
$items[$val[0]] = $val[1];
$opvalue += $allitems[$val[0]] * $val[1];
}
$total += $opvalue;
$opvalue = number_format($opvalue, 0);
$ops[] = array("ID" => $row["id"], "Value" => $opvalue, "Leader" => $names[$row["Leader"]], "Players" => implode(",", $players), "Date" => $core->GMTToLocal($row["Date"]), "OpDate" => $row["OpDate"], "Notes" => $core->SQLUnEscape($row["Notes"]));
}
$total = number_format($total, 0);
$core->assign("total", $total);
$core->assign("ops", $ops);
$core->assign("opcount", count($ops));
}
$core->assign("action", $action);
$core->display($core->PlugInPath . "payoutmanagement/payoutmanagement.tpl");
function cmp($a, $b)
{
return strcasecmp($a[1], $b[1]);
}
示例5: elseif
$result = 4;
} elseif ($_POST["password1"] != $_POST["password2"]) {
$result = 5;
} else {
$result = $cms->CoreSQL("SELECT * FROM users WHERE Name='" . $cms->SQLEscape($_POST["username"]) . "' OR FIND_IN_SET('" . $cms->SQLEscape($_POST["username"]) . "', Alts) LIMIT 1");
if (mysql_num_rows($result) == 0) {
$result = 6;
} else {
$res = $cms->GetUserCharacters($_POST["apiuserid"], $_POST["apikey"]);
if ($res === FALSE) {
$result = 2;
} elseif (empty($res)) {
$result = 3;
} elseif (count($res) > 0) {
foreach ($res as $char) {
if ($char["Name"] == $_POST["username"]) {
$result = 8;
$cms->CoreSQL("UPDATE users SET Password='" . md5($_POST["password1"]) . "' WHERE Name='" . $cms->SQLEscape($_POST["username"]) . "' OR FIND_IN_SET('" . $cms->SQLEscape($_POST["username"]) . "', Alts) LIMIT 1");
break;
}
}
if ($result != 8) {
$result = 6;
}
}
}
}
}
$cms->assign('result', $result);
$cms->display('newpassword.tpl');
示例6: elseif
$cms->assign("allusers", $cms->GetRegisteredUserNames());
}
}
} elseif ($step == 3) {
$cms->assign("charid", $_POST["char"]);
$cms->assign("charname", $_POST["name_" . $_POST["char"]]);
$cms->assign("corpname", $_POST["corp_" . $_POST["char"]]);
$cms->assign("corpticker", $_POST["corpticker_" . $_POST["char"]]);
$cms->assign("corpid", $_POST["corpid_" . $_POST["char"]]);
if ($cms->CharacterIDExists($_POST["char"])) {
$res = $cms->GetUserCharacters($_POST["apiuserid"], $_POST["apikey"]);
$cms->assign("characters", $res);
$cms->assign("allusers", $cms->GetRegisteredUserNames());
$result = 8;
$step = 2;
}
} elseif ($step == 4) {
if (empty($_POST["password1"]) || empty($_POST["password2"])) {
$result = 6;
$step = 3;
} elseif ($_POST["password1"] != $_POST["password2"]) {
$result = 7;
$step = 3;
} else {
$cms->RegisterNewUser($_POST["apiuserid"], $_POST["apikey"], $_POST["charid"], $_POST["charname"], $_POST["password1"], $_POST["corpid"], $_POST["corpname"], $_POST["corpticker"]);
}
}
$cms->assign("step", $step);
$cms->assign("result", $result);
$cms->display('register.tpl');
示例7: error
public static function error($type)
{
self::run_hook('core_error', array($type));
switch ($type) {
case '403':
self::run_hook('core_error_403', array($type));
header('HTTP/1.0 403 Forbidden');
Core::set_args(array('403'));
Core::display();
break;
case '404':
self::run_hook('core_error_404', array($type));
header('HTTP/1.0 404 Not Found');
Core::set_args(array('404'));
Core::display();
break;
}
}
示例8: Core
<?php
require_once '../core/core.class.php';
$cms = new Core();
if (!$cms->AccessCheck()) {
header("Location: access.php");
exit;
}
$article = $cms->ReadArticle(3);
$cms->assign("quickinfo", $article);
$cms->display('quickinfo.tpl');
示例9: elseif
$cms->Goto("articles.php");
}
} elseif ($_POST["submit"] == "Delete" && is_numeric(@$_POST["id"])) {
$cms->DeleteArticle($_POST["id"]);
$cms->Goto("articles.php");
} else {
$cms->Goto("articles.php");
}
} elseif ($action == "newcomment" && is_numeric(@$_POST["article"])) {
$id = $_POST["article"];
$text = @$_POST["text"];
if (!empty($text)) {
$cms->NewArticleComment($id, $text);
}
$cms->Goto("articles.php?read=" . $id);
}
if (!isset($_POST["readaccess"])) {
$_POST["readaccess"] = 2;
}
if (!isset($_POST["writeaccess"])) {
$_POST["writeaccess"] = 4;
}
$cms->assign("action", $action);
$cms->assign("result", $result);
$cms->assign("id", @$_POST["id"]);
$cms->assign("title", @$_POST["title"]);
$cms->assign("text", @$_POST["text"]);
$cms->assign("readaccess", @$_POST["readaccess"]);
$cms->assign("writeaccess", @$_POST["writeaccess"]);
$cms->display('articles.tpl');
示例10: search
public function search()
{
/** Do we have a search string and a model to search? */
if (isset($_GET['query']) && isset($this->model)) {
$query = urldecode($_GET['query']);
$model = Model::load($this->model);
$search_fields = array();
foreach ($model->getSchema() as $key => $val) {
foreach ($val as $k => $v) {
if ($k == 'search' && $v) {
$search_fields[] = $key;
break;
}
}
}
$search_on = array();
foreach ($_GET as $key => $value) {
if (in_array($key, $search_fields)) {
$search_on[] = $key;
}
}
if (count($search_on) === 0) {
$search_on = $search_fields;
}
$where = array();
foreach ($search_on as $key) {
$where[$key] = $query;
}
Core::set_response($model->get(array('where' => $where, 'search' => true)));
Core::display('json');
}
}
示例11: Core
<?php
require_once '../core/core.class.php';
$cms = new Core();
if (isset($_GET["delete"]) && is_numeric(@$_GET["delete"]) && $cms->CurrentUser()->HasPortalRole(User::MDYN_Administrator)) {
$cms->CoreSQL("DELETE FROM feedback WHERE id=" . $_GET["delete"] . " LIMIT 1");
$cms->Goto("feedback.php");
} elseif ($cms->CurrentUser()->HasPortalRole(User::MDYN_Administrator)) {
$feedbacks = array();
$result = $cms->CoreSQL("SELECT * FROM feedback");
while ($row = mysql_fetch_assoc($result)) {
$feedbacks[] = array($cms->SQLUnEscape($row["Name"]), $cms->SQLUnEscape($row["EMail"]), $cms->SQLUnEscape($row["APIUserID"]), $cms->SQLUnEscape($row["APIKey"]), $cms->SQLUnEscape($row["Notes"]), $row["id"], $cms->GMTToLocal($row["Date"]));
}
$cms->assign("feedbacks", $feedbacks);
} elseif (@$_GET["result"] == "1") {
$cms->assign("result", 1);
} elseif (@$_POST["submit"] == "Submit") {
$query = "INSERT INTO feedback (Date,Name,Email,APIUserID,APIKey,Notes) VALUES (";
$query .= "'" . $cms->GMTTime() . "',";
$query .= "'" . $cms->SQLEscape($_POST["name"]) . "',";
$query .= "'" . $cms->SQLEscape($_POST["email"]) . "',";
$query .= "'" . $cms->SQLEscape($_POST["apiuserid"]) . "',";
$query .= "'" . $cms->SQLEscape($_POST["apikey"]) . "',";
$query .= "'" . $cms->SQLEscape($_POST["notes"]) . "')";
$cms->CoreSQL($query);
$cms->Goto("feedback.php?result=1");
}
$cms->display('feedback.tpl');
示例12: Core
<?php
require_once '../core/core.class.php';
$cms = new Core();
$cms->display('notfound.tpl');
示例13: GetSkillInTraining
// Online characters
$onlinechars = "";
$chars = $cms->GetOnlineCharacters();
if (!empty($chars)) {
$onlinechars = "<p>";
foreach ($chars as $id => $char) {
$onlinechars .= "<a href=\"profile.php?user=" . $id . "\">" . $char . "</a><br />";
}
$onlinechars .= "</p>";
}
$cms->assign('onlinechars', $onlinechars);
// Plug-in XML feeds
$feeds = $cms->ReadPlugInFeedbacks();
$cms->assign('pluginfeeds', $feeds);
}
$cms->display('home.tpl');
// *******************************************************
// Returns the skill in training
// *******************************************************
function GetSkillInTraining()
{
global $cms;
if ($cms->CurrentUser()->IsGuest) {
return "";
}
$raw = $cms->APIQuery("http://api.eve-online.com/char/SkillInTraining.xml.aspx");
if ($raw == FALSE) {
return array(0, "<p>Could not connect to the API server.</p>");
}
$xml = new SimpleXMLElement($raw);
if ((int) $xml->error['code'] > 0) {
示例14: Core
<?php
require_once '../core/core.class.php';
$cms = new Core();
$article = $cms->ReadArticle(2);
$cms->assign("policies", $article);
$cms->display('policies.tpl');
示例15: changeprice
$eveprices[] = array("UnitPrice" => number_format($unit, 2), "Quantity" => number_format($row["Quantity"], 0), "Cost" => number_format($price, 0), "EveTypeID" => $row["EveTypeID"], "Name" => $core->SQLUnEscape($row["Name"]), "Icon" => $row["Icon"]);
}
mysql_free_result($result);
$core->assign("eveprices", $eveprices);
$core->assign("totaleveprice", number_format($total));
} elseif ($action == "editdone") {
if ($_POST["submit"] == "Save") {
$id = $_POST["id"];
$price = $_POST["price"];
$allyprice = $_POST["allyprice"];
$core->SQL("UPDATE production_items SET Price=" . $price . ",AlliancePrice=" . $allyprice . " WHERE id=" . $id . " LIMIT 1");
}
$core->Goto("index.php");
}
$core->assign('action', $action);
$core->display($core->PlugInPath . "productionprices/productionprices.tpl");
// *************************************************************************
// Update's the Production Item's Price in the "production_items" database
// *************************************************************************
function changeprice($id, $percent, $group)
{
global $core;
// $id = $_GET["edit"];
$result = $core->SQL("SELECT EveTypeID,Name,Price,AlliancePrice,GroupName FROM production_items WHERE id=" . $id);
$row = mysql_fetch_assoc($result);
$eveid = $row["EveTypeID"];
$core->assign("id", $id);
$core->assign("name", $core->SQLUnEscape($row["Name"]));
$core->assign("groupname", $core->SQLUnEscape($row["GroupName"]));
$core->assign("price", number_format($row["Price"], 0, '.', ''));
$core->assign("allyprice", number_format($row["AlliancePrice"], 0, '.', ''));