admin) { $S->getModule('admin')->go(); } else { $S->getModule('front')->go(); } if (isset($_GET['xml'])) { header("Content-type:text/xml"); echo $S->getFinalXml()->asXML(); exit; } echo $S->getHtmlFromXml($S->getFinalXml()); list($usec, $sec) = explode(" ", microtime()); $time_end = ((float)$usec + (float)$sec); $work_time = round( ($time_end - $time_start), 3); if (isset($_GET['stats'])) { $stats = array(); $stats[] = 'Template: '.$S->getTemplate(); $stats[] = 'Script time: '.$work_time.' seconds'; if ($S->db_initialized()) { $cqs = $S->db()->dbobj['cached_queries']; $stats[] = 'DB query count: '.count($cqs); $stats[] = 'Queries:
'; } else { $stats[] = 'DB query count: 0'; } $stats[] = 'XML:
'; echo implode("
", $stats); } $S->endWork(); ?>