本文整理汇总了PHP中draw_page函数的典型用法代码示例。如果您正苦于以下问题:PHP draw_page函数的具体用法?PHP draw_page怎么用?PHP draw_page使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了draw_page函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: email_post
function email_post($to, $subject = false, $from = false)
{
global $_POST;
if (!$subject) {
$subject = "Form Submission from " . $_josh["domainname"];
}
email($to, draw_page($subject, draw_array($_POST), false, true), $subject, $from);
}
示例2: error_handle
function error_handle($type, $message, $run_trace = true)
{
global $_josh;
if ($run_trace) {
$backtrace = debug_backtrace();
$level = count($backtrace) - 1;
$message .= " on line " . $backtrace[$level]["line"] . " of file " . $backtrace[$level]["file"];
}
if (function_exists("error_email")) {
$email = $message;
$email .= "<br><br>Of page: <a href='" . $_josh["request"]["uri"] . "'>" . $_josh["request"]["uri"] . "</a>";
$email .= "<br><br>Encountered by user: <!--user-->";
error_email(draw_page($type, $email, true, true));
}
if (isset($_josh["mode"]) && $_josh["mode"] == "dev") {
draw_page($type, $message, true);
}
}
示例3: __on_err
function __on_err($errtype, $errmsg, $errfile, $errline)
{
global $DEBUG, $title, $body;
switch ($errtype) {
case E_USER_ERROR:
case E_USER_WARNING:
$title = 'RPG Web Profiler Error';
if ($DEBUG) {
$errmsg .= "\n\nThis error occurred at line {$errline} of file {$errfile}.";
}
$body = nl2br(htmlspecialchars($errmsg));
draw_page('error.php');
exit;
break;
case E_USER_NOTICE:
default:
// Smarty can generate alot of NOTICE errors, so we ignore them.
}
}
示例4: SId
<?php
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
include_once "config.php";
include_once "{$INCLUDE_PATH}/system.php";
include_once "{$INCLUDE_PATH}/engine/sid.class.php";
include_once "{$INCLUDE_PATH}/engine/templates.php";
include_once "{$INCLUDE_PATH}/userstats.php";
global $URI_BASE, $URI_HOME, $LOGO;
$title = 'Index - News';
// Attempt to respawn a session.
$sid = new SId();
if ($sid->IsSessionValid()) {
draw_page('login_forward.php');
} else {
draw_page('index.php');
}
示例5: SId
<?php
include_once "config.php";
include_once "{$INCLUDE_PATH}/system.php";
include_once "{$INCLUDE_PATH}/error.php";
include_once "{$INCLUDE_PATH}/engine/sid.php";
include_once "{$INCLUDE_PATH}/engine/validation.php";
include_once "{$INCLUDE_PATH}/engine/campaign.class.php";
include_once "{$INCLUDE_PATH}/engine/character.class.php";
include_once "{$INCLUDE_PATH}/engine/templates.php";
include_once "{$INCLUDE_PATH}/engine/serialization.php";
// Try to respawn a session to keep the menu nav in context.
$sid = new SId();
if ($REQUIRE_LOGIN && !$sid->IsSessionValid()) {
draw_page('login_required.php');
exit;
}
// Validate permission for the requested character.
$id = (int) $_POST['id'];
if (!$id) {
$id = (int) $_GET['id'];
}
$campaign = new Campaign($id);
if ($sid->GetUserName() != $campaign->owner) {
draw_page('view_campaign_error.php');
exit;
}
$title = $campaign->cname;
draw_page('campaign_summary.php');
示例6: include_stylesheet_dir
echo include_stylesheet_dir("stylesheets", $debug);
check_validated();
//Any pre-page logic should go here!
if (isset($_POST['addpoints-submit'])) {
add_points(strtolower($_POST['note']), $_POST['value'], $_GET['user_id']);
}
if (isset($_POST['removepoints-submit'])) {
remove_points($_POST['point_id']);
}
if (count($_SESSION['notifications']) != 0) {
draw_notification();
}
if (isset($_GET['user_id'])) {
$userinfo = get_user_info($_GET['user_id']);
}
draw_page($userinfo);
close_page();
ob_end_flush();
// Flush the buffer out to client
document_footer();
mysql_end();
function draw_page($userinfo)
{
?>
<div class="container">
<?php
//Fetch the points total for this user
$points = get_points_total($userinfo['user_id']);
echo '<h3>';
echo $userinfo['fname'] . ' ' . $userinfo['lname'];
echo ' <small>' . $points . ' points</small>';
示例7: print_upload_success
function print_upload_success($sid)
{
global $title;
$title = 'Data Upload';
draw_page('upload_success.php');
exit;
}
示例8: draw_page
draw_page('del_confirm.php');
} else {
// Confirmation received, delete the user's permission for the character.
$_r = $rpgDB->query(sprintf("DELETE FROM %s WHERE cid = %d AND pname = '%s' LIMIT 1", $TABLE_OWNERS, (int) $id, addslashes($sid->GetUserName())));
if (!$_r) {
__printFatalErr("Failed to update database.", __LINE__, __FILE__);
}
// If the user is the owner of the character remove the character data.
$removed = false;
$_r = $rpgDB->query(sprintf("select owner from %s where id = %d", $TABLE_CHARS, (int) $id));
if (!$_r) {
__printFatalErr("Failed to query database.", __LINE__, __FILE__);
}
$row = $rpgDB->fetch_row($_r);
if ($row['owner'] == $sid->GetUserName()) {
// Remove the character.
$_r = $rpgDB->query(sprintf("DELETE FROM %s WHERE id = %d LIMIT 1", $TABLE_CHARS, (int) $id));
if (!$_r) {
__printFatalErr("Failed to query database.", __LINE__, __FILE__);
}
// Delete all editors
$_r = $rpgDB->query(sprintf("DELETE FROM %s WHERE cid = %d", $TABLE_OWNERS, (int) $id));
if (!$_r) {
__printFatalErr("Failed to query database.", __LINE__, __FILE__);
}
$removed = true;
}
// Draw the result screen.
$title = 'Remove Character';
draw_page('del.php');
}
示例9: Campaign
if ($pending_campaign != null) {
$campaign = new Campaign((int) $pending_campaign['campaign_id']);
}
}
// Draw the page.
$title = 'Character Permissions';
$cname = $character->cname;
$is_public = $character->public == 'y';
$is_inactive = $character->inactive == 'y';
$is_owner = $character->owner == $sid->GetUserName();
$profiles = $character->GetProfiles();
$templates = generate_template_array();
$current_template = get_sheet_name($character->template_id);
$exp_formats = get_export_scripts();
$imp_formats = get_import_scripts();
draw_page('char.php');
////////////////////////////////////////////////////////////////////////
// Helper functions.
// Remove a character from the current campaign they are in.
function apply_leave_campaign(&$character)
{
return $character->SetCampaign(null);
}
// Apply to Join the specified campaign
function apply_join_campaign(&$character, $campaign_id)
{
$campaign = new Campaign($campaign_id);
if (!$campaign->open) {
return "Campaign " . $campaign->cname . " not open for registration!";
}
if ($character->JoinCampaign($campaign_id, "RJ")) {
示例10: format_image_resize
function format_image_resize($source, $max_width = false, $max_height = false)
{
if (!function_exists('imagecreatefromjpeg')) {
error_handle('library missing', 'the GD library needs to be installed to run format_image_resize', __FILE__, __LINE__);
}
if (empty($source)) {
return null;
}
if (!function_exists('resize')) {
function resize($new_width, $new_height, $source_name, $target_name, $width, $height)
{
//resize an image and save to the $target_name
$tmp = imagecreatetruecolor($new_width, $new_height);
if (!($image = imagecreatefromjpeg(DIRECTORY_ROOT . $source_name))) {
error_handle('could not create image', 'the system could not create an image from ' . $source_name, __FILE__, __LINE__);
}
imagecopyresampled($tmp, $image, 0, 0, 0, 0, $new_width, $new_height, $width, $height);
imagejpeg($tmp, DIRECTORY_ROOT . $target_name, 100);
imagedestroy($tmp);
imagedestroy($image);
}
function crop($new_width, $new_height, $target_name)
{
//crop an image and save to the $target_name
list($width, $height) = getimagesize(DIRECTORY_ROOT . $target_name);
//by default, crop from center
$offsetx = ($width - $new_width) / 2;
$offsety = ($height - $new_height) / 2;
if ($offsetx < 0) {
$offsetx = 0;
}
if ($offsety < 0) {
$offsety = 0;
}
//this crops from top-left
//$offsetx = $offsety = 0;
$tmp = imagecreatetruecolor($new_width, $new_height);
if (!($image = @imagecreatefromjpeg(DIRECTORY_ROOT . $target_name))) {
error_handle('could not create image', 'the system could not create an image from ' . $source_name, __FILE__, __LINE__);
}
imagecopyresized($tmp, $image, 0, 0, $offsetx, $offsety, $new_width, $new_height, $new_width, $new_height);
imagejpeg($tmp, DIRECTORY_ROOT . $target_name, 100);
imagedestroy($tmp);
imagedestroy($image);
}
}
//save to file, is file-based operation, unfortunately
$source_name = DIRECTORY_WRITE . '/temp-source.jpg';
$target_name = DIRECTORY_WRITE . '/temp-target.jpg';
file_put($source_name, $source);
//get source image dimensions
list($width, $height) = getimagesize(DIRECTORY_ROOT . $source_name);
if (!$width || !$height) {
// image is probably corrupt
echo draw_page('image corrupt', 'the uploaded image cannot be read, try opening the image in photo editing software, re-saving it, and then try again');
exit;
}
//execute differently depending on target parameters
if ($max_width && $max_height) {
//resizing both
if ($width == $max_width && $height == $max_height) {
//already exact width and height, skip resizing
copy(DIRECTORY_ROOT . $source_name, DIRECTORY_ROOT . $target_name);
} else {
//this was for the scenario where your target was a long landscape and you got a squarish image.
//this doesn't work if your target is squarish and you get a long landscape
//maybe we need a ratio function?
//square to long scenario: input 400 x 300 (actual 1.3 ratio), target 400 x 100 (target 4) need to resize width then crop target > actual
//long to square scenario: input 400 x 100 (actual 4 ratio), target 400 x 300 (target 1.3) need to resize height then crop target < actual
$target_ratio = $max_width / $max_height;
$actual_ratio = $width / $height;
//if ($max_width >= $max_height) {
if ($target_ratio >= $actual_ratio) {
//landscape or square. resize width, then crop height
$new_height = $height / $width * $max_width;
resize($max_width, $new_height, $source_name, $target_name, $width, $height);
} else {
//portrait. resize height, then crop width
$new_width = $width / $height * $max_height;
resize($new_width, $max_height, $source_name, $target_name, $width, $height);
}
crop($max_width, $max_height, $target_name);
}
} elseif ($max_width) {
//only resizing width
if ($width == $max_width) {
//already exact width, skip resizing
copy(DIRECTORY_ROOT . $source_name, DIRECTORY_ROOT . $target_name);
} else {
//resize width
$new_height = $height / $width * $max_width;
resize($max_width, $new_height, $source_name, $target_name, $width, $height);
}
} elseif ($max_height) {
//only resizing height
if ($height == $max_height) {
//already exact height, skip resizing
copy(DIRECTORY_ROOT . $source_name, DIRECTORY_ROOT . $target_name);
} else {
//resize height
//.........这里部分代码省略.........
示例11: array
$website = $_POST['website'];
$err = array();
if (!is_valid_cname($name, $err)) {
$title = 'Error';
$success = false;
draw_page('new_campaign.php');
exit;
}
// Add the campaign to the database
$_r = $rpgDB->query(sprintf("INSERT INTO %s SET name = '%s', owner = '%s', website = '%s'", $TABLE_CAMPAIGNS, addslashes($name), addslashes($sid->GetUserName()), addslashes($website)));
if (!$_r) {
__printFatalErr("Failed to update database.", __LINE__, __FILE__);
}
if ($rpgDB->num_rows() != 1) {
__printFatalErr("Failed to update campaign list.", __LINE__, __FILE__);
}
// Get the character's id (the character should be the most recent character
// edited by this profile, and just to be sure, we restrict the select by
// cname as well).
$_r = $rpgDB->query(sprintf("select last_insert_id() as id from %s where owner='%s'", $TABLE_CAMPAIGNS, addslashes($sid->GetUserName())));
if (!$_r) {
__printFatalErr("Failed to query database for new campaign id.", __LINE__, __FILE__);
}
$r = $rpgDB->fetch_row($_r);
$campaignID = $r['id'];
// Everything should be fine, generate the success message.
$title = 'New Campaign';
$id = $campaignID;
$success = true;
draw_page('new_campaign.php');
示例12: draw_page
draw_page('new_badname.php');
exit;
}
// Verify we got a proper template for the character.
$template = (int) $_POST['chartemplate'];
if (!is_valid_template_id($template)) {
__printFatalErr("Invalid template id.");
}
// Add the character to the master list.
$sql = sprintf("INSERT INTO %s SET cname = '%s', editedby = '%s', template_id = %d, owner = '%s'", $TABLE_CHARS, addslashes($name), addslashes($sid->GetUserName()), (int) $template, addslashes($sid->GetUserName()));
$_r = $rpgDB->query($sql);
if (!$_r) {
__printFatalErr("Failed to update database: {$sql}", __LINE__, __FILE__);
}
if ($rpgDB->num_rows() != 1) {
__printFatalErr("Failed to update character list.", __LINE__, __FILE__);
}
// Get the character's id (the character should be the most recent character
// edited by this profile, and just to be sure, we restrict the select by
// cname as well).
$_r = $rpgDB->query(sprintf("SELECT id FROM %s WHERE editedby = '%s' AND cname = '%s' ORDER BY lastedited DESC LIMIT 1", $TABLE_CHARS, addslashes($sid->GetUserName()), addslashes($name)));
if (!$_r) {
__printFatalErr("Failed to query database for new character id.", __LINE__, __FILE__);
}
$r = $rpgDB->fetch_row($_r);
$charID = $r['id'];
// Everything should be fine, generate the success message.
$title = 'New Character';
$id = $charID;
draw_page('new_success.php');
示例13: session_start
</tr>
</table>
</body>
</html>
</form>
<?php
echo " ";
}
session_start();
if (isset($_POST["hit"])) {
$d = count($_SESSION);
draw_page($_SESSION["ar"]);
$hh = $_SESSION["ar"][array_rand($_SESSION["ar"])]->GenerateDamage();
if ($hh == "End") {
kill_all($_SESSION["ar"]);
} else {
die;
}
}
$BeesArray = array();
$BeesArray[] = new QueenBee();
for ($i = 0; $i < 5; $i++) {
$BeesArray[] = new WorkerBee();
}
for ($i = 0; $i < 8; $i++) {
$BeesArray[] = new DroneBee();
}
示例14: SId
<?php
// faq.php
include_once "config.php";
include_once "{$INCLUDE_PATH}/engine/sid.class.php";
include_once "{$INCLUDE_PATH}/engine/templates.php";
// Try to respawn a session, only for the sake of the main nav bar
// showing the proper buttons.
$sid = new SId();
$title = 'Frequently Asked Questions';
draw_page('faq.php');
示例15: pagelist
$pg_out = "";
$pg_out .= "<div align='center'> Page:";
$pg_out .= pagelist($pagenum, $pagelimit, $ttl_imgs);
$pg_out .= "</div>\n";
$pg_out .= "<div align='center'><table border='1' cellspacing='10' cellpadding='10' bordercolor='#666666' bordercolordark='#FFFFFF'>\n";
$ln = 1;
for ($l = $pg_st; $l < $pg_ed; $l++) {
if ($ln == '1') {
$pg_out .= "<tr><td align='center'><img src='" . $url . $mylist[$l] . "' width='125' height='193' border='0'><br>";
$pg_out .= "<div id='foot'>" . $url . $mylist[$l] . "</div></td>\n";
$ln = 0;
} else {
if ($ln == '2') {
$pg_out .= "<td align='center'><img src='" . $url . $mylist[$l] . "' width='125' height='193' border='0'><br>";
$pg_out .= "<div id='foot'>" . $url . $mylist[$l] . "</div></td>\n";
$ln = 0;
} else {
$pg_out .= "<td align='center'><img src='" . $url . $mylist[$l] . "' width='125' height='193' border='0'><br>";
$pg_out .= "<div id='foot'>" . $url . $mylist[$l] . "</div></td></tr>\n";
$ln = 1;
}
}
}
$pg_out .= "</table></div>\n";
$pg_out .= "<div align='center'> Page:";
$pg_out .= pagelist($pagenum, $pagelimit, $ttl_imgs);
$pg_out .= "</div>\n";
$title = 'Character Images';
$output = $pg_out;
draw_page('charimg.php');