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";
?>