Файл: index.php
Строк: 17
<?php
require_once ('system/bootstrap.php');
require_once ('system/libraries/smarty/Smarty.class.php');
$smarty = new Tpl;
$smarty->template_dir = ROOT . '/theme/tpl/';
$smarty->cache_dir = ROOT . '/theme/tpl/cache/';
$smarty->compile_dir = ROOT . '/theme/tpl/compile/';
$PGen = microtime(1);
if (filter_has_var(INPUT_GET, 'url'))
{
$filter = [
'url' => filter_input(INPUT_GET, 'url', FILTER_UNSAFE_RAW)
];
if ($db->query("SELECT * FROM `users` WHERE `login` = '" . $filter['url'] . "' LIMIT 1")->rowCount() != 0)
{
require_once (ROOT . '/app/user/profile.php');exit;
}
}
else
{
$filter['url'] = false;
}
if (!empty($filter['url']))
{
if (file_exists(ROOT . 'app/' . $filter['url'] . '.php'))
{
require_once(ROOT . 'app/' . $filter['url'] . '.php');
}
else if (file_exists(ROOT . 'app/' . $filter['url']))
{
if (file_exists(ROOT . 'app/' . $filter['url'] . '/index.php'))
{
require_once(ROOT . 'app/' . $filter['url'] . '/index.php');
}
else
{
require_once(ROOT . 'app/pages/403.php');
}
}
else
{
require_once(ROOT . 'app/pages/404.php');
}
}
else
{
require_once(ROOT . 'app/index.php');
}