Files
skirogaining.krk-litvinov.cz/index.php

80 lines
2.8 KiB
PHP
Raw Normal View History

2022-01-13 22:50:25 +01:00
<?php
session_start();
2022-01-13 23:09:36 +01:00
$included = true;
$lang = empty($_GET['lang']) ? 'cs' : $_GET['lang'];
2022-01-14 03:34:46 +01:00
if (!in_array($lang, ['cs', 'de'], true)) {
header('Location: /cs/' . ($_GET['page'] ?? ''));
exit;
}
$page = htmlspecialchars($_GET['page'] ?? 'main');
$url = $_SERVER['REQUEST_URI'] ?? '';
2022-01-13 23:09:36 +01:00
$root = '';
$pretitle = '2. Skirogaining 2012';
$mainMail = 'tojnar@gmail.com';
2022-01-14 03:34:46 +01:00
require $lang . '.php';
2022-01-13 23:09:36 +01:00
$CMS['%url%'] = 'http://skirogaining.tojnar.cz' . htmlspecialchars($url);
$CMS['%root%'] = $root;
$CMS['%lang%'] = $lang;
$CMS['%unknownAuthor%'] = 'Jan Tojnar';
$CMS['%headerLinkHref%'] = rplc('%root%/') . $lang;
$CMS['%pretitle%'] = $pretitle;
2022-01-14 03:34:46 +01:00
$CMS['%comefrom%'] = $_SERVER['HTTP_REFERER'] ?? 'n/a';
2022-01-13 23:09:36 +01:00
$CMS['%dateFormat%'] = 'd.m.Y H:i';
if ($lang == 'cs') {
$CMS['%old%'] = '<p class="old"><a href="http://skirogaining.tojnar.cz/Skirogaining_2010/">1. Skirogaining 2010</a> <a href="http://skirogaining.krk-litvinov.cz/">3. Skirogaining 2012</a></p>';
} elseif ($lang == 'de') {
$CMS['%old%'] = '<p class="old"><a href="http://skirogaining.tojnar.cz/Skirogaining_2010/de/">1. Skirogaining 2010</a> <a href="http://skirogaining.krk-litvinov.cz/de/">3. Skirogaining 2012</a></p>';
2022-01-13 22:50:25 +01:00
} else {
2022-01-13 23:09:36 +01:00
$CMS['%old%'] = '';
2022-01-13 22:50:25 +01:00
}
2022-01-13 23:09:36 +01:00
function rplc($string) {
global $CMS;
return str_replace(array_keys($CMS), $CMS, $string);
2022-01-13 22:50:25 +01:00
}
2022-01-14 03:34:46 +01:00
require __DIR__ . '/sboard.php';
require __DIR__ . '/load.lib.php';
2022-01-13 22:50:25 +01:00
readPage($page);
2022-01-13 23:09:36 +01:00
$CMS['%releasedate%'] = toDate($date);
$CMS['%releasetime%'] = toTime($date);
if (isReleased($date) == false) {
$notreleased = true;
} else {
$notreleased = false;
2022-01-13 22:50:25 +01:00
}
2022-01-13 23:09:36 +01:00
if ($notreleased == true) {
readPage('error/notreleased');
2022-01-13 22:50:25 +01:00
}
2022-01-13 23:09:36 +01:00
$CMS['%title%'] = $title;
$CMS['%titleTag%'] = str_replace(['%pretitle%', '%title%'], [$pretitle, $title], rplc('%longTitle%'));
$CMS['%langPanel%'] = $langPanel;
$CMS['%article%'] = $article;
$CMS['%menu%'] = $menu;
if (!empty($author) and !empty($date)) {
$aInfo = str_replace(['%author%', '%date%', '%time%'], [author($author), toDate($date), toTime($date)], rplc('%by%'));
} elseif (!empty($author)) {
$aInfo = str_replace('%author%', author($author), rplc('%byAuthor%'));
} elseif (!empty($date)) {
$aInfo = str_replace(['%date%', '%time%'], [toDate($date), toTime($date)], rplc('%byDate%'));
} else {
$aInfo = '';
2022-01-13 22:50:25 +01:00
}
//var_dump(date(rplc("%dateFormat%"),filemtime($realPage)));
2022-01-13 23:09:36 +01:00
$CMS['%author%'] = $author;
$CMS['%ainfo%'] = $aInfo;
if ($eu == true) {
$CMS['%eu%'] = '<table class="table-no-border" id="ziel3">
<tr><td colspan="2"><h6>%eustring%</h6></td></tr>
<tr><td><img src="/images/EU-Logo_rgb.jpg" height="45" width="361"></td><td><img src="/images/ziel-small.jpg" class="margin-05"></td></tr>
</table>';
} else {
$CMS['%eu%'] = '';
2022-01-13 22:50:25 +01:00
}
?>
<?php
ob_start(/*"ob_gzhandler"*/);
2022-01-13 23:09:36 +01:00
include 'template.html';
$buffer = ob_get_clean();
echo rplc(rplc($buffer));
2022-01-14 03:34:46 +01:00
?>