All pastes #795459 Raw Edit

Unnamed

public text v1 · immutable
#795459 ·published 2007-11-24 03:45 UTC
rendered paste body
<?php
session_start();

$start_count = microtime();

include( "core/conf_global.php" );
include( "core/class_core.php" );
include( "core/class_db.php" );
include( "core/class_template.php" );

// Include the code + the DB thingy... doodad >_>

$core = 			new main_core;
$core->db = 		new db_core;
$core->template =	new template_core;

$core->db->core =& 	$core;
$core->template->core =& $core;
$core->template->db =& $core->db;

$core->db->init_db();

$start_compile_time = microtime();

switch( $_GET["act"] )
{
	case "login":
		$core->process_login( $_POST["username"], $_POST["password"] );
		break;

	case "main":
		if( !defined( "IN_CORE" ) )
		{
			exit;
		}
		else
		{
			$core->login_check( $_SESSION["kp_username"] );
		}

		if( file_exists( "pages/" . $_GET["page"] . ".php" ) )
		{
			$core->template->compile_template( $_GET["page"], "kp_blue", "main" );
		}
		else
		{
			$core->template->compile_template( "welcome", "kp_blue", "main" );
		}
		break;

	case "loggedout":

		break;

	default:
		$core->template->compile_template( "", "kp_blue", "login" );
		break;
}

$end_compile_time = microtime();

$end_count = microtime();

echo("<!--\nTotal time to complete entire script: " . ($end_count - $start_count) . " Seconds\n" .
"Total time to complete page functions: " . ($end_compile_time - $start_compile_time) . " Seconds\n-->");

?>