website/parts/preamble.php
Jeff Teunissen 9e6f75ccbd Update for PHP 7.x
PHP 7 doesn't like the old short tags we were using (it's possible to re-enable
them, but won't be for version 8, so we might as well switch now), and the old
MySQL APIs are now gone entirely, replaced with something different.

This should make everything work at least as well as it used to.

Also, one file used to be checked in with CRLF line endings. ??
2022-04-27 13:14:47 -04:00

59 lines
1.6 KiB
PHP

<?php // Preamble
$siteName = "The QuakeForge Project";
$columns = 'content';
define ('siteHome', "/home/project-web/quake/htdocs");
// PHP is complaining about date stamps now...
date_default_timezone_set ("UTC");
require siteHome . "/parts/library.inc"; // Load function library
if (isset($need) && $need) {
need ($need);
unset ($need);
}
require siteHome . "/parts/head.inc"; // Load the HEAD and open BODY
require siteHome . "/parts/topstrip.inc"; // Display top strip
require siteHome . "/parts/titletable.inc"; // Display main title w/ logos
require siteHome . "/parts/menu.inc"; // Load up the menu
$contentClass = '';
if (isset ($modules) && $modules && $modules = explode (" ", $modules)) {
$columns .= ' features';
$contentClass = 'class="narrow"';
echo '<DIV id="features">';
for ($i = 0; $i < count ($modules); $i++) {
include siteHome . "/parts/" . $modules[$i] . ".inc";
}
echo '</DIV>';
}
echo '<SCRIPT type="text/javascript">columnIDs = new Array (';
$columns = explode (" ", $columns);
$i = count ($columns);
do {
echo "'" . $columns[$i-1] . "'";
if (--$i) {
echo ", ";
}
} while ($i);
echo ');</SCRIPT>';
?>
<DIV <?=$contentClass?> id="content"><!-- Content Start -->
<?php
require siteHome . "/parts/topmain.inc"; // insert page title
/*
This is cool. We add the postamble to a function in the
preamble and register it as a shutdown function, so the
postamble doesn't have to be included from pages. :)
*/
function postamble ()
{
include siteHome . "/parts/postamble.inc"; // heehee
}
register_shutdown_function ('postamble');
?>