<?php
if ( ! defined ( 'IN_IPB' ) )
{
tigger_error ( 'ipb::error, Bad, bad, baaaaad sheep!' );
}
/**
* Sample Page Class
* This is just to test some crap out in IPB :)
*/
class samplepage
{
var $ipsclass;
var $output = '';
var $page_title = '';
var $nav = array ( );
var $html = '';
/**
* Initilize the class.
*/
function auto_run ( )
{
// Load the language file and skin file to be used.
$this->ipsclass->load_language ( 'lang_samplepage' );
$this->ipsclass->load_template ( 'skin_samplepage' );
$this->base_url = $this->ipsclass->base_url;
// Run the core code (just a test function).
$this->test_function ( );
// Print any misc. output left over.
$this->ipsclass->print->add_output ( $this->output );
$this->ipsclass->print->do_output ( array (
'TITLE' => $this->page_title,
'JS' => 0,
'NAV' => $this->nav )
);
}
/**
* Just to test a function.
*/
function test_function ( )
{
// Start the HTML. Pass the page title through and some test text.
$this->output = $this->ipsclass->compiled_templates[ 'skin_samplepage' ]->start ( $this->ipsclass->lang[ 'page_title' ], $this->ipsclass->lang[ 'samplepage_txt' ] );
// Get members from database.
$this->ipsclass->DB->simple_construct ( array (
'select' => '*',
'from' => 'members' )
);
$this->ipsclass->DB->simple_exec ( );
// Emulate a template loop.
for ( $i = 0; $i < 4; $i++ )
{
// Pass the number of users in the database to the shownum skin function.
$this->output .= $this->ipsclass->compiled_templates[ 'skin_samplepage' ]->shownum ( $this->ipsclass->DB->get_num_rows ( ) );
}
// End the HTML.
$this->output .= $this->ipsclass->compiled_templates[ 'skin_samplepage' ]->end ( );
// Set the page title and navigation.
$this->page_title = $this->ipsclass->lang[ 'page_title' ];
$this->nav = array ( $this->ipsclass->lang[ 'page_title' ] );
}
}
?>