if (false) { ?>
}
require_once "admin/config/global_browse.php";
//************************************************
$page_title = "";
$page_id = '';
$file_name = "";
$page_type = "";
$page_img = '';
//************************************************
$page = $_GET['page'];
if (!empty($page))
$page_type = "content";
else
$page_type = "homepage";
$page_query = empty($page) ? '/' : $page;
//$page_query = $_GET['id'];
//$page = $page_query;
// CONTENT
$query = "SELECT id_page, id_parent, content, teaser_image, url
FROM site
WHERE url = '".$page_query."'";
$result = db_query($query);
$count = db_num_rows($result);
if ($count > 0)
{
list ($page_id, $page_parent, $article_output, $page_img, $url) = db_fetch_array($result);
$article_output = str_replace("/admin/", "/", $article_output);
}
// PHP OBSAH
if (file_exists(ROOT_PATH.$page.".php") && !empty($page))
$page_include = $page.".php";
// STRÁNKA NENELAZENA
elseif ($count < 1 && $page_type != "homepage")
{
header("HTTP/1.0 404 Not Found");
include(ROOT_PATH."not-found.php");
exit;
}
// VÝPIS NOVINEK
if (empty($page))
{
$page_include = "home.php";
}
//Nahrazení Galerie
if (strstr($article_output, "ShowGallery"))
{
$gallery_count = substr_count($article_output, 'ShowGallery[');
for($ii=1;$ii<=$gallery_count;$ii++)
{
$data = explode("ShowGallery[",$article_output,2);
$data = explode("]",$data[1]);
$id_gallery = $data[0];
$gallery_out = GetGallery(GetAnchor($page_id), $id_gallery, $_GET['showimg'], 4, 2);
$article_output = str_replace('ShowGallery['.$id_gallery.']', $gallery_out, $article_output);
}
}
if (empty($page_include))
include_once ROOT_PATH."header.php";
if (!empty($page))
{
if (!empty($page_include))
include ROOT_PATH.$page_include;
else
echo $article_output;
}
else
{
include ROOT_PATH."home.php";
}
include_once ROOT_PATH."footer.php";
?>