<?php
require_once('globals.php');
class Page
{
private $title;
private $content;
function __construct()
{
$this->title = null;
$this->content = null;
}
public function append_title($value)
{
$this->title .= $value;
}
public function append_content($value)
{
$this->content .= $value;
}
public function display()
{
$html = null;
$html = file_get_contents(TEMPLATE_FILE);
// put in dynamically generated content
$html = str_replace('__PAGE_TITLE__', $this->title, $html);
$html = str_replace('__PAGE_CONTENT__', $this->content, $html);
// put in stuff that comes from globals defined in globals.php
$html = str_replace('__SITE_TITLE__', SITE_TITLE, $html);
$html = str_replace('__SITE_TAGLINE__', SITE_TAGLINE, $html);
// the protectedfunction.com tag, don't remove :)
$html = str_replace('</body>', '<p><center><small>Powered by <a href="http://www.protectedfunction.com/script_apartment_classifieds.php">protectedfunction.com Apartment Classifieds</a></small></center></p></body>', $html);
echo $html;
}
public static function row_shade(&$row_count)
{
$html = null;
if ($row_count % 2 == 0)
{
$html = '';
}
else
{
$html = ' class="row_shade" ';
}
$row_count++;
return $html;
}
}
?>