rendered paste bodyclass Output
{
// Settings //
var $debug = 0;
var $sourcefolder = 'source'; // The folder that contains most of the files //
// Output-related //
var $output;
var $stringcallcount;
var $ob_varcount = 0;
// Remember to add to this list till I find another solution //
var $OB_PAGETITLE = "";
var $OB_CURRENT_CHARACTER = "";
// Initialisation Class //
function init()
{
// Empty until further notice //
}
// String output adder-er //
// The most important function ever devised by Supalosa //
function string( $string )
{
$this->output .= $string;
$this->stringcallcount ++;
}
// Sets an output buffer variable //
function setobvar( $var , $val )
{
$obvariable = 'OB_' . $var;
$this->$obvariable = $val;
$this->ob_varcount ++;
}
// Return the value of an output buffer variable //
function getobvar( $var )
{
$obvariable = 'OB_' . $var;
return $this->$obvariable;
}
// Outputs the page //
function outputPage()
{
$obstrings = array (
"PAGETITLE" => $this->OB_PAGETITLE,
"CURRENT_CHARACTER" => $this->OB_CURRENT_CHARACTER,
"CSEARCH_RESULT_LIMIT" => $this->OB_CSEARCH_RESULT_LIMIT,
"ADVCSEARCH_GUILD" => $this->OB_ADVCSEARCH_GUILD,
"ADVCSEARCH_RPP" => $this->OB_ADVCSEARCH_RPP,
"GLIST_TERM" => $this->OB_GLIST_TERM,
"GLIST_LIMIT" => $this->OB_GLIST_LIMIT,
"GUILD_NAME" => $this->OB_GUILD_NAME,
);
foreach( $obstrings AS $key => $val )
{
$this->output = str_replace( "OB_" . $key , $val , $this->output );
}
// Output the page //
print $this->output;
// If in debug mode, output debug information //
if( $this->debug == 1 )
{
print "<span style='font-size: 12px;'><br><b>Debug Information:</b><br>";
// Display number of times $o->string was called //
print "<b>Output String Count:</b> " . $this->stringcallcount . "<br>";
print "</span>";
}
}
// The Holy Error Function! //
function showerror( $errTitle, $errMessage )
{
$this->string( "<!-- An error has occured! -->\n" );
$this->string( "<div class=\"error-div\">\n" );
$this->string( "<b>An Error has occured:</b><br>\n" );
$this->string( "<i>" . $errTitle . "</i><br>\n" );
$this->string( $errMessage . "<br>\n" );
$this->string( "</div>\n" );
$this->string( "<!-- An error has occured! -->\n" );
}
}
$o = new Output;