00001 <?php
00004
00005 require_once 'Smarty.class.php';
00006 require_once('util.php');
00007
00027
00028 function error_handler($errno, $errstr, $errfile, $errline, $errcontext) {
00029 global $smarty;
00030
00031 $debug = 0;
00032
00033 if (empty($smarty)) {
00034 $smarty =& smarty_init();
00035 }
00036
00037 if (($errno & (E_ERROR | E_PARSE | E_CORE_ERROR | E_USER_ERROR)) == 0) {
00038 return 0;
00039 }
00040
00041 $smarty->assign("errno" , $errno);
00042 $smarty->assign("errstr" , $errstr);
00043 $smarty->assign("errfile" , $errfile);
00044 $smarty->assign("errline" , $errline);
00045
00046 if ($debug) {
00047 $smarty->assign("errcontext" ,
00048 htmlentities(print_r($errcontext, true)));
00049 }
00050
00051 $smarty->display('header.tpl');
00052 $smarty->display('error.tpl');
00053 $smarty->display('footer.tpl');
00054 exit(1);
00055 }
00056
00057 set_error_handler("error_handler");
00058
00059 ?>