assign('sksscreens', $c->getPicArray()); $match = $router->match(); $userReferer = (!isset($_SERVER['HTTP_REFERER']) ? 'direct' : $_SERVER['HTTP_REFERER']); $tracking = DI::getInstance()->get('tracking'); $tracking->setCurrentUserIp($_SERVER['REMOTE_ADDR']); $tracking->setCurrentUserAgent($_SERVER['HTTP_USER_AGENT']); $tracking->setCurrentUserReferer($userReferer); $tracking->checkUniqueUser(); if($match === false) { $tpl->display('errorpages/404.tpl'); } else { try { require $match['target']; } catch(Exception $e) { return $e->getMessage(); } }