I used isset() conditionals to check if a page is being loaded (?page=someblah)... Now with a template-style system... How do I get pages to load in a similar fashion?
layout template code:
Code: Select all
<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.1//EN' 'http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd'>
<html xmlns='http://www.w3.org/1999/xhtml'>
<head>
<title>{title}</title>
<link rev='made' href='{webmaster}' />
<link rel='shortcut icon' type='image/ico' href='{favicon}' />
<meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1' />
<meta name='Description' content='{description}' />
<meta name='keywords' content='{keywords}' />
<meta name='author' content='{author}' />
<meta name='robots' content='all' />
<base href='{base}' />
{stylesheet}
</head>
<body>
<div id='box'>
<div id='head'>
<p><a href='http://dumbass.ionichost.com'><img src='{banner}' alt='theda' title='theda' width='750' height='150' /></a><a id='top'></a></p>
<h1>{motto}</div>
<div id='left'>
<h1>{navtitle}</h1>
{navcontent}
<h1 style='text-align:center'>[ {language} ]</h1>
<p style='text-align:center'>{theme}</p>
</div>
<div id='content'>
<h1>{pagetitle} [ {pageupdated} ]</h1>
{pagecontent}
<p> </p>
<p>{pagetop}</p>
</div>
</div>
</body>
</html>Code: Select all
<?php
require_once("inc/template.php");
$page = new Page("inc/layout.html");
$page->replace_tags(array(
"title" => "XXXXXXXXXXXXXXXX",
"webmaster" => "XXXXXXXXXXXXXXXX",
"favicon" => "img/favicon.jpg",
"description" => "inc/description.dat",
"keywords" => "inc/keywords.dat",
"author" => "XXXXXXXXXXXXXXXX",
"base" => "XXXXXXXXXXXXXXXX",
"stylesheet" => include "include/style".$the.".php",
"motto" => "inc/motto.dat",
"navtitle" => "inc/navtitle.dat",
"navcontent" => "inc/navcontent.dat",
"language" => "inc/language.dat",
"theme" => "inc/theme.dat",
"pagetitle" => "inc/pagetitle.dat",
"pageupdated" => "inc/pageupdated.dat",
"pagecontent" => "inc/pagecontent.dat",
"pagetop" => "inc/pagetop.dat"
));
$page->output();
?>