<?php session_start(); $TIME_START=microtime(true); require_once("config.install.php"); require_once("../includes/phptools/common.inc.php"); require_once("../includes/phptools/datetime.inc.php"); require_once("../includes/phptools/maps.common.inc.php"); require_once("../includes/phptools/redirect.inc.php"); require_once("../includes/phptools/routines.inc.php"); require_once("../includes/phptools/theme.inc.php"); require_once("../includes/DTEv2/template.driver.inc.php"); require_once("../includes/routines.inc.php"); $Config=new InstallConfig(); require_once("../includes/db.inc.php"); $dataset=array(); $CMD=GET("cmd"); if (!$CMD) $CMD="home"; $CMD_TMPL_NAME=$CMD; $OUTPUT_AVAILABLE=false; $TEXT_OUTPUT=false; $SCRIPT_TIME_START=null; $SCRIPT_TIME_END=null; $COMMAND_TEMPLATE=null; $DEPEND_ON_TEMPLATES=array(); $DEPEND_ON_FILES=array(); $NO_TEXT_REPLACE=true; $OUTPUT_POST_FILTER=array(); if (strpbrk($CMD,"\\/@:&|")===false) { $CMD_TMPL_SUFFIX=".tmpl.htm"; $TMPL_PARAM=""; $COMMAND_SCRIPT="commands/".$CMD.".php"; $LANGUAGE_FILES=array(); if (file_exists($COMMAND_SCRIPT)) { try { include($COMMAND_SCRIPT); $OUTPUT_AVAILABLE=true; } catch (Exception $e) { if ($DBConn->connected()) $DBConn->rollback(); $errstr=$e->getMessage()."\n".$e->getTraceAsString(); try { $mailbody=$errstr."\n"; $mailbody.='Last SQL: '.$DBConn->last_sql."\n"; $mailbody.='$_SERVER='.print_r($_SERVER,true)."\n"; $mailbody.='$_SESSION='.print_r($_SESSION,true)."\n"; $mailbody.='$_GET'.print_r($_GET,true)."\n"; $mailbody.='$_POST'.print_r($_POST,true)."\n"; DEBUG($mailbody); } catch (Exception $e) { trigger_error($errstr,E_USER_ERROR); } exit; } } $CMD_TIME_END=$TIME_END=microtime(true); if ($CMD_TMPL_NAME) { $LANGUAGE_FILES=array_merge(LanguageFiles(),$LANGUAGE_FILES); if (!$COMMAND_TEMPLATE) $COMMAND_TEMPLATE=deduce_theme_path($CMD_TMPL_NAME.$CMD_TMPL_SUFFIX); if (file_exists($COMMAND_TEMPLATE)) { $LOADER=new TemplateLoader($dataset); foreach ($LANGUAGE_FILES as $lf) if (file_exists($lf)) $LOADER->addLabelFiles($lf); foreach ($DEPEND_ON_TEMPLATES as $dot) array_push($DEPEND_ON_FILES,deduce_theme_path($dot.$CMD_TMPL_SUFFIX)); $DRIVER=$LOADER->load($COMMAND_TEMPLATE,null,language_requested().$TMPL_PARAM,$DEPEND_ON_FILES); $DRIVER->output(); foreach ($OUTPUT_POST_FILTER as $opf_name) call_user_func($opf_name); $TIME_END=microtime(true); $OUTPUT_AVAILABLE=true; $TEXT_OUTPUT=true; } } } if (!$OUTPUT_AVAILABLE) { header("HTTP/1.1 404 Not Found"); echo $cmd; } ?>