lime icon

Phosphorus and Lime

A Developer's Broadsheet

This blog has been deprecated. Please visit my new blog at klenwell.com/press.
PHP: New Page Template
See notes in file

<?php

/* FILE INFO

Allied Portals MVC PHP Template

File: __MVC_template_ind.inc.php
Last Update: Dec 2005
Author: Tom Atwell (klenwell@gmail.com)

NOTES:

This page models the processing and style template for web page developed
in PHP independently of an established framework.

________________________________________________*/


/* 1. LOCAL DRIVER ******************************/

// SCRIPT TIMER

$_tx1 = microtime();

// DOCUMENT SHORTHAND

# syntax
define('iEOL', "\n");

# path
$_iPATH['file'] = realpath(__FILE__);
$_iPATH['script'] = realpath($_SERVER['SCRIPT_FILENAME']);
$_iPATH['self'] = realpath($_SERVER['PHP_SELF']);
$_iPATH['root'] = realpath($_SERVER['DOCUMENT_ROOT']);
$_iPATH['super'] = dirname($_iPATH['root']);

# meta
$_iMETA['uri'] = $_SERVER['REQUEST_URI'];
$_iMETA['computer'] = $_ENV['COMPUTERNAME'];

// AMVC DRIVER

# AMVC Timer
#require_once($_iPATH['super'] . '/AMVC/_tx.inc.php');
#stage_timer('start timer');

# Include Stack
#require_once('project_driver.inc.php');

# UAS Turnkey
#uas_lock_page();

/*______________________________________________*/



/* 2. MODEL (Data) ******************************/

// PUBLIC VARIABLES

# Global
#global $MASTER;

# Initialize
$_SET = array();

# Document Head
$_SET['doc_title'] = 'TOOTH View Template';
$_SET['page_title'] = $_SET['doc_title'];
$_SET['keywords'] = 'PHP,Firefox,Open Source';
$_SET['description'] = 'AMVC Framework Page';
$_SET['charset'] = 'ISO-8859-1';
$_SET['css_path'] = '';
$_SET['js_path'] = '';
$_SET['icon_path'] = 'http://firefox.no/favicon.ico';

# Labels
$_LABEL['rights'] = 'some rights reserved, &#169;' . date('Y');
$_LABEL['firefox'] = '<a href="http://www.spreadfirefox.com/?q=affiliates&amp;id=151890&amp;t=85"><img border="0" alt="Get Firefox!" title="Get Firefox!" src="http://sfx-images.mozilla.org/affiliates/Buttons/80x15/firefox_80x15.png"/></a>';


// PRIVATE VARIABLES

# Internal

# Head Tags
$_HEAD['doctype'] = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"' . "\n" . '"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">';
$_HEAD['open_tag'] = "<html lang=\"en\">\n<head>";
$_HEAD['title'] = '<title>' . $_SET['doc_title'] . '</title>';
$_HEAD['keywords'] = '<meta name="Keywords" content="' . $_SET['keywords'] . '" />';
$_HEAD['description'] = '<meta name="Description" content="' . $_SET['description'] . '" />';
$_HEAD['charset'] = '<meta http-equiv="Content-Type" content="text/html; charset=' . $_SET['charset'] . '" />';
$_HEAD['fav_icon'] = '<link rel="shortcut icon" href="' . $_SET['icon_path'] . '" type="image/x-icon" />';
#$_HEAD['css'] = '<link href="' . $_SET['css_path'] . '" type="text/css" rel="stylesheet">';
#$_HEAD['js'] = '<script type="text/javascript" src="' . $_SET['js_path'] . '"></script>';

/*______________________________________________*/



/* 3. CONTROLLER ********************************/


/*______________________________________________*/



/* 4. VIEWER ************************************/

echo $_HEAD['doctype'] . iEOL;
echo $_HEAD['open_tag'] . iEOL;
echo $_HEAD['charset'] . iEOL;
echo $_HEAD['keywords'] . iEOL;
echo $_HEAD['description'] . iEOL;
echo $_HEAD['title'] . iEOL;
echo $_HEAD['fav_icon'] . iEOL;
echo $_HEAD['css'] . iEOL;
echo $_HEAD['js'] . iEOL;

?>

<!-- Local Style Sheet -->
<style type="text/css">
<!--
body
{
font-family:Lucida Sans Unicode, Lucida Grande, sans-serif;
margin:0; padding:0;
}
#page
{
width:750px;
margin:0 auto;
}
#masthead
{
margin-top:10px;
padding:10px;
}
#trunk
{
}
.trunk_stent
{
height:200px;
float:right;
width:1px;
}
.minheight_clear
{
clear:both;
height:1px;
overflow:hidden;
}
#footer
{
font:11px/1.4em Verdana, Geneva, sans-serif;
text-align:center;
}

-->
</style>

<?php echo $_HEAD['close_tag'] . iEOL; ?>

<!-- *** END DOCUMENT HEAD *** -->


<body>

<!-- PAGE -->
<div id="page">

<!-- MASTHEAD -->
<div id="masthead">
<h1><?php echo $_SET['page_title'] ?></h1>
</div>
<!-- end MASTHEAD -->

<!-- TRUNK -->
<div id="trunk">
<div class="trunk_stent"></div>

<div class="minheight_clear"></div>
</div>
<!-- end TRUNK -->

<!-- FOOTER -->
<div id="footer">
<?php echo $_LABEL['rights']; ?>
<br />
<?php echo $_LABEL['firefox']; ?>
</div>
<!-- end FOOTER -->

</div>
<!-- end PAGE -->

<?php

/*__end VIEWER__________________________________*/



/* 5. DIAGNOSTICS *******************************/

// SCRIPT TIMER
# stage_timer('end page');

// SESSION DUMP
# amvc_snapdot();

/*______________________________________________*/

?>

<!-- Close HTML -->
</body>
</html>

<?php

/* 6. POSTSCRIPTS *******************************/

// Flush
while (ob_get_level() > 0)
{
ob_end_flush();
}
flush();
echo "\n<!-- Buffer Dumped at " . date('r') . " -->\n";

// Pseudo-Daemon

# timer
$_tx2 = microtime();
$_tx3 = number_format(((substr($_tx2,0,9)) + (substr($_tx2,-10)) - (substr($_tx1,0,9)) - (substr($_tx1,-10))),4);
echo "\n<!-- generated in $_tx3 s -->";

/*______________________________________________*/

?>


Keywords: PHP, HTML, CSS, AMVC, template