Files
krk-litvinov.cz/index.php

258 lines
8.4 KiB
PHP
Raw Normal View History

<?php
preg_match('(^/(?:(?P<lang>en|de)/)?(?P<page>.*?)(\.html)?$)', $_SERVER['REQUEST_URI'] ?? '', $match);
$lang = empty($match['lang']) ? 'cs' : $match['lang'];
$page = $match['page'] ?? '';
ob_start();
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<link type="image/png" href="/images/logo_krk16.png" rel="shortcut icon">
<link rel="stylesheet" type="text/css" href="/highslide4/highslide.css">
<link rel="stylesheet" href="/style.css" type="text/css">
<meta http-equiv="Content-Style-Type" content="text/css">
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
<script type="text/javascript" src="/simple.js"></script>
<script type="text/javascript" src="/highslide4/highslide-with-gallery.js"></script>
<script type="text/javascript">
hs.graphicsDir = '/highslide4/graphics/';
hs.align = 'center';
hs.transitions = ['expand', 'crossfade'];
hs.outlineType = 'rounded-white';
hs.wrapperClassName = 'controls-in-heading';
hs.fadeInOut = true;
//hs.dimmingOpacity = 0.75;
// Add the controlbar
if (hs.addSlideshow) hs.addSlideshow({
//slideshowGroup: 'group1',
interval: 5000,
repeat: false,
useControls: true,
fixedControls: false,
overlayOptions: {
opacity: 1,
position: 'top right',
hideOnMouseOut: false
}
});
</script>
<script type="text/javascript">
2022-01-14 10:48:52 +01:00
<?php
if ($lang == 'en') {
?>
hs.lang = {
cssDirection: 'ltr',
loadingText : 'Loading...',
loadingTitle : 'Click to cancel',
focusTitle : 'Click to bring to front',
fullExpandTitle : 'Expand to actual size (f)',
fullExpandText : 'Full size',
creditsText : 'Powered by <i>Highslide JS</i>',
creditsTitle : 'Go to the Highslide JS homepage',
previousText : 'Previous',
previousTitle : 'Previous (arrow left)',
nextText : 'Next',
nextTitle : 'Next (arrow right)',
moveTitle : 'Move',
moveText : 'Move',
closeText : 'Close',
closeTitle : 'Close (esc)',
resizeTitle : 'Resize',
playText : 'Play',
playTitle : 'Play slideshow (spacebar)',
pauseText : 'Pause',
2022-01-14 10:48:52 +01:00
pauseTitle : 'Pause slideshow (spacebar)',
number : 'Image %1 of %2',
restoreTitle : 'Click to close image, click and drag to move. Use arrow keys for next and previous.'
};
2022-01-14 10:48:52 +01:00
<?php
} elseif ($lang == 'de') {
?>
hs.lang = {
loadingText : 'Lade...',
loadingTitle : 'Klick zum Abbrechen',
focusTitle : 'Klick um nach vorn zu bringen',
fullExpandTitle : 'Zur Originalgröße erweitern',
fullExpandText : 'Vollbild',
creditsText : 'Powered by <i>Highslide JS</i>',
creditsTitle : 'Gehe zur Highslide JS Homepage',
previousText : 'Voriges',
previousTitle : 'Voriges (Pfeiltaste links)',
nextText : 'Nächstes',
nextTitle : 'Nächstes (Pfeiltaste rechts)',
moveTitle : 'Verschieben',
moveText : 'Verschieben',
closeText : 'Schließen',
closeTitle : 'Schließen (Esc)',
resizeTitle : 'Größe wiederherstellen',
playText : 'Abspielen',
playTitle : 'Slideshow abspielen (Leertaste)',
pauseText : 'Pause',
pauseTitle : 'Pausiere Slideshow (Leertaste)',
restoreTitle : 'Klick um das Bild zu schließen, klick und ziehe um zu verschieben. Benutze Pfeiltasten für vor und zurück.'
2022-01-14 10:48:52 +01:00
};
<?php
} else {
?>
hs.lang = {
loadingText : 'Načítá se...',
loadingTitle : 'Klikněte pro zrušení',
focusTitle : 'Klikněte pro přenesení do popředí',
fullExpandTitle : 'Zvětšit na původní velikost',
fullExpandText : 'Plná velikost',
creditsText : 'Powered by <i>Highslide JS</i>',
creditsTitle : 'Přejít na stránky Highslide JS',
previousText : 'Předchozí',
previousTitle : 'Předchozí (šipka vlevo)',
nextText : 'Další',
nextTitle : 'Další (šipka vpravo)',
moveTitle : 'Přesunout',
moveText : 'Přesunout',
closeText : 'Zavřít',
closeTitle : 'Zavřít (esc)',
resizeTitle : 'Změnit velikost',
playText : 'Přehrát',
playTitle : 'Přehrát slideshow (mezerník)',
pauseText : 'Pozastavit',
pauseTitle : 'Pozastavit slideshow (mezerník)',
restoreTitle : 'Klikněte pro zavření obrázku, klikněte a táhněte pro jeho přesunutí. Použijte šipky na klávesnici pro přesun na další a předchozí.'
};
<?php
2022-01-14 10:48:52 +01:00
}
?>
</script>
2022-01-14 10:48:52 +01:00
<title><?php include './pages/title_krk.php'; ?></title>
</head>
<body>
<div class="content">
2022-01-14 10:48:52 +01:00
<div class="header"><span class="title"><?php include './pages/title_krk.php'; ?></span><br><span class="slogan"><?php include './pages/slogan.php'; ?></span>
<?php
$pageFileName = preg_replace('(([^/]+)/$)', '\1/\1', $page);
2022-01-14 10:48:52 +01:00
echo '<span class="floatright">';
if (file_exists(__DIR__ . "/pages/$page-de.php") || file_exists(__DIR__ . "/pages/$pageFileName-de.php")) {
if (file_exists(__DIR__ . "/pages/$pageFileName-de.php")) {
2022-01-14 10:48:52 +01:00
$lngc = 'de';
$icona = "<a href=\"/$lngc/$page\"><img src=\"/images/" . $lngc . 'f.png" alt=""></a>';
2022-01-14 10:48:52 +01:00
} else {
$lngc = 'de';
$icona = "<a href=\"/$lngc/" . htmlspecialchars($page) . '.html"><img src="/images/' . $lngc . 'f.png" alt=""></a>';
2022-01-14 10:48:52 +01:00
}
if ($lang == 'de') {
2022-01-14 10:48:52 +01:00
echo '';
} else {
echo $icona;
}
}
if (file_exists('pages/' . htmlspecialchars($page) . '-en.php') || file_exists('pages/' . $pageFileName . '-en.php')) {
if (file_exists('pages/' . $pageFileName . '-en.php')) {
2022-01-14 10:48:52 +01:00
$lngc = 'en';
$icona = "<a href=\"/$lngc/" . htmlspecialchars($page) . '"><img src="/images/' . $lngc . 'f.png" alt=""></a>';
2022-01-14 10:48:52 +01:00
} else {
$lngc = 'en';
$icona = "<a href=\"/$lngc/" . htmlspecialchars($page) . '.html"><img src="/images/' . $lngc . 'f.png" alt=""></a>';
2022-01-14 10:48:52 +01:00
}
if ($lang == 'en') {
2022-01-14 10:48:52 +01:00
echo '';
} else {
echo $icona;
}
} elseif ($page === '' && file_exists('pages/krk_default-en.php')) {
2022-01-14 10:48:52 +01:00
$lngc = 'en';
$icona = "<a href=\"/$lngc/\"><img src=\"/images/" . $lngc . 'f.png" alt=""></a>';
if ($lang == 'en') {
2022-01-14 10:48:52 +01:00
echo '';
} else {
echo $icona;
}
}
if (file_exists('pages/' . htmlspecialchars($page) . '.php') || file_exists('pages/' . $pageFileName . '.php')) {
if (file_exists('pages/' . $pageFileName . '.php')) {
2022-01-14 10:48:52 +01:00
$lngc = '';
$icona = '<a href="/' . htmlspecialchars($page) . '"><img src="/images/' . $lngc . 'f.png" alt=""></a>';
2022-01-14 10:48:52 +01:00
} else {
$lngc = '';
$icona = '<a href="/' . htmlspecialchars($page) . '.html"><img src="/images/' . $lngc . 'f.png" alt=""></a>';
2022-01-14 10:48:52 +01:00
}
if ($lang == 'cs') {
2022-01-14 10:48:52 +01:00
echo '';
} else {
echo $icona;
}
}
if ($lang == 'en' && ($page === '' || $page === 'krk_default')) {
2022-01-14 10:48:52 +01:00
$lngc = '';
$icona = '<a href="/"><img src="/images/' . $lngc . 'f.png" alt=""></a>';
2022-01-14 10:48:52 +01:00
echo $icona;
}
2022-01-14 10:48:52 +01:00
echo '</span>';
?>
</div>
<div class="top-menu">
<?php
if ($lang === 'cs') {
2022-01-14 10:48:52 +01:00
include './pages/krk_topmenu.php';
} elseif ($lang === 'en' && file_exists('./pages/krk_topmenu-en.php')) {
2022-01-14 10:48:52 +01:00
include './pages/krk_topmenu-en.php';
}
?>
</div>
<div class="sidebar"><div class="sidebar-content">
<ul>
2022-01-14 10:48:52 +01:00
<?php
if (str_contains($page, 'mcr_2009') && $lang === 'en') {
2022-01-14 10:48:52 +01:00
include './pages/mcr_2009/menumcr_2009-en.php';
} elseif (str_contains($page, 'mcr_2009') && $lang === 'de') {
2022-01-14 10:48:52 +01:00
include './pages/mcr_2009/menumcr_2009-de.php';
} elseif (str_contains($page, 'mcr_2009')) {
2022-01-14 10:48:52 +01:00
include './pages/mcr_2009/menumcr_2009.php';
} else {
if ($lang === 'cs') {
2022-01-14 10:48:52 +01:00
include './pages/menukrk.php';
} else {
include './pages/menukrk-en.php';
}
}
?>
</ul><br><br><br>
</div></div><div class="main"><div class="main-content">
2022-01-14 10:48:52 +01:00
<?php
$escaped_page = str_replace([')', '(', '\\', '"', "\'", ';', '{', '}', '$', '[', ']', '<', '>'], '', htmlspecialchars($page));
if ($page !== '') {
if ($lang !== 'cs') {
$jazycek = '-' . $lang;
2022-01-14 10:48:52 +01:00
} else {
$jazycek = '';
}
if ($page == 'mcr_2009/') {
2022-01-14 10:48:52 +01:00
include "./pages/mcr_2009/mcr_2009$jazycek.php";
} elseif ($page == 'mcr_2009/probihani_loucna/') {
include "./pages/mcr_2009/probihani_loucna/probihani_loucna$jazycek.php";
} elseif ($page == 'clanky/') {
2022-01-14 10:48:52 +01:00
include "./pages/clanky/clanky$jazycek.php";
} elseif ($lang === 'cs' && file_exists(__DIR__ . "/pages/$escaped_page.php")) {
2022-01-14 10:48:52 +01:00
include "./pages/$escaped_page.php";
} elseif (file_exists(__DIR__ . "/pages/$escaped_page-$lang.php")) {
include "./pages/$escaped_page-$lang.php";
2022-01-14 10:48:52 +01:00
} else {
include __DIR__ . '/pages/404.php';
}
} else {
if ($lang === 'cs') {
2022-01-14 10:48:52 +01:00
include './pages/krk_default.php';
} else {
include './pages/krk_default-en.php';
}
}
?>
</div></div>
<div class="footer">
</div>
</div>
</body>
</html>