All pastes #828719 Raw Edit

Miscellany

public php v1 · immutable
#828719 ·published 2007-12-22 18:10 UTC
rendered paste body
<?phpsession_start();$pages = array("home", "about", "404");$page = (in_array($_GET["page"], $pages) ? $_GET["page"] : "404").".php";$template = "template.php";$config = new config;class config {	var $ajaxmode = true;}function callback($buffer) {/*	$template = new template($buffer);	$template->add_content("content", $page);		$template->add_content("AJAXMODE", );	*/		return implode("LOL", preg_split("/<!--\[\[.*\]\]-->/", $buffer));}function includefile($matches) {	global $page;	switch ($matches[1]) {		case "content":			return addfile($page);			break;		default: 			return addfile($matches[1].".php");			break;	}		}ob_start();$output = compile();die(preg_replace_callback("/<!--\[\[(.*)\]\]-->/", "includefile", $output));function compile() {	ob_start();	include "template.php";	return ob_get_clean();}function addfile($file) {	ob_start();	$flag = true;	include $file;	return preg_replace_callback("/<!--\[\[(.*)\]\]-->/", "includefile", ob_get_clean());}?>