class 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 "
Debug Information:
"; // Display number of times $o->string was called // print "Output String Count: " . $this->stringcallcount . "
"; print "
"; } } // The Holy Error Function! // function showerror( $errTitle, $errMessage ) { $this->string( "\n" ); $this->string( "
\n" ); $this->string( "An Error has occured:
\n" ); $this->string( "" . $errTitle . "
\n" ); $this->string( $errMessage . "
\n" ); $this->string( "
\n" ); $this->string( "\n" ); } } $o = new Output;