I got sick of the last version of my board wrapper so I recoded it...again. Here it is. This version isnt done but it does what it needs to do for now. It features a bug fix regarding gzip compression and removal of all previous raw globals.
<?php
//+----------------------------------+\\
//+Vital stuff
//+----------------------------------+\\
error_reporting(E_ALL);
set_magic_quotes_runtime(0);
define('IN_NUKEBOARD',true);
define('ROOT','./');
//+----------------------------------+\\
//+Load configuration
//+----------------------------------+\\
require(ROOT.'config/config.php');
//+----------------------------------+\\
//+Build the core
//+----------------------------------+\\
class nukeboard
{
var $version = '1.0 Beta1';
var $member;
var $lang;
var $conf;
var $skin;
function nukeboard()
{
global $conf;
$this->conf = &$conf;
}
}
$nukeboard = new nukeboard();
//+----------------------------------+\\
//+Start output buffering
//+----------------------------------+\\
if($nukeboard->conf['cpusaving_usegzip'] == true)
{
if(extension_loaded('zlib'))
{
$encodings = explode(',',$_SERVER['HTTP_ACCEPT_ENCODING']);
if(in_array('gzip',$encodings) || in_array('deflate',$encodings))
{
define('BUFFER_STARTED',true);
ob_start('ob_gzhandler');
}
}
}
//+----------------------------------+\\
//+Load modules
//+----------------------------------+\\
$modules = array(
'idx' => 'boards.php',
);
if(!isset($_GET['act']))
{
$_GET['act'] = 'idx';
}
if(in_array($_GET['act'],array_keys($modules)))
{
require(ROOT.'sources/'.$modules[$_GET['act']]);
} else {
require(ROOT.'sources/'.$modules['idx']);
}
//+----------------------------------+\\
//+Stop output buffering
//+----------------------------------+\\
if($nukeboard->conf['cpusaving_usegzip'] == true)
{
if(defined('BUFFER_STARTED'))
{
ob_end_flush();
}
}
?>