Format code from krk-litvinov.cz

This commit is contained in:
2022-01-14 03:30:26 +01:00
parent ef87fd0ae6
commit 88e5499192
20 changed files with 1028 additions and 1012 deletions

View File

@@ -1,52 +1,53 @@
<?php <?php
if($included==true){
$CMS["%by%"]="%author% ~ %date%, %time%"; if ($included == true) {
$CMS["%january%"]="leden"; $CMS['%by%'] = '%author% ~ %date%, %time%';
$CMS["%february%"]="únor"; $CMS['%january%'] = 'leden';
$CMS["%march%"]="březen"; $CMS['%february%'] = 'únor';
$CMS["%april%"]="duben"; $CMS['%march%'] = 'březen';
$CMS["%may%"]="květen"; $CMS['%april%'] = 'duben';
$CMS["%june%"]="červen"; $CMS['%may%'] = 'květen';
$CMS["%july%"]="červenec"; $CMS['%june%'] = 'červen';
$CMS["%august%"]="srpen"; $CMS['%july%'] = 'červenec';
$CMS["%september%"]="září"; $CMS['%august%'] = 'srpen';
$CMS["%october%"]="říjen"; $CMS['%september%'] = 'září';
$CMS["%november%"]="listopad"; $CMS['%october%'] = 'říjen';
$CMS["%december%"]="prosinec"; $CMS['%november%'] = 'listopad';
$CMS["%date%"]="%d%. %m%. %y%"; $CMS['%december%'] = 'prosinec';
$CMS["%byAuthor%"]="%author%"; $CMS['%date%'] = '%d%. %m%. %y%';
$CMS["%byDate%"]="%date%, %time%"; $CMS['%byAuthor%'] = '%author%';
$CMS["%longTitle%"]="%title% - %pretitle%"; $CMS['%byDate%'] = '%date%, %time%';
$CMS["%enterpost%"]="Zadejte zprávu"; $CMS['%longTitle%'] = '%title% - %pretitle%';
$CMS["%messages:%"]="Vzkazy:"; $CMS['%enterpost%'] = 'Zadejte zprávu';
$CMS["%name:%"]="Jméno:"; $CMS['%messages:%'] = 'Vzkazy:';
$CMS["%message:%"]="Vzkaz:"; $CMS['%name:%'] = 'Jméno:';
$CMS["%password:%"]="Heslo:"; $CMS['%message:%'] = 'Vzkaz:';
$CMS["%red%"]="červená"; $CMS['%password:%'] = 'Heslo:';
$CMS["%green%"]="zelená"; $CMS['%red%'] = 'červená';
$CMS["%blue%"]="modrá"; $CMS['%green%'] = 'zelená';
$CMS["%yellow%"]="žlutá"; $CMS['%blue%'] = 'modrá';
$CMS["%purple%"]="fialová"; $CMS['%yellow%'] = 'žlutá';
$CMS["%color:%"]="Barva:"; $CMS['%purple%'] = 'fialová';
$CMS["%send%"]="Odeslat"; $CMS['%color:%'] = 'Barva:';
$CMS["%notrequiredpassword%"]="Není vyžadováno"; $CMS['%send%'] = 'Odeslat';
$CMS["%no%"]="ne"; $CMS['%notrequiredpassword%'] = 'Není vyžadováno';
$CMS["%yes%"]="ano"; $CMS['%no%'] = 'ne';
$CMS["%areyourobot%"]="Jste robot?"; $CMS['%yes%'] = 'ano';
$CMS["%www:%"]="WWW:"; $CMS['%areyourobot%'] = 'Jste robot?';
$CMS["%email:%"]="E-Mail:"; $CMS['%www:%'] = 'WWW:';
$CMS["%search%"]="Hledat"; $CMS['%email:%'] = 'E-Mail:';
$CMS["%req%"]="(vyžadováno)"; $CMS['%search%'] = 'Hledat';
$CMS["%gotop%"]="&#8593;Nahoru"; $CMS['%req%'] = '(vyžadováno)';
$CMS["%misspost%"]="Nezadali jste zprávu"; $CMS['%gotop%'] = '&#8593;Nahoru';
$CMS["%missname%"]="Nezadali jste jméno"; $CMS['%misspost%'] = 'Nezadali jste zprávu';
$CMS["%wrongcode%"]="Zadal jste špatný ověřovací kód"; $CMS['%missname%'] = 'Nezadali jste jméno';
$CMS["%wrongmail%"]="To co jste zadali není platný e-mail"; $CMS['%wrongcode%'] = 'Zadal jste špatný ověřovací kód';
$CMS["%saved%"]="Zpráva byla odeslána"; $CMS['%wrongmail%'] = 'To co jste zadali není platný e-mail';
$CMS["%notsaved%"]="Zpráva nebyla odeslána"; $CMS['%saved%'] = 'Zpráva byla odeslána';
$CMS["%showmail%"]="Zobrazovat e-mail každému"; $CMS['%notsaved%'] = 'Zpráva nebyla odeslána';
$CMS["%wrongwww%"]="To co jste zadali není platné <abbr title=\"Uniform Resource Locale\">URL</abbr>"; $CMS['%showmail%'] = 'Zobrazovat e-mail každému';
$CMS["%sbhelp%"]=<<<EOT $CMS['%wrongwww%'] = 'To co jste zadali není platné <abbr title="Uniform Resource Locale">URL</abbr>';
$CMS['%sbhelp%'] = <<<EOT
<h3>Nápověda</h3> <h3>Nápověda</h3>
<dl> <dl>
<dt><abbr title="HyperText Markup Language">HTML</abbr></dt><dd>není podporováno</dd> <dt><abbr title="HyperText Markup Language">HTML</abbr></dt><dd>není podporováno</dd>
@@ -59,10 +60,9 @@ $CMS["%sbhelp%"]=<<<EOT
<dt>[yellow]žluté písmo[/yellow]</dt><dd><span class="yellow">žluté písmo</span></dd> <dt>[yellow]žluté písmo[/yellow]</dt><dd><span class="yellow">žluté písmo</span></dd>
</dl> </dl>
EOT; EOT;
$CMS["%searchform%"]="006883172923970328180:3wantrdnnzy"; $CMS['%searchform%'] = '006883172923970328180:3wantrdnnzy';
$CMS["%eustring%"]="Tento projekt byl podpořen z Evropského fondu pro regionální rozvoj, fondu malých projektů Programu Cíl 3 na podporu přeshraniční spolupráce mezi Českou republikou a Svobodným státem Sasko 2007-2013."; $CMS['%eustring%'] = 'Tento projekt byl podpořen z Evropského fondu pro regionální rozvoj, fondu malých projektů Programu Cíl 3 na podporu přeshraniční spolupráce mezi Českou republikou a Svobodným státem Sasko 2007-2013.';
}else{ } else {
header("HTTP/1.0 403 Forbidden"); header('HTTP/1.0 403 Forbidden');
header("Location: /en/error/403"); header('Location: /en/error/403');
} }
?>

View File

@@ -1,52 +1,53 @@
<?php <?php
if($included==true){
$CMS["%by%"]="%author% ~ %date%, %time%"; if ($included == true) {
$CMS["%january%"]="of January"; $CMS['%by%'] = '%author% ~ %date%, %time%';
$CMS["%february%"]="of February"; $CMS['%january%'] = 'of January';
$CMS["%march%"]="of March"; $CMS['%february%'] = 'of February';
$CMS["%april%"]="of April"; $CMS['%march%'] = 'of March';
$CMS["%may%"]="of May"; $CMS['%april%'] = 'of April';
$CMS["%june%"]="of June"; $CMS['%may%'] = 'of May';
$CMS["%july%"]="of July"; $CMS['%june%'] = 'of June';
$CMS["%august%"]="of August"; $CMS['%july%'] = 'of July';
$CMS["%september%"]="of September"; $CMS['%august%'] = 'of August';
$CMS["%october%"]="of October"; $CMS['%september%'] = 'of September';
$CMS["%november%"]="of November"; $CMS['%october%'] = 'of October';
$CMS["%december%"]="of December"; $CMS['%november%'] = 'of November';
$CMS["%date%"]="%d%. %m%. %y%"; $CMS['%december%'] = 'of December';
$CMS["%byAuthor%"]="%author%"; $CMS['%date%'] = '%d%. %m%. %y%';
$CMS["%byDate%"]="%date%, %time%"; $CMS['%byAuthor%'] = '%author%';
$CMS["%longTitle%"]="%title% - %pretitle%"; $CMS['%byDate%'] = '%date%, %time%';
$CMS["%enterpost%"]="Enter message"; $CMS['%longTitle%'] = '%title% - %pretitle%';
$CMS["%messages:%"]="Messages:"; $CMS['%enterpost%'] = 'Enter message';
$CMS["%name:%"]="Name:"; $CMS['%messages:%'] = 'Messages:';
$CMS["%message:%"]="Message:"; $CMS['%name:%'] = 'Name:';
$CMS["%password:%"]="Password:"; $CMS['%message:%'] = 'Message:';
$CMS["%red%"]="red"; $CMS['%password:%'] = 'Password:';
$CMS["%green%"]="green"; $CMS['%red%'] = 'red';
$CMS["%blue%"]="blue"; $CMS['%green%'] = 'green';
$CMS["%yellow%"]="yellow"; $CMS['%blue%'] = 'blue';
$CMS["%purple%"]="purple"; $CMS['%yellow%'] = 'yellow';
$CMS["%color:%"]="Color:"; $CMS['%purple%'] = 'purple';
$CMS["%send%"]="Submit"; $CMS['%color:%'] = 'Color:';
$CMS["%notrequiredpassword%"]="Not required"; $CMS['%send%'] = 'Submit';
$CMS["%no%"]="no"; $CMS['%notrequiredpassword%'] = 'Not required';
$CMS["%yes%"]="yes"; $CMS['%no%'] = 'no';
$CMS["%areyourobot%"]="Are you robot?"; $CMS['%yes%'] = 'yes';
$CMS["%www:%"]="WWW:"; $CMS['%areyourobot%'] = 'Are you robot?';
$CMS["%email:%"]="E-Mail:"; $CMS['%www:%'] = 'WWW:';
$CMS["%search%"]="Search"; $CMS['%email:%'] = 'E-Mail:';
$CMS["%req%"]="(required)"; $CMS['%search%'] = 'Search';
$CMS["%gotop%"]="&#8593;Go top"; $CMS['%req%'] = '(required)';
$CMS["%misspost%"]="Message is missing"; $CMS['%gotop%'] = '&#8593;Go top';
$CMS["%missname%"]="Name is missing"; $CMS['%misspost%'] = 'Message is missing';
$CMS["%wrongcode%"]="You have entered wrong verification code"; $CMS['%missname%'] = 'Name is missing';
$CMS["%wrongmail%"]="You have entered wrong e-mail"; $CMS['%wrongcode%'] = 'You have entered wrong verification code';
$CMS["%saved%"]="Message have been sent"; $CMS['%wrongmail%'] = 'You have entered wrong e-mail';
$CMS["%notsaved%"]="Message have not been sent"; $CMS['%saved%'] = 'Message have been sent';
$CMS["%showmail%"]="Show e-mail to everyone"; $CMS['%notsaved%'] = 'Message have not been sent';
$CMS["%wrongwww%"]="You have entered wrong <abbr title=\"Uniform Resource Locale\">URL</abbr>"; $CMS['%showmail%'] = 'Show e-mail to everyone';
$CMS["%sbhelp%"]=<<<EOT $CMS['%wrongwww%'] = 'You have entered wrong <abbr title="Uniform Resource Locale">URL</abbr>';
$CMS['%sbhelp%'] = <<<EOT
<h3>Help</h3> <h3>Help</h3>
<dl> <dl>
<dt><abbr title="HyperText Markup Language">HTML</abbr></dt><dd>not supported</dd> <dt><abbr title="HyperText Markup Language">HTML</abbr></dt><dd>not supported</dd>
@@ -59,10 +60,9 @@ $CMS["%sbhelp%"]=<<<EOT
<dt>[yellow]yellow text[/yellow]</dt><dd><span class="yellow">yellow text</span></dd> <dt>[yellow]yellow text[/yellow]</dt><dd><span class="yellow">yellow text</span></dd>
</dl> </dl>
EOT; EOT;
$CMS["%searchform%"]="006883172923970328180:bfehocs55i8"; $CMS['%searchform%'] = '006883172923970328180:bfehocs55i8';
$CMS["%eustring%"]="Das Projekt wurde von dem Europäischen Fonds für Regionalentwicklung (KPF, Ziel 3 - Programm zur Förderung der grenzübergreifenden Zusammenarbeit zwischen dem Freistaat Sachsen und der Tschechischen Republik 2007-2013) unterstützt."; $CMS['%eustring%'] = 'Das Projekt wurde von dem Europäischen Fonds für Regionalentwicklung (KPF, Ziel 3 - Programm zur Förderung der grenzübergreifenden Zusammenarbeit zwischen dem Freistaat Sachsen und der Tschechischen Republik 2007-2013) unterstützt.';
}else{ } else {
header("HTTP/1.0 403 Forbidden"); header('HTTP/1.0 403 Forbidden');
header("Location: /en/error/403"); header('Location: /en/error/403');
} }
?>

View File

@@ -1,52 +1,53 @@
<?php <?php
if($included==true){
$CMS["%by%"]="%author% ~ %date%, %time%"; if ($included == true) {
$CMS["%january%"]="of January"; $CMS['%by%'] = '%author% ~ %date%, %time%';
$CMS["%february%"]="of February"; $CMS['%january%'] = 'of January';
$CMS["%march%"]="of March"; $CMS['%february%'] = 'of February';
$CMS["%april%"]="of April"; $CMS['%march%'] = 'of March';
$CMS["%may%"]="of May"; $CMS['%april%'] = 'of April';
$CMS["%june%"]="of June"; $CMS['%may%'] = 'of May';
$CMS["%july%"]="of July"; $CMS['%june%'] = 'of June';
$CMS["%august%"]="of August"; $CMS['%july%'] = 'of July';
$CMS["%september%"]="of September"; $CMS['%august%'] = 'of August';
$CMS["%october%"]="of October"; $CMS['%september%'] = 'of September';
$CMS["%november%"]="of November"; $CMS['%october%'] = 'of October';
$CMS["%december%"]="of December"; $CMS['%november%'] = 'of November';
$CMS["%date%"]="%d%. %m%. %y%"; $CMS['%december%'] = 'of December';
$CMS["%byAuthor%"]="%author%"; $CMS['%date%'] = '%d%. %m%. %y%';
$CMS["%byDate%"]="%date%, %time%"; $CMS['%byAuthor%'] = '%author%';
$CMS["%longTitle%"]="%title% - %pretitle%"; $CMS['%byDate%'] = '%date%, %time%';
$CMS["%enterpost%"]="Enter message"; $CMS['%longTitle%'] = '%title% - %pretitle%';
$CMS["%messages:%"]="Messages:"; $CMS['%enterpost%'] = 'Enter message';
$CMS["%name:%"]="Name:"; $CMS['%messages:%'] = 'Messages:';
$CMS["%message:%"]="Message:"; $CMS['%name:%'] = 'Name:';
$CMS["%password:%"]="Password:"; $CMS['%message:%'] = 'Message:';
$CMS["%red%"]="red"; $CMS['%password:%'] = 'Password:';
$CMS["%green%"]="green"; $CMS['%red%'] = 'red';
$CMS["%blue%"]="blue"; $CMS['%green%'] = 'green';
$CMS["%yellow%"]="yellow"; $CMS['%blue%'] = 'blue';
$CMS["%purple%"]="purple"; $CMS['%yellow%'] = 'yellow';
$CMS["%color:%"]="Color:"; $CMS['%purple%'] = 'purple';
$CMS["%send%"]="Submit"; $CMS['%color:%'] = 'Color:';
$CMS["%notrequiredpassword%"]="Not required"; $CMS['%send%'] = 'Submit';
$CMS["%no%"]="no"; $CMS['%notrequiredpassword%'] = 'Not required';
$CMS["%yes%"]="yes"; $CMS['%no%'] = 'no';
$CMS["%areyourobot%"]="Are you robot?"; $CMS['%yes%'] = 'yes';
$CMS["%www:%"]="WWW:"; $CMS['%areyourobot%'] = 'Are you robot?';
$CMS["%email:%"]="E-Mail:"; $CMS['%www:%'] = 'WWW:';
$CMS["%search%"]="Search"; $CMS['%email:%'] = 'E-Mail:';
$CMS["%req%"]="(required)"; $CMS['%search%'] = 'Search';
$CMS["%gotop%"]="&#8593;Go top"; $CMS['%req%'] = '(required)';
$CMS["%misspost%"]="Message is missing"; $CMS['%gotop%'] = '&#8593;Go top';
$CMS["%missname%"]="Name is missing"; $CMS['%misspost%'] = 'Message is missing';
$CMS["%wrongcode%"]="You have entered wrong verification code"; $CMS['%missname%'] = 'Name is missing';
$CMS["%wrongmail%"]="You have entered wrong e-mail"; $CMS['%wrongcode%'] = 'You have entered wrong verification code';
$CMS["%saved%"]="Message have been sent"; $CMS['%wrongmail%'] = 'You have entered wrong e-mail';
$CMS["%notsaved%"]="Message have not been sent"; $CMS['%saved%'] = 'Message have been sent';
$CMS["%showmail%"]="Show e-mail to everyone"; $CMS['%notsaved%'] = 'Message have not been sent';
$CMS["%wrongwww%"]="You have entered wrong <abbr title=\"Uniform Resource Locale\">URL</abbr>"; $CMS['%showmail%'] = 'Show e-mail to everyone';
$CMS["%sbhelp%"]=<<<EOT $CMS['%wrongwww%'] = 'You have entered wrong <abbr title="Uniform Resource Locale">URL</abbr>';
$CMS['%sbhelp%'] = <<<EOT
<h3>Help</h3> <h3>Help</h3>
<dl> <dl>
<dt><abbr title="HyperText Markup Language">HTML</abbr></dt><dd>not supported</dd> <dt><abbr title="HyperText Markup Language">HTML</abbr></dt><dd>not supported</dd>
@@ -59,10 +60,9 @@ $CMS["%sbhelp%"]=<<<EOT
<dt>[yellow]yellow text[/yellow]</dt><dd><span class="yellow">yellow text</span></dd> <dt>[yellow]yellow text[/yellow]</dt><dd><span class="yellow">yellow text</span></dd>
</dl> </dl>
EOT; EOT;
$CMS["%searchform%"]="006883172923970328180:bfehocs55i8"; $CMS['%searchform%'] = '006883172923970328180:bfehocs55i8';
$CMS["%eustring%"]="The project was supported from European fund of regional development, Common fund of small projects, Programme \"Cil 3\" supporting collaboration of the Czech Republic and Free State Saxony 2007-2013."; $CMS['%eustring%'] = 'The project was supported from European fund of regional development, Common fund of small projects, Programme "Cil 3" supporting collaboration of the Czech Republic and Free State Saxony 2007-2013.';
}else{ } else {
header("HTTP/1.0 403 Forbidden"); header('HTTP/1.0 403 Forbidden');
header("Location: /en/error/403"); header('Location: /en/error/403');
} }
?>

View File

@@ -1,81 +1,84 @@
<?php <?php
function stringEndsWith($string, $end) { function stringEndsWith($string, $end) {
if(strLen($end)==0) if (strlen($end) == 0) {
return false; return false;
return (substr($string, -strLen($end))==$end); }
return substr($string, -strlen($end)) == $end;
} }
session_start(); session_start();
$included=true; $included = true;
$locale = 'cs'; $locale = 'cs';
$url=$_SERVER["REQUEST_URI"]; $url = $_SERVER['REQUEST_URI'];
$root="/2012-prosinec/"; $root = '/2012-prosinec/';
$uri = substr($_SERVER['REQUEST_URI'], strpos($_SERVER['REQUEST_URI'], $root)+strlen($root)); $uri = substr($_SERVER['REQUEST_URI'], strpos($_SERVER['REQUEST_URI'], $root) + strlen($root));
if($uri==''){ if ($uri == '') {
header('Location: http://'.$_SERVER['HTTP_HOST'].$root.$locale.'/'); header('Location: http://' . $_SERVER['HTTP_HOST'] . $root . $locale . '/');
exit; exit;
}elseif(preg_match('/^([a-z]{2})\\/(.+)(\\?.*)?$/', $uri, $matches)){ } elseif (preg_match('/^([a-z]{2})\\/(.+)(\\?.*)?$/', $uri, $matches)) {
$lang = htmlspecialchars(substr($matches[1], 0, 2)); $lang = htmlspecialchars(substr($matches[1], 0, 2));
if(stringEndsWith($matches[2], 'main')){ if (stringEndsWith($matches[2], 'main')) {
header('Location: http://'.$_SERVER['HTTP_HOST'].$root.$lang.'/'.substr($matches[2], 0, -4)); header('Location: http://' . $_SERVER['HTTP_HOST'] . $root . $lang . '/' . substr($matches[2], 0, -4));
exit; exit;
} }
$_GET['page'] = $matches[2]; $_GET['page'] = $matches[2];
}elseif(preg_match('/^([a-z]{2})\\/(?:(.*)\\/)?$/', $uri, $matches)){ } elseif (preg_match('/^([a-z]{2})\\/(?:(.*)\\/)?$/', $uri, $matches)) {
$lang = htmlspecialchars(substr($matches[1], 0, 2)); $lang = htmlspecialchars(substr($matches[1], 0, 2));
$_GET['page'] = (isset($matches[2])?$matches[2].'/':'').'main'; $_GET['page'] = (isset($matches[2]) ? $matches[2] . '/' : '') . 'main';
}else{ } else {
$_GET['error'] = 404; $_GET['error'] = 404;
} }
$page=htmlspecialchars($_GET["page"]); $page = htmlspecialchars($_GET['page']);
$pretitle="3. Česko-německý skirogaining"; $pretitle = '3. Česko-německý skirogaining';
$mainMail="tojnar@gmail.com"; $mainMail = 'tojnar@gmail.com';
include($lang.".php"); include $lang . '.php';
$CMS["%url%"]="http://".$_SERVER['HTTP_HOST'].htmlspecialchars($url); $CMS['%url%'] = 'http://' . $_SERVER['HTTP_HOST'] . htmlspecialchars($url);
$CMS["%root%"]=rtrim($root, '/'); $CMS['%root%'] = rtrim($root, '/');
$CMS["%lang%"]=$lang; $CMS['%lang%'] = $lang;
$CMS["%unknownAuthor%"]="Jan Tojnar"; $CMS['%unknownAuthor%'] = 'Jan Tojnar';
$CMS["%headerLinkHref%"]=rplc("%root%/").$lang; $CMS['%headerLinkHref%'] = rplc('%root%/') . $lang;
$CMS["%pretitle%"]=$pretitle; $CMS['%pretitle%'] = $pretitle;
$CMS["%comefrom%"]=$_SERVER["HTTP_REFERER"]; $CMS['%comefrom%'] = $_SERVER['HTTP_REFERER'];
$CMS["%dateFormat%"]="d.m.Y H:i"; $CMS['%dateFormat%'] = 'd.m.Y H:i';
function rplc($string){ function rplc($string) {
global $CMS; global $CMS;
return str_replace(array_keys($CMS),$CMS,$string);
return str_replace(array_keys($CMS), $CMS, $string);
} }
require __DIR__ . '/../sboard.php'; require __DIR__ . '/../sboard.php';
require __DIR__ . '/../load.lib.php'; require __DIR__ . '/../load.lib.php';
readPage($page); readPage($page);
$CMS["%releasedate%"]=toDate($date); $CMS['%releasedate%'] = toDate($date);
$CMS["%releasetime%"]=toTime($date); $CMS['%releasetime%'] = toTime($date);
if(isReleased($date)==false){ if (isReleased($date) == false) {
$notreleased=true; $notreleased = true;
}else{ } else {
$notreleased=false; $notreleased = false;
} }
if($notreleased==true){ if ($notreleased == true) {
readPage("error/notreleased"); readPage('error/notreleased');
} }
$CMS["%title%"]=$title; $CMS['%title%'] = $title;
$CMS["%titleTag%"]=str_replace(array("%pretitle%","%title%"),array($pretitle,$title),rplc("%longTitle%")); $CMS['%titleTag%'] = str_replace(['%pretitle%', '%title%'], [$pretitle, $title], rplc('%longTitle%'));
$CMS["%langPanel%"]=$langPanel; $CMS['%langPanel%'] = $langPanel;
$CMS["%article%"]=$article; $CMS['%article%'] = $article;
$CMS["%menu%"]=$menu; $CMS['%menu%'] = $menu;
if(!empty($author) AND !empty($date)){ if (!empty($author) and !empty($date)) {
$aInfo=str_replace(array("%author%","%date%","%time%"),array(author($author),toDate($date),toTime($date)),rplc("%by%")); $aInfo = str_replace(['%author%', '%date%', '%time%'], [author($author), toDate($date), toTime($date)], rplc('%by%'));
}elseif(!empty($author)){ } elseif (!empty($author)) {
$aInfo=str_replace("%author%",author($author),rplc("%byAuthor%")); $aInfo = str_replace('%author%', author($author), rplc('%byAuthor%'));
}elseif(!empty($date)){ } elseif (!empty($date)) {
$aInfo=str_replace(array("%date%","%time%"),array(toDate($date),toTime($date)),rplc("%byDate%")); $aInfo = str_replace(['%date%', '%time%'], [toDate($date), toTime($date)], rplc('%byDate%'));
}else{ } else {
$aInfo=""; $aInfo = '';
} }
//var_dump(date(rplc("%dateFormat%"),filemtime($realPage))); //var_dump(date(rplc("%dateFormat%"),filemtime($realPage)));
$CMS["%author%"]=$author; $CMS['%author%'] = $author;
$CMS["%ainfo%"]=$aInfo; $CMS['%ainfo%'] = $aInfo;
?> ?>
<?php <?php
ob_start(/*"ob_gzhandler"*/); ob_start(/*"ob_gzhandler"*/);
include("template.html"); include 'template.html';
$buffer=ob_get_clean(); $buffer = ob_get_clean();
echo(rplc(rplc($buffer))); echo rplc(rplc($buffer));
?> ?>

View File

@@ -1,30 +1,31 @@
<?php <?php
header("Content-Type: text/plain; charset=utf-8");
function directoryToArray($directory,$recursive){ header('Content-Type: text/plain; charset=utf-8');
$array_items=array(); function directoryToArray($directory, $recursive) {
if($handle=opendir($directory)){ $array_items = [];
while(false!==($file=readdir($handle))){ if ($handle = opendir($directory)) {
if($file!="."&&$file!=".."){ while (false !== ($file = readdir($handle))) {
if(is_dir($directory."/".$file)){ if ($file != '.' && $file != '..') {
if($recursive){ if (is_dir($directory . '/' . $file)) {
$array_items=array_merge($array_items,directoryToArray($directory. "/".$file,$recursive)); if ($recursive) {
$array_items = array_merge($array_items, directoryToArray($directory . '/' . $file, $recursive));
}
$file = $directory . '/' . $file;
} else {
$file = $directory . '/' . $file;
$array_items[] = preg_replace("/\/\//si", '/', $file);
}
}
}
closedir($handle);
}
return $array_items;
} }
$file=$directory."/".$file; $files = directoryToArray('./pages', true);
}else{ foreach ($files as $file) {
$file=$directory."/".$file; if (substr($file, -3) == '.pg' and (substr($file, 0, 17) != './pages/cs/error/' and substr($file, 0, 17) != './pages/en/error/' and substr($file, 0, 17) != './pages/de/error/')) {
$array_items[]=preg_replace("/\/\//si","/",$file); $list .= substr($file, 0, -3) . "\n";
}
} }
} echo str_replace('./pages', 'http://' . $_SERVER['HTTP_HOST'], $list);
}
closedir($handle);
}
return $array_items;
}
$files=directoryToArray("./pages",true);
foreach($files as $file){
if(substr($file,-3)==".pg" AND (substr($file,0,17)!="./pages/cs/error/" AND substr($file,0,17)!="./pages/en/error/" AND substr($file,0,17)!="./pages/de/error/")){
$list.=substr($file,0,-3)."\n";
}
}
echo(str_replace("./pages","http://".$_SERVER["HTTP_HOST"],$list));
?>

View File

@@ -1,52 +1,53 @@
<?php <?php
if($included==true){
$CMS["%by%"]="%author% ~ %date%, %time%"; if ($included == true) {
$CMS["%january%"]="leden"; $CMS['%by%'] = '%author% ~ %date%, %time%';
$CMS["%february%"]="únor"; $CMS['%january%'] = 'leden';
$CMS["%march%"]="březen"; $CMS['%february%'] = 'únor';
$CMS["%april%"]="duben"; $CMS['%march%'] = 'březen';
$CMS["%may%"]="květen"; $CMS['%april%'] = 'duben';
$CMS["%june%"]="červen"; $CMS['%may%'] = 'květen';
$CMS["%july%"]="červenec"; $CMS['%june%'] = 'červen';
$CMS["%august%"]="srpen"; $CMS['%july%'] = 'červenec';
$CMS["%september%"]="září"; $CMS['%august%'] = 'srpen';
$CMS["%october%"]="říjen"; $CMS['%september%'] = 'září';
$CMS["%november%"]="listopad"; $CMS['%october%'] = 'říjen';
$CMS["%december%"]="prosinec"; $CMS['%november%'] = 'listopad';
$CMS["%date%"]="%d%. %m%. %y%"; $CMS['%december%'] = 'prosinec';
$CMS["%byAuthor%"]="%author%"; $CMS['%date%'] = '%d%. %m%. %y%';
$CMS["%byDate%"]="%date%, %time%"; $CMS['%byAuthor%'] = '%author%';
$CMS["%longTitle%"]="%title% - %pretitle%"; $CMS['%byDate%'] = '%date%, %time%';
$CMS["%enterpost%"]="Zadejte zprávu"; $CMS['%longTitle%'] = '%title% - %pretitle%';
$CMS["%messages:%"]="Vzkazy:"; $CMS['%enterpost%'] = 'Zadejte zprávu';
$CMS["%name:%"]="Jméno:"; $CMS['%messages:%'] = 'Vzkazy:';
$CMS["%message:%"]="Vzkaz:"; $CMS['%name:%'] = 'Jméno:';
$CMS["%password:%"]="Heslo:"; $CMS['%message:%'] = 'Vzkaz:';
$CMS["%red%"]="červená"; $CMS['%password:%'] = 'Heslo:';
$CMS["%green%"]="zelená"; $CMS['%red%'] = 'červená';
$CMS["%blue%"]="modrá"; $CMS['%green%'] = 'zelená';
$CMS["%yellow%"]="žlutá"; $CMS['%blue%'] = 'modrá';
$CMS["%purple%"]="fialová"; $CMS['%yellow%'] = 'žlutá';
$CMS["%color:%"]="Barva:"; $CMS['%purple%'] = 'fialová';
$CMS["%send%"]="Odeslat"; $CMS['%color:%'] = 'Barva:';
$CMS["%notrequiredpassword%"]="Není vyžadováno"; $CMS['%send%'] = 'Odeslat';
$CMS["%no%"]="ne"; $CMS['%notrequiredpassword%'] = 'Není vyžadováno';
$CMS["%yes%"]="ano"; $CMS['%no%'] = 'ne';
$CMS["%areyourobot%"]="Jste robot?"; $CMS['%yes%'] = 'ano';
$CMS["%www:%"]="WWW:"; $CMS['%areyourobot%'] = 'Jste robot?';
$CMS["%email:%"]="E-Mail:"; $CMS['%www:%'] = 'WWW:';
$CMS["%search%"]="Hledat"; $CMS['%email:%'] = 'E-Mail:';
$CMS["%req%"]="(vyžadováno)"; $CMS['%search%'] = 'Hledat';
$CMS["%gotop%"]="&#8593;Nahoru"; $CMS['%req%'] = '(vyžadováno)';
$CMS["%misspost%"]="Nezadali jste zprávu"; $CMS['%gotop%'] = '&#8593;Nahoru';
$CMS["%missname%"]="Nezadali jste jméno"; $CMS['%misspost%'] = 'Nezadali jste zprávu';
$CMS["%wrongcode%"]="Zadal jste špatný ověřovací kód"; $CMS['%missname%'] = 'Nezadali jste jméno';
$CMS["%wrongmail%"]="To co jste zadali není platný e-mail"; $CMS['%wrongcode%'] = 'Zadal jste špatný ověřovací kód';
$CMS["%saved%"]="Zpráva byla odeslána"; $CMS['%wrongmail%'] = 'To co jste zadali není platný e-mail';
$CMS["%notsaved%"]="Zpráva nebyla odeslána"; $CMS['%saved%'] = 'Zpráva byla odeslána';
$CMS["%showmail%"]="Zobrazovat e-mail každému"; $CMS['%notsaved%'] = 'Zpráva nebyla odeslána';
$CMS["%wrongwww%"]="To co jste zadali není platné <abbr title=\"Uniform Resource Locale\">URL</abbr>"; $CMS['%showmail%'] = 'Zobrazovat e-mail každému';
$CMS["%sbhelp%"]=<<<EOT $CMS['%wrongwww%'] = 'To co jste zadali není platné <abbr title="Uniform Resource Locale">URL</abbr>';
$CMS['%sbhelp%'] = <<<EOT
<h3>Nápověda</h3> <h3>Nápověda</h3>
<dl> <dl>
<dt><abbr title="HyperText Markup Language">HTML</abbr></dt><dd>není podporováno</dd> <dt><abbr title="HyperText Markup Language">HTML</abbr></dt><dd>není podporováno</dd>
@@ -59,10 +60,9 @@ $CMS["%sbhelp%"]=<<<EOT
<dt>[yellow]žluté písmo[/yellow]</dt><dd><span class="yellow">žluté písmo</span></dd> <dt>[yellow]žluté písmo[/yellow]</dt><dd><span class="yellow">žluté písmo</span></dd>
</dl> </dl>
EOT; EOT;
$CMS["%searchform%"]="006883172923970328180:3wantrdnnzy"; $CMS['%searchform%'] = '006883172923970328180:3wantrdnnzy';
$CMS["%eustring%"]="Tento projekt byl podpořen z Evropského fondu pro regionální rozvoj, fondu malých projektů Programu Cíl 3 na podporu přeshraniční spolupráce mezi Českou republikou a Svobodným státem Sasko 2007-2013."; $CMS['%eustring%'] = 'Tento projekt byl podpořen z Evropského fondu pro regionální rozvoj, fondu malých projektů Programu Cíl 3 na podporu přeshraniční spolupráce mezi Českou republikou a Svobodným státem Sasko 2007-2013.';
}else{ } else {
header("HTTP/1.0 403 Forbidden"); header('HTTP/1.0 403 Forbidden');
header("Location: /en/error/403"); header('Location: /en/error/403');
} }
?>

View File

@@ -1,52 +1,53 @@
<?php <?php
if($included==true){
$CMS["%by%"]="%author% ~ %date%, %time%"; if ($included == true) {
$CMS["%january%"]="of January"; $CMS['%by%'] = '%author% ~ %date%, %time%';
$CMS["%february%"]="of February"; $CMS['%january%'] = 'of January';
$CMS["%march%"]="of March"; $CMS['%february%'] = 'of February';
$CMS["%april%"]="of April"; $CMS['%march%'] = 'of March';
$CMS["%may%"]="of May"; $CMS['%april%'] = 'of April';
$CMS["%june%"]="of June"; $CMS['%may%'] = 'of May';
$CMS["%july%"]="of July"; $CMS['%june%'] = 'of June';
$CMS["%august%"]="of August"; $CMS['%july%'] = 'of July';
$CMS["%september%"]="of September"; $CMS['%august%'] = 'of August';
$CMS["%october%"]="of October"; $CMS['%september%'] = 'of September';
$CMS["%november%"]="of November"; $CMS['%october%'] = 'of October';
$CMS["%december%"]="of December"; $CMS['%november%'] = 'of November';
$CMS["%date%"]="%d%. %m%. %y%"; $CMS['%december%'] = 'of December';
$CMS["%byAuthor%"]="%author%"; $CMS['%date%'] = '%d%. %m%. %y%';
$CMS["%byDate%"]="%date%, %time%"; $CMS['%byAuthor%'] = '%author%';
$CMS["%longTitle%"]="%title% - %pretitle%"; $CMS['%byDate%'] = '%date%, %time%';
$CMS["%enterpost%"]="Enter message"; $CMS['%longTitle%'] = '%title% - %pretitle%';
$CMS["%messages:%"]="Messages:"; $CMS['%enterpost%'] = 'Enter message';
$CMS["%name:%"]="Name:"; $CMS['%messages:%'] = 'Messages:';
$CMS["%message:%"]="Message:"; $CMS['%name:%'] = 'Name:';
$CMS["%password:%"]="Password:"; $CMS['%message:%'] = 'Message:';
$CMS["%red%"]="red"; $CMS['%password:%'] = 'Password:';
$CMS["%green%"]="green"; $CMS['%red%'] = 'red';
$CMS["%blue%"]="blue"; $CMS['%green%'] = 'green';
$CMS["%yellow%"]="yellow"; $CMS['%blue%'] = 'blue';
$CMS["%purple%"]="purple"; $CMS['%yellow%'] = 'yellow';
$CMS["%color:%"]="Color:"; $CMS['%purple%'] = 'purple';
$CMS["%send%"]="Submit"; $CMS['%color:%'] = 'Color:';
$CMS["%notrequiredpassword%"]="Not required"; $CMS['%send%'] = 'Submit';
$CMS["%no%"]="no"; $CMS['%notrequiredpassword%'] = 'Not required';
$CMS["%yes%"]="yes"; $CMS['%no%'] = 'no';
$CMS["%areyourobot%"]="Are you robot?"; $CMS['%yes%'] = 'yes';
$CMS["%www:%"]="WWW:"; $CMS['%areyourobot%'] = 'Are you robot?';
$CMS["%email:%"]="E-Mail:"; $CMS['%www:%'] = 'WWW:';
$CMS["%search%"]="Search"; $CMS['%email:%'] = 'E-Mail:';
$CMS["%req%"]="(required)"; $CMS['%search%'] = 'Search';
$CMS["%gotop%"]="&#8593;Go top"; $CMS['%req%'] = '(required)';
$CMS["%misspost%"]="Message is missing"; $CMS['%gotop%'] = '&#8593;Go top';
$CMS["%missname%"]="Name is missing"; $CMS['%misspost%'] = 'Message is missing';
$CMS["%wrongcode%"]="You have entered wrong verification code"; $CMS['%missname%'] = 'Name is missing';
$CMS["%wrongmail%"]="You have entered wrong e-mail"; $CMS['%wrongcode%'] = 'You have entered wrong verification code';
$CMS["%saved%"]="Message have been sent"; $CMS['%wrongmail%'] = 'You have entered wrong e-mail';
$CMS["%notsaved%"]="Message have not been sent"; $CMS['%saved%'] = 'Message have been sent';
$CMS["%showmail%"]="Show e-mail to everyone"; $CMS['%notsaved%'] = 'Message have not been sent';
$CMS["%wrongwww%"]="You have entered wrong <abbr title=\"Uniform Resource Locale\">URL</abbr>"; $CMS['%showmail%'] = 'Show e-mail to everyone';
$CMS["%sbhelp%"]=<<<EOT $CMS['%wrongwww%'] = 'You have entered wrong <abbr title="Uniform Resource Locale">URL</abbr>';
$CMS['%sbhelp%'] = <<<EOT
<h3>Help</h3> <h3>Help</h3>
<dl> <dl>
<dt><abbr title="HyperText Markup Language">HTML</abbr></dt><dd>not supported</dd> <dt><abbr title="HyperText Markup Language">HTML</abbr></dt><dd>not supported</dd>
@@ -59,10 +60,9 @@ $CMS["%sbhelp%"]=<<<EOT
<dt>[yellow]yellow text[/yellow]</dt><dd><span class="yellow">yellow text</span></dd> <dt>[yellow]yellow text[/yellow]</dt><dd><span class="yellow">yellow text</span></dd>
</dl> </dl>
EOT; EOT;
$CMS["%searchform%"]="006883172923970328180:bfehocs55i8"; $CMS['%searchform%'] = '006883172923970328180:bfehocs55i8';
$CMS["%eustring%"]="Das Projekt wurde von dem Europäischen Fonds für Regionalentwicklung (KPF, Ziel 3 - Programm zur Förderung der grenzübergreifenden Zusammenarbeit zwischen dem Freistaat Sachsen und der Tschechischen Republik 2007-2013) unterstützt."; $CMS['%eustring%'] = 'Das Projekt wurde von dem Europäischen Fonds für Regionalentwicklung (KPF, Ziel 3 - Programm zur Förderung der grenzübergreifenden Zusammenarbeit zwischen dem Freistaat Sachsen und der Tschechischen Republik 2007-2013) unterstützt.';
}else{ } else {
header("HTTP/1.0 403 Forbidden"); header('HTTP/1.0 403 Forbidden');
header("Location: /en/error/403"); header('Location: /en/error/403');
} }
?>

View File

@@ -1,52 +1,53 @@
<?php <?php
if($included==true){
$CMS["%by%"]="%author% ~ %date%, %time%"; if ($included == true) {
$CMS["%january%"]="of January"; $CMS['%by%'] = '%author% ~ %date%, %time%';
$CMS["%february%"]="of February"; $CMS['%january%'] = 'of January';
$CMS["%march%"]="of March"; $CMS['%february%'] = 'of February';
$CMS["%april%"]="of April"; $CMS['%march%'] = 'of March';
$CMS["%may%"]="of May"; $CMS['%april%'] = 'of April';
$CMS["%june%"]="of June"; $CMS['%may%'] = 'of May';
$CMS["%july%"]="of July"; $CMS['%june%'] = 'of June';
$CMS["%august%"]="of August"; $CMS['%july%'] = 'of July';
$CMS["%september%"]="of September"; $CMS['%august%'] = 'of August';
$CMS["%october%"]="of October"; $CMS['%september%'] = 'of September';
$CMS["%november%"]="of November"; $CMS['%october%'] = 'of October';
$CMS["%december%"]="of December"; $CMS['%november%'] = 'of November';
$CMS["%date%"]="%d%. %m%. %y%"; $CMS['%december%'] = 'of December';
$CMS["%byAuthor%"]="%author%"; $CMS['%date%'] = '%d%. %m%. %y%';
$CMS["%byDate%"]="%date%, %time%"; $CMS['%byAuthor%'] = '%author%';
$CMS["%longTitle%"]="%title% - %pretitle%"; $CMS['%byDate%'] = '%date%, %time%';
$CMS["%enterpost%"]="Enter message"; $CMS['%longTitle%'] = '%title% - %pretitle%';
$CMS["%messages:%"]="Messages:"; $CMS['%enterpost%'] = 'Enter message';
$CMS["%name:%"]="Name:"; $CMS['%messages:%'] = 'Messages:';
$CMS["%message:%"]="Message:"; $CMS['%name:%'] = 'Name:';
$CMS["%password:%"]="Password:"; $CMS['%message:%'] = 'Message:';
$CMS["%red%"]="red"; $CMS['%password:%'] = 'Password:';
$CMS["%green%"]="green"; $CMS['%red%'] = 'red';
$CMS["%blue%"]="blue"; $CMS['%green%'] = 'green';
$CMS["%yellow%"]="yellow"; $CMS['%blue%'] = 'blue';
$CMS["%purple%"]="purple"; $CMS['%yellow%'] = 'yellow';
$CMS["%color:%"]="Color:"; $CMS['%purple%'] = 'purple';
$CMS["%send%"]="Submit"; $CMS['%color:%'] = 'Color:';
$CMS["%notrequiredpassword%"]="Not required"; $CMS['%send%'] = 'Submit';
$CMS["%no%"]="no"; $CMS['%notrequiredpassword%'] = 'Not required';
$CMS["%yes%"]="yes"; $CMS['%no%'] = 'no';
$CMS["%areyourobot%"]="Are you robot?"; $CMS['%yes%'] = 'yes';
$CMS["%www:%"]="WWW:"; $CMS['%areyourobot%'] = 'Are you robot?';
$CMS["%email:%"]="E-Mail:"; $CMS['%www:%'] = 'WWW:';
$CMS["%search%"]="Search"; $CMS['%email:%'] = 'E-Mail:';
$CMS["%req%"]="(required)"; $CMS['%search%'] = 'Search';
$CMS["%gotop%"]="&#8593;Go top"; $CMS['%req%'] = '(required)';
$CMS["%misspost%"]="Message is missing"; $CMS['%gotop%'] = '&#8593;Go top';
$CMS["%missname%"]="Name is missing"; $CMS['%misspost%'] = 'Message is missing';
$CMS["%wrongcode%"]="You have entered wrong verification code"; $CMS['%missname%'] = 'Name is missing';
$CMS["%wrongmail%"]="You have entered wrong e-mail"; $CMS['%wrongcode%'] = 'You have entered wrong verification code';
$CMS["%saved%"]="Message have been sent"; $CMS['%wrongmail%'] = 'You have entered wrong e-mail';
$CMS["%notsaved%"]="Message have not been sent"; $CMS['%saved%'] = 'Message have been sent';
$CMS["%showmail%"]="Show e-mail to everyone"; $CMS['%notsaved%'] = 'Message have not been sent';
$CMS["%wrongwww%"]="You have entered wrong <abbr title=\"Uniform Resource Locale\">URL</abbr>"; $CMS['%showmail%'] = 'Show e-mail to everyone';
$CMS["%sbhelp%"]=<<<EOT $CMS['%wrongwww%'] = 'You have entered wrong <abbr title="Uniform Resource Locale">URL</abbr>';
$CMS['%sbhelp%'] = <<<EOT
<h3>Help</h3> <h3>Help</h3>
<dl> <dl>
<dt><abbr title="HyperText Markup Language">HTML</abbr></dt><dd>not supported</dd> <dt><abbr title="HyperText Markup Language">HTML</abbr></dt><dd>not supported</dd>
@@ -59,10 +60,9 @@ $CMS["%sbhelp%"]=<<<EOT
<dt>[yellow]yellow text[/yellow]</dt><dd><span class="yellow">yellow text</span></dd> <dt>[yellow]yellow text[/yellow]</dt><dd><span class="yellow">yellow text</span></dd>
</dl> </dl>
EOT; EOT;
$CMS["%searchform%"]="006883172923970328180:bfehocs55i8"; $CMS['%searchform%'] = '006883172923970328180:bfehocs55i8';
$CMS["%eustring%"]="The project was supported from European fund of regional development, Common fund of small projects, Programme \"Cil 3\" supporting collaboration of the Czech Republic and Free State Saxony 2007-2013."; $CMS['%eustring%'] = 'The project was supported from European fund of regional development, Common fund of small projects, Programme "Cil 3" supporting collaboration of the Czech Republic and Free State Saxony 2007-2013.';
}else{ } else {
header("HTTP/1.0 403 Forbidden"); header('HTTP/1.0 403 Forbidden');
header("Location: /en/error/403"); header('Location: /en/error/403');
} }
?>

View File

@@ -1,81 +1,84 @@
<?php <?php
function stringEndsWith($string, $end) { function stringEndsWith($string, $end) {
if(strLen($end)==0) if (strlen($end) == 0) {
return false; return false;
return (substr($string, -strLen($end))==$end); }
return substr($string, -strlen($end)) == $end;
} }
session_start(); session_start();
$included=true; $included = true;
$locale = 'cs'; $locale = 'cs';
$url=$_SERVER["REQUEST_URI"]; $url = $_SERVER['REQUEST_URI'];
$root="/2014/"; $root = '/2014/';
$uri = substr($_SERVER['REQUEST_URI'], strpos($_SERVER['REQUEST_URI'], $root)+strlen($root)); $uri = substr($_SERVER['REQUEST_URI'], strpos($_SERVER['REQUEST_URI'], $root) + strlen($root));
if($uri==''){ if ($uri == '') {
header('Location: http://'.$_SERVER['HTTP_HOST'].$root.$locale.'/'); header('Location: http://' . $_SERVER['HTTP_HOST'] . $root . $locale . '/');
exit; exit;
}elseif(preg_match('/^([a-z]{2})(?:\\/(.+)(\\?.*)?)?$/', $uri, $matches)){ } elseif (preg_match('/^([a-z]{2})(?:\\/(.+)(\\?.*)?)?$/', $uri, $matches)) {
$lang = htmlspecialchars(substr($matches[1], 0, 2)); $lang = htmlspecialchars(substr($matches[1], 0, 2));
if(stringEndsWith($matches[2], 'main')){ if (stringEndsWith($matches[2], 'main')) {
header('Location: http://'.$_SERVER['HTTP_HOST'].$root.$lang.'/'.substr($matches[2], 0, -4)); header('Location: http://' . $_SERVER['HTTP_HOST'] . $root . $lang . '/' . substr($matches[2], 0, -4));
exit; exit;
} }
$_GET['page'] = $matches[2]; $_GET['page'] = $matches[2];
}elseif(preg_match('/^([a-z]{2})\\/(?:(.*)\\/)?$/', $uri, $matches)){ } elseif (preg_match('/^([a-z]{2})\\/(?:(.*)\\/)?$/', $uri, $matches)) {
$lang = htmlspecialchars(substr($matches[1], 0, 2)); $lang = htmlspecialchars(substr($matches[1], 0, 2));
$_GET['page'] = (isset($matches[2])?$matches[2].'/':'').'main'; $_GET['page'] = (isset($matches[2]) ? $matches[2] . '/' : '') . 'main';
}else{ } else {
$_GET['error'] = 404; $_GET['error'] = 404;
} }
$page=htmlspecialchars($_GET["page"]); $page = htmlspecialchars($_GET['page']);
$pretitle="4. přeshraniční skirogaining"; $pretitle = '4. přeshraniční skirogaining';
$mainMail="tojnar@gmail.com"; $mainMail = 'tojnar@gmail.com';
include($lang.".php"); include $lang . '.php';
$CMS["%url%"]="http://".$_SERVER['HTTP_HOST'].htmlspecialchars($url); $CMS['%url%'] = 'http://' . $_SERVER['HTTP_HOST'] . htmlspecialchars($url);
$CMS["%root%"]=rtrim($root, '/'); $CMS['%root%'] = rtrim($root, '/');
$CMS["%lang%"]=$lang; $CMS['%lang%'] = $lang;
$CMS["%unknownAuthor%"]="Jan Tojnar"; $CMS['%unknownAuthor%'] = 'Jan Tojnar';
$CMS["%headerLinkHref%"]=rplc("%root%/").$lang; $CMS['%headerLinkHref%'] = rplc('%root%/') . $lang;
$CMS["%pretitle%"]=$pretitle; $CMS['%pretitle%'] = $pretitle;
$CMS["%comefrom%"]=$_SERVER["HTTP_REFERER"]; $CMS['%comefrom%'] = $_SERVER['HTTP_REFERER'];
$CMS["%dateFormat%"]="d.m.Y H:i"; $CMS['%dateFormat%'] = 'd.m.Y H:i';
function rplc($string){ function rplc($string) {
global $CMS; global $CMS;
return str_replace(array_keys($CMS),$CMS,$string);
return str_replace(array_keys($CMS), $CMS, $string);
} }
require __DIR__ . '/../sboard.php'; require __DIR__ . '/../sboard.php';
require __DIR__ . '/../load.lib.php'; require __DIR__ . '/../load.lib.php';
readPage($page); readPage($page);
$CMS["%releasedate%"]=toDate($date); $CMS['%releasedate%'] = toDate($date);
$CMS["%releasetime%"]=toTime($date); $CMS['%releasetime%'] = toTime($date);
if(isReleased($date)==false){ if (isReleased($date) == false) {
$notreleased=true; $notreleased = true;
}else{ } else {
$notreleased=false; $notreleased = false;
} }
if($notreleased==true){ if ($notreleased == true) {
readPage("error/notreleased"); readPage('error/notreleased');
} }
$CMS["%title%"]=$title; $CMS['%title%'] = $title;
$CMS["%titleTag%"]=str_replace(array("%pretitle%","%title%"),array($pretitle,$title),rplc("%longTitle%")); $CMS['%titleTag%'] = str_replace(['%pretitle%', '%title%'], [$pretitle, $title], rplc('%longTitle%'));
$CMS["%langPanel%"]=$langPanel; $CMS['%langPanel%'] = $langPanel;
$CMS["%article%"]=$article; $CMS['%article%'] = $article;
$CMS["%menu%"]=$menu; $CMS['%menu%'] = $menu;
if(!empty($author) AND !empty($date)){ if (!empty($author) and !empty($date)) {
$aInfo=str_replace(array("%author%","%date%","%time%"),array(author($author),toDate($date),toTime($date)),rplc("%by%")); $aInfo = str_replace(['%author%', '%date%', '%time%'], [author($author), toDate($date), toTime($date)], rplc('%by%'));
}elseif(!empty($author)){ } elseif (!empty($author)) {
$aInfo=str_replace("%author%",author($author),rplc("%byAuthor%")); $aInfo = str_replace('%author%', author($author), rplc('%byAuthor%'));
}elseif(!empty($date)){ } elseif (!empty($date)) {
$aInfo=str_replace(array("%date%","%time%"),array(toDate($date),toTime($date)),rplc("%byDate%")); $aInfo = str_replace(['%date%', '%time%'], [toDate($date), toTime($date)], rplc('%byDate%'));
}else{ } else {
$aInfo=""; $aInfo = '';
} }
//var_dump(date(rplc("%dateFormat%"),filemtime($realPage))); //var_dump(date(rplc("%dateFormat%"),filemtime($realPage)));
$CMS["%author%"]=$author; $CMS['%author%'] = $author;
$CMS["%ainfo%"]=$aInfo; $CMS['%ainfo%'] = $aInfo;
?> ?>
<?php <?php
ob_start(/*"ob_gzhandler"*/); ob_start(/*"ob_gzhandler"*/);
include("template.html"); include 'template.html';
$buffer=ob_get_clean(); $buffer = ob_get_clean();
echo(rplc(rplc($buffer))); echo rplc(rplc($buffer));
?> ?>

View File

@@ -1,30 +1,31 @@
<?php <?php
header("Content-Type: text/plain; charset=utf-8");
function directoryToArray($directory,$recursive){ header('Content-Type: text/plain; charset=utf-8');
$array_items=array(); function directoryToArray($directory, $recursive) {
if($handle=opendir($directory)){ $array_items = [];
while(false!==($file=readdir($handle))){ if ($handle = opendir($directory)) {
if($file!="."&&$file!=".."){ while (false !== ($file = readdir($handle))) {
if(is_dir($directory."/".$file)){ if ($file != '.' && $file != '..') {
if($recursive){ if (is_dir($directory . '/' . $file)) {
$array_items=array_merge($array_items,directoryToArray($directory. "/".$file,$recursive)); if ($recursive) {
$array_items = array_merge($array_items, directoryToArray($directory . '/' . $file, $recursive));
}
$file = $directory . '/' . $file;
} else {
$file = $directory . '/' . $file;
$array_items[] = preg_replace("/\/\//si", '/', $file);
}
}
}
closedir($handle);
}
return $array_items;
} }
$file=$directory."/".$file; $files = directoryToArray('./pages', true);
}else{ foreach ($files as $file) {
$file=$directory."/".$file; if (substr($file, -3) == '.pg' and (substr($file, 0, 17) != './pages/cs/error/' and substr($file, 0, 17) != './pages/en/error/' and substr($file, 0, 17) != './pages/de/error/')) {
$array_items[]=preg_replace("/\/\//si","/",$file); $list .= substr($file, 0, -3) . "\n";
}
} }
} echo str_replace('./pages', 'http://' . $_SERVER['HTTP_HOST'], $list);
}
closedir($handle);
}
return $array_items;
}
$files=directoryToArray("./pages",true);
foreach($files as $file){
if(substr($file,-3)==".pg" AND (substr($file,0,17)!="./pages/cs/error/" AND substr($file,0,17)!="./pages/en/error/" AND substr($file,0,17)!="./pages/de/error/")){
$list.=substr($file,0,-3)."\n";
}
}
echo(str_replace("./pages","http://".$_SERVER["HTTP_HOST"],$list));
?>

View File

@@ -1,52 +1,53 @@
<?php <?php
if($included==true){
$CMS["%by%"]="%author% ~ %date%, %time%"; if ($included == true) {
$CMS["%january%"]="leden"; $CMS['%by%'] = '%author% ~ %date%, %time%';
$CMS["%february%"]="únor"; $CMS['%january%'] = 'leden';
$CMS["%march%"]="březen"; $CMS['%february%'] = 'únor';
$CMS["%april%"]="duben"; $CMS['%march%'] = 'březen';
$CMS["%may%"]="květen"; $CMS['%april%'] = 'duben';
$CMS["%june%"]="červen"; $CMS['%may%'] = 'květen';
$CMS["%july%"]="červenec"; $CMS['%june%'] = 'červen';
$CMS["%august%"]="srpen"; $CMS['%july%'] = 'červenec';
$CMS["%september%"]="září"; $CMS['%august%'] = 'srpen';
$CMS["%october%"]="říjen"; $CMS['%september%'] = 'září';
$CMS["%november%"]="listopad"; $CMS['%october%'] = 'říjen';
$CMS["%december%"]="prosinec"; $CMS['%november%'] = 'listopad';
$CMS["%date%"]="%d%. %m%. %y%"; $CMS['%december%'] = 'prosinec';
$CMS["%byAuthor%"]="%author%"; $CMS['%date%'] = '%d%. %m%. %y%';
$CMS["%byDate%"]="%date%, %time%"; $CMS['%byAuthor%'] = '%author%';
$CMS["%longTitle%"]="%title% - %pretitle%"; $CMS['%byDate%'] = '%date%, %time%';
$CMS["%enterpost%"]="Zadejte zprávu"; $CMS['%longTitle%'] = '%title% - %pretitle%';
$CMS["%messages:%"]="Vzkazy:"; $CMS['%enterpost%'] = 'Zadejte zprávu';
$CMS["%name:%"]="Jméno:"; $CMS['%messages:%'] = 'Vzkazy:';
$CMS["%message:%"]="Vzkaz:"; $CMS['%name:%'] = 'Jméno:';
$CMS["%password:%"]="Heslo:"; $CMS['%message:%'] = 'Vzkaz:';
$CMS["%red%"]="červená"; $CMS['%password:%'] = 'Heslo:';
$CMS["%green%"]="zelená"; $CMS['%red%'] = 'červená';
$CMS["%blue%"]="modrá"; $CMS['%green%'] = 'zelená';
$CMS["%yellow%"]="žlutá"; $CMS['%blue%'] = 'modrá';
$CMS["%purple%"]="fialová"; $CMS['%yellow%'] = 'žlutá';
$CMS["%color:%"]="Barva:"; $CMS['%purple%'] = 'fialová';
$CMS["%send%"]="Odeslat"; $CMS['%color:%'] = 'Barva:';
$CMS["%notrequiredpassword%"]="Není vyžadováno"; $CMS['%send%'] = 'Odeslat';
$CMS["%no%"]="ne"; $CMS['%notrequiredpassword%'] = 'Není vyžadováno';
$CMS["%yes%"]="ano"; $CMS['%no%'] = 'ne';
$CMS["%areyourobot%"]="Jste robot?"; $CMS['%yes%'] = 'ano';
$CMS["%www:%"]="WWW:"; $CMS['%areyourobot%'] = 'Jste robot?';
$CMS["%email:%"]="E-Mail:"; $CMS['%www:%'] = 'WWW:';
$CMS["%search%"]="Hledat"; $CMS['%email:%'] = 'E-Mail:';
$CMS["%req%"]="(vyžadováno)"; $CMS['%search%'] = 'Hledat';
$CMS["%gotop%"]="&#8593;Nahoru"; $CMS['%req%'] = '(vyžadováno)';
$CMS["%misspost%"]="Nezadali jste zprávu"; $CMS['%gotop%'] = '&#8593;Nahoru';
$CMS["%missname%"]="Nezadali jste jméno"; $CMS['%misspost%'] = 'Nezadali jste zprávu';
$CMS["%wrongcode%"]="Zadal jste špatný ověřovací kód"; $CMS['%missname%'] = 'Nezadali jste jméno';
$CMS["%wrongmail%"]="To co jste zadali není platný e-mail"; $CMS['%wrongcode%'] = 'Zadal jste špatný ověřovací kód';
$CMS["%saved%"]="Zpráva byla odeslána"; $CMS['%wrongmail%'] = 'To co jste zadali není platný e-mail';
$CMS["%notsaved%"]="Zpráva nebyla odeslána"; $CMS['%saved%'] = 'Zpráva byla odeslána';
$CMS["%showmail%"]="Zobrazovat e-mail každému"; $CMS['%notsaved%'] = 'Zpráva nebyla odeslána';
$CMS["%wrongwww%"]="To co jste zadali není platné <abbr title=\"Uniform Resource Locale\">URL</abbr>"; $CMS['%showmail%'] = 'Zobrazovat e-mail každému';
$CMS["%sbhelp%"]=<<<EOT $CMS['%wrongwww%'] = 'To co jste zadali není platné <abbr title="Uniform Resource Locale">URL</abbr>';
$CMS['%sbhelp%'] = <<<EOT
<h3>Nápověda</h3> <h3>Nápověda</h3>
<dl> <dl>
<dt><abbr title="HyperText Markup Language">HTML</abbr></dt><dd>není podporováno</dd> <dt><abbr title="HyperText Markup Language">HTML</abbr></dt><dd>není podporováno</dd>
@@ -59,10 +60,9 @@ $CMS["%sbhelp%"]=<<<EOT
<dt>[yellow]žluté písmo[/yellow]</dt><dd><span class="yellow">žluté písmo</span></dd> <dt>[yellow]žluté písmo[/yellow]</dt><dd><span class="yellow">žluté písmo</span></dd>
</dl> </dl>
EOT; EOT;
$CMS["%searchform%"]="006883172923970328180:3wantrdnnzy"; $CMS['%searchform%'] = '006883172923970328180:3wantrdnnzy';
$CMS["%eustring%"]="Tento projekt byl podpořen z Evropského fondu pro regionální rozvoj, fondu malých projektů Programu Cíl 3 na podporu přeshraniční spolupráce mezi Českou republikou a Svobodným státem Sasko 2007-2013."; $CMS['%eustring%'] = 'Tento projekt byl podpořen z Evropského fondu pro regionální rozvoj, fondu malých projektů Programu Cíl 3 na podporu přeshraniční spolupráce mezi Českou republikou a Svobodným státem Sasko 2007-2013.';
}else{ } else {
header("HTTP/1.0 403 Forbidden"); header('HTTP/1.0 403 Forbidden');
header("Location: /en/error/403"); header('Location: /en/error/403');
} }
?>

View File

@@ -1,52 +1,53 @@
<?php <?php
if($included==true){
$CMS["%by%"]="%author% ~ %date%, %time%"; if ($included == true) {
$CMS["%january%"]="of January"; $CMS['%by%'] = '%author% ~ %date%, %time%';
$CMS["%february%"]="of February"; $CMS['%january%'] = 'of January';
$CMS["%march%"]="of March"; $CMS['%february%'] = 'of February';
$CMS["%april%"]="of April"; $CMS['%march%'] = 'of March';
$CMS["%may%"]="of May"; $CMS['%april%'] = 'of April';
$CMS["%june%"]="of June"; $CMS['%may%'] = 'of May';
$CMS["%july%"]="of July"; $CMS['%june%'] = 'of June';
$CMS["%august%"]="of August"; $CMS['%july%'] = 'of July';
$CMS["%september%"]="of September"; $CMS['%august%'] = 'of August';
$CMS["%october%"]="of October"; $CMS['%september%'] = 'of September';
$CMS["%november%"]="of November"; $CMS['%october%'] = 'of October';
$CMS["%december%"]="of December"; $CMS['%november%'] = 'of November';
$CMS["%date%"]="%d%. %m%. %y%"; $CMS['%december%'] = 'of December';
$CMS["%byAuthor%"]="%author%"; $CMS['%date%'] = '%d%. %m%. %y%';
$CMS["%byDate%"]="%date%, %time%"; $CMS['%byAuthor%'] = '%author%';
$CMS["%longTitle%"]="%title% - %pretitle%"; $CMS['%byDate%'] = '%date%, %time%';
$CMS["%enterpost%"]="Enter message"; $CMS['%longTitle%'] = '%title% - %pretitle%';
$CMS["%messages:%"]="Messages:"; $CMS['%enterpost%'] = 'Enter message';
$CMS["%name:%"]="Name:"; $CMS['%messages:%'] = 'Messages:';
$CMS["%message:%"]="Message:"; $CMS['%name:%'] = 'Name:';
$CMS["%password:%"]="Password:"; $CMS['%message:%'] = 'Message:';
$CMS["%red%"]="red"; $CMS['%password:%'] = 'Password:';
$CMS["%green%"]="green"; $CMS['%red%'] = 'red';
$CMS["%blue%"]="blue"; $CMS['%green%'] = 'green';
$CMS["%yellow%"]="yellow"; $CMS['%blue%'] = 'blue';
$CMS["%purple%"]="purple"; $CMS['%yellow%'] = 'yellow';
$CMS["%color:%"]="Color:"; $CMS['%purple%'] = 'purple';
$CMS["%send%"]="Submit"; $CMS['%color:%'] = 'Color:';
$CMS["%notrequiredpassword%"]="Not required"; $CMS['%send%'] = 'Submit';
$CMS["%no%"]="no"; $CMS['%notrequiredpassword%'] = 'Not required';
$CMS["%yes%"]="yes"; $CMS['%no%'] = 'no';
$CMS["%areyourobot%"]="Are you robot?"; $CMS['%yes%'] = 'yes';
$CMS["%www:%"]="WWW:"; $CMS['%areyourobot%'] = 'Are you robot?';
$CMS["%email:%"]="E-Mail:"; $CMS['%www:%'] = 'WWW:';
$CMS["%search%"]="Search"; $CMS['%email:%'] = 'E-Mail:';
$CMS["%req%"]="(required)"; $CMS['%search%'] = 'Search';
$CMS["%gotop%"]="&#8593;Go top"; $CMS['%req%'] = '(required)';
$CMS["%misspost%"]="Message is missing"; $CMS['%gotop%'] = '&#8593;Go top';
$CMS["%missname%"]="Name is missing"; $CMS['%misspost%'] = 'Message is missing';
$CMS["%wrongcode%"]="You have entered wrong verification code"; $CMS['%missname%'] = 'Name is missing';
$CMS["%wrongmail%"]="You have entered wrong e-mail"; $CMS['%wrongcode%'] = 'You have entered wrong verification code';
$CMS["%saved%"]="Message have been sent"; $CMS['%wrongmail%'] = 'You have entered wrong e-mail';
$CMS["%notsaved%"]="Message have not been sent"; $CMS['%saved%'] = 'Message have been sent';
$CMS["%showmail%"]="Show e-mail to everyone"; $CMS['%notsaved%'] = 'Message have not been sent';
$CMS["%wrongwww%"]="You have entered wrong <abbr title=\"Uniform Resource Locale\">URL</abbr>"; $CMS['%showmail%'] = 'Show e-mail to everyone';
$CMS["%sbhelp%"]=<<<EOT $CMS['%wrongwww%'] = 'You have entered wrong <abbr title="Uniform Resource Locale">URL</abbr>';
$CMS['%sbhelp%'] = <<<EOT
<h3>Help</h3> <h3>Help</h3>
<dl> <dl>
<dt><abbr title="HyperText Markup Language">HTML</abbr></dt><dd>not supported</dd> <dt><abbr title="HyperText Markup Language">HTML</abbr></dt><dd>not supported</dd>
@@ -59,10 +60,9 @@ $CMS["%sbhelp%"]=<<<EOT
<dt>[yellow]yellow text[/yellow]</dt><dd><span class="yellow">yellow text</span></dd> <dt>[yellow]yellow text[/yellow]</dt><dd><span class="yellow">yellow text</span></dd>
</dl> </dl>
EOT; EOT;
$CMS["%searchform%"]="006883172923970328180:bfehocs55i8"; $CMS['%searchform%'] = '006883172923970328180:bfehocs55i8';
$CMS["%eustring%"]="Das Projekt wurde von dem Europäischen Fonds für Regionalentwicklung (KPF, Ziel 3 - Programm zur Förderung der grenzübergreifenden Zusammenarbeit zwischen dem Freistaat Sachsen und der Tschechischen Republik 2007-2013) unterstützt."; $CMS['%eustring%'] = 'Das Projekt wurde von dem Europäischen Fonds für Regionalentwicklung (KPF, Ziel 3 - Programm zur Förderung der grenzübergreifenden Zusammenarbeit zwischen dem Freistaat Sachsen und der Tschechischen Republik 2007-2013) unterstützt.';
}else{ } else {
header("HTTP/1.0 403 Forbidden"); header('HTTP/1.0 403 Forbidden');
header("Location: /en/error/403"); header('Location: /en/error/403');
} }
?>

View File

@@ -1,52 +1,53 @@
<?php <?php
if($included==true){
$CMS["%by%"]="%author% ~ %date%, %time%"; if ($included == true) {
$CMS["%january%"]="of January"; $CMS['%by%'] = '%author% ~ %date%, %time%';
$CMS["%february%"]="of February"; $CMS['%january%'] = 'of January';
$CMS["%march%"]="of March"; $CMS['%february%'] = 'of February';
$CMS["%april%"]="of April"; $CMS['%march%'] = 'of March';
$CMS["%may%"]="of May"; $CMS['%april%'] = 'of April';
$CMS["%june%"]="of June"; $CMS['%may%'] = 'of May';
$CMS["%july%"]="of July"; $CMS['%june%'] = 'of June';
$CMS["%august%"]="of August"; $CMS['%july%'] = 'of July';
$CMS["%september%"]="of September"; $CMS['%august%'] = 'of August';
$CMS["%october%"]="of October"; $CMS['%september%'] = 'of September';
$CMS["%november%"]="of November"; $CMS['%october%'] = 'of October';
$CMS["%december%"]="of December"; $CMS['%november%'] = 'of November';
$CMS["%date%"]="%d%. %m%. %y%"; $CMS['%december%'] = 'of December';
$CMS["%byAuthor%"]="%author%"; $CMS['%date%'] = '%d%. %m%. %y%';
$CMS["%byDate%"]="%date%, %time%"; $CMS['%byAuthor%'] = '%author%';
$CMS["%longTitle%"]="%title% - %pretitle%"; $CMS['%byDate%'] = '%date%, %time%';
$CMS["%enterpost%"]="Enter message"; $CMS['%longTitle%'] = '%title% - %pretitle%';
$CMS["%messages:%"]="Messages:"; $CMS['%enterpost%'] = 'Enter message';
$CMS["%name:%"]="Name:"; $CMS['%messages:%'] = 'Messages:';
$CMS["%message:%"]="Message:"; $CMS['%name:%'] = 'Name:';
$CMS["%password:%"]="Password:"; $CMS['%message:%'] = 'Message:';
$CMS["%red%"]="red"; $CMS['%password:%'] = 'Password:';
$CMS["%green%"]="green"; $CMS['%red%'] = 'red';
$CMS["%blue%"]="blue"; $CMS['%green%'] = 'green';
$CMS["%yellow%"]="yellow"; $CMS['%blue%'] = 'blue';
$CMS["%purple%"]="purple"; $CMS['%yellow%'] = 'yellow';
$CMS["%color:%"]="Color:"; $CMS['%purple%'] = 'purple';
$CMS["%send%"]="Submit"; $CMS['%color:%'] = 'Color:';
$CMS["%notrequiredpassword%"]="Not required"; $CMS['%send%'] = 'Submit';
$CMS["%no%"]="no"; $CMS['%notrequiredpassword%'] = 'Not required';
$CMS["%yes%"]="yes"; $CMS['%no%'] = 'no';
$CMS["%areyourobot%"]="Are you robot?"; $CMS['%yes%'] = 'yes';
$CMS["%www:%"]="WWW:"; $CMS['%areyourobot%'] = 'Are you robot?';
$CMS["%email:%"]="E-Mail:"; $CMS['%www:%'] = 'WWW:';
$CMS["%search%"]="Search"; $CMS['%email:%'] = 'E-Mail:';
$CMS["%req%"]="(required)"; $CMS['%search%'] = 'Search';
$CMS["%gotop%"]="&#8593;Go top"; $CMS['%req%'] = '(required)';
$CMS["%misspost%"]="Message is missing"; $CMS['%gotop%'] = '&#8593;Go top';
$CMS["%missname%"]="Name is missing"; $CMS['%misspost%'] = 'Message is missing';
$CMS["%wrongcode%"]="You have entered wrong verification code"; $CMS['%missname%'] = 'Name is missing';
$CMS["%wrongmail%"]="You have entered wrong e-mail"; $CMS['%wrongcode%'] = 'You have entered wrong verification code';
$CMS["%saved%"]="Message have been sent"; $CMS['%wrongmail%'] = 'You have entered wrong e-mail';
$CMS["%notsaved%"]="Message have not been sent"; $CMS['%saved%'] = 'Message have been sent';
$CMS["%showmail%"]="Show e-mail to everyone"; $CMS['%notsaved%'] = 'Message have not been sent';
$CMS["%wrongwww%"]="You have entered wrong <abbr title=\"Uniform Resource Locale\">URL</abbr>"; $CMS['%showmail%'] = 'Show e-mail to everyone';
$CMS["%sbhelp%"]=<<<EOT $CMS['%wrongwww%'] = 'You have entered wrong <abbr title="Uniform Resource Locale">URL</abbr>';
$CMS['%sbhelp%'] = <<<EOT
<h3>Help</h3> <h3>Help</h3>
<dl> <dl>
<dt><abbr title="HyperText Markup Language">HTML</abbr></dt><dd>not supported</dd> <dt><abbr title="HyperText Markup Language">HTML</abbr></dt><dd>not supported</dd>
@@ -59,10 +60,9 @@ $CMS["%sbhelp%"]=<<<EOT
<dt>[yellow]yellow text[/yellow]</dt><dd><span class="yellow">yellow text</span></dd> <dt>[yellow]yellow text[/yellow]</dt><dd><span class="yellow">yellow text</span></dd>
</dl> </dl>
EOT; EOT;
$CMS["%searchform%"]="006883172923970328180:bfehocs55i8"; $CMS['%searchform%'] = '006883172923970328180:bfehocs55i8';
$CMS["%eustring%"]="The project was supported from European fund of regional development, Common fund of small projects, Programme \"Cil 3\" supporting collaboration of the Czech Republic and Free State Saxony 2007-2013."; $CMS['%eustring%'] = 'The project was supported from European fund of regional development, Common fund of small projects, Programme "Cil 3" supporting collaboration of the Czech Republic and Free State Saxony 2007-2013.';
}else{ } else {
header("HTTP/1.0 403 Forbidden"); header('HTTP/1.0 403 Forbidden');
header("Location: /en/error/403"); header('Location: /en/error/403');
} }
?>

View File

@@ -1,81 +1,84 @@
<?php <?php
function stringEndsWith($string, $end) { function stringEndsWith($string, $end) {
if(strLen($end)==0) if (strlen($end) == 0) {
return false; return false;
return (substr($string, -strLen($end))==$end); }
return substr($string, -strlen($end)) == $end;
} }
session_start(); session_start();
$included=true; $included = true;
$locale = 'cs'; $locale = 'cs';
$url=$_SERVER["REQUEST_URI"]; $url = $_SERVER['REQUEST_URI'];
$root="/2015-prosinec/"; $root = '/2015-prosinec/';
$uri = substr($_SERVER['REQUEST_URI'], strpos($_SERVER['REQUEST_URI'], $root)+strlen($root)); $uri = substr($_SERVER['REQUEST_URI'], strpos($_SERVER['REQUEST_URI'], $root) + strlen($root));
if($uri==''){ if ($uri == '') {
header('Location: http://'.$_SERVER['HTTP_HOST'].$root.$locale.'/'); header('Location: http://' . $_SERVER['HTTP_HOST'] . $root . $locale . '/');
exit; exit;
}elseif(preg_match('/^([a-z]{2})(?:\\/(.+)(\\?.*)?)?$/', $uri, $matches)){ } elseif (preg_match('/^([a-z]{2})(?:\\/(.+)(\\?.*)?)?$/', $uri, $matches)) {
$lang = htmlspecialchars(substr($matches[1], 0, 2)); $lang = htmlspecialchars(substr($matches[1], 0, 2));
if(stringEndsWith($matches[2], 'main')){ if (stringEndsWith($matches[2], 'main')) {
header('Location: http://'.$_SERVER['HTTP_HOST'].$root.$lang.'/'.substr($matches[2], 0, -4)); header('Location: http://' . $_SERVER['HTTP_HOST'] . $root . $lang . '/' . substr($matches[2], 0, -4));
exit; exit;
} }
$_GET['page'] = $matches[2]; $_GET['page'] = $matches[2];
}elseif(preg_match('/^([a-z]{2})\\/(?:(.*)\\/)?$/', $uri, $matches)){ } elseif (preg_match('/^([a-z]{2})\\/(?:(.*)\\/)?$/', $uri, $matches)) {
$lang = htmlspecialchars(substr($matches[1], 0, 2)); $lang = htmlspecialchars(substr($matches[1], 0, 2));
$_GET['page'] = (isset($matches[2])?$matches[2].'/':'').'main'; $_GET['page'] = (isset($matches[2]) ? $matches[2] . '/' : '') . 'main';
}else{ } else {
$_GET['error'] = 404; $_GET['error'] = 404;
} }
$page=htmlspecialchars($_GET["page"]); $page = htmlspecialchars($_GET['page']);
$pretitle="6. přeshraniční skirogaining"; $pretitle = '6. přeshraniční skirogaining';
$mainMail="tojnar@gmail.com"; $mainMail = 'tojnar@gmail.com';
include($lang.".php"); include $lang . '.php';
$CMS["%url%"]="http://".$_SERVER['HTTP_HOST'].htmlspecialchars($url); $CMS['%url%'] = 'http://' . $_SERVER['HTTP_HOST'] . htmlspecialchars($url);
$CMS["%root%"]=rtrim($root, '/'); $CMS['%root%'] = rtrim($root, '/');
$CMS["%lang%"]=$lang; $CMS['%lang%'] = $lang;
$CMS["%unknownAuthor%"]="Jan Tojnar"; $CMS['%unknownAuthor%'] = 'Jan Tojnar';
$CMS["%headerLinkHref%"]=rplc("%root%/").$lang; $CMS['%headerLinkHref%'] = rplc('%root%/') . $lang;
$CMS["%pretitle%"]=$pretitle; $CMS['%pretitle%'] = $pretitle;
$CMS["%comefrom%"]=$_SERVER["HTTP_REFERER"]; $CMS['%comefrom%'] = $_SERVER['HTTP_REFERER'];
$CMS["%dateFormat%"]="d.m.Y H:i"; $CMS['%dateFormat%'] = 'd.m.Y H:i';
function rplc($string){ function rplc($string) {
global $CMS; global $CMS;
return str_replace(array_keys($CMS),$CMS,$string);
return str_replace(array_keys($CMS), $CMS, $string);
} }
require __DIR__ . '/../sboard.php'; require __DIR__ . '/../sboard.php';
require __DIR__ . '/../load.lib.php'; require __DIR__ . '/../load.lib.php';
readPage($page); readPage($page);
$CMS["%releasedate%"]=toDate($date); $CMS['%releasedate%'] = toDate($date);
$CMS["%releasetime%"]=toTime($date); $CMS['%releasetime%'] = toTime($date);
if(isReleased($date)==false){ if (isReleased($date) == false) {
$notreleased=true; $notreleased = true;
}else{ } else {
$notreleased=false; $notreleased = false;
} }
if($notreleased==true){ if ($notreleased == true) {
readPage("error/notreleased"); readPage('error/notreleased');
} }
$CMS["%title%"]=$title; $CMS['%title%'] = $title;
$CMS["%titleTag%"]=str_replace(array("%pretitle%","%title%"),array($pretitle,$title),rplc("%longTitle%")); $CMS['%titleTag%'] = str_replace(['%pretitle%', '%title%'], [$pretitle, $title], rplc('%longTitle%'));
$CMS["%langPanel%"]=$langPanel; $CMS['%langPanel%'] = $langPanel;
$CMS["%article%"]=$article; $CMS['%article%'] = $article;
$CMS["%menu%"]=$menu; $CMS['%menu%'] = $menu;
if(!empty($author) AND !empty($date)){ if (!empty($author) and !empty($date)) {
$aInfo=str_replace(array("%author%","%date%","%time%"),array(author($author),toDate($date),toTime($date)),rplc("%by%")); $aInfo = str_replace(['%author%', '%date%', '%time%'], [author($author), toDate($date), toTime($date)], rplc('%by%'));
}elseif(!empty($author)){ } elseif (!empty($author)) {
$aInfo=str_replace("%author%",author($author),rplc("%byAuthor%")); $aInfo = str_replace('%author%', author($author), rplc('%byAuthor%'));
}elseif(!empty($date)){ } elseif (!empty($date)) {
$aInfo=str_replace(array("%date%","%time%"),array(toDate($date),toTime($date)),rplc("%byDate%")); $aInfo = str_replace(['%date%', '%time%'], [toDate($date), toTime($date)], rplc('%byDate%'));
}else{ } else {
$aInfo=""; $aInfo = '';
} }
//var_dump(date(rplc("%dateFormat%"),filemtime($realPage))); //var_dump(date(rplc("%dateFormat%"),filemtime($realPage)));
$CMS["%author%"]=$author; $CMS['%author%'] = $author;
$CMS["%ainfo%"]=$aInfo; $CMS['%ainfo%'] = $aInfo;
?> ?>
<?php <?php
ob_start(/*"ob_gzhandler"*/); ob_start(/*"ob_gzhandler"*/);
include("template.html"); include 'template.html';
$buffer=ob_get_clean(); $buffer = ob_get_clean();
echo(rplc(rplc($buffer))); echo rplc(rplc($buffer));
?> ?>

View File

@@ -1,30 +1,31 @@
<?php <?php
header("Content-Type: text/plain; charset=utf-8");
function directoryToArray($directory,$recursive){ header('Content-Type: text/plain; charset=utf-8');
$array_items=array(); function directoryToArray($directory, $recursive) {
if($handle=opendir($directory)){ $array_items = [];
while(false!==($file=readdir($handle))){ if ($handle = opendir($directory)) {
if($file!="."&&$file!=".."){ while (false !== ($file = readdir($handle))) {
if(is_dir($directory."/".$file)){ if ($file != '.' && $file != '..') {
if($recursive){ if (is_dir($directory . '/' . $file)) {
$array_items=array_merge($array_items,directoryToArray($directory. "/".$file,$recursive)); if ($recursive) {
$array_items = array_merge($array_items, directoryToArray($directory . '/' . $file, $recursive));
}
$file = $directory . '/' . $file;
} else {
$file = $directory . '/' . $file;
$array_items[] = preg_replace("/\/\//si", '/', $file);
}
}
}
closedir($handle);
}
return $array_items;
} }
$file=$directory."/".$file; $files = directoryToArray('./pages', true);
}else{ foreach ($files as $file) {
$file=$directory."/".$file; if (substr($file, -3) == '.pg' and (substr($file, 0, 17) != './pages/cs/error/' and substr($file, 0, 17) != './pages/en/error/' and substr($file, 0, 17) != './pages/de/error/')) {
$array_items[]=preg_replace("/\/\//si","/",$file); $list .= substr($file, 0, -3) . "\n";
}
} }
} echo str_replace('./pages', 'http://' . $_SERVER['HTTP_HOST'], $list);
}
closedir($handle);
}
return $array_items;
}
$files=directoryToArray("./pages",true);
foreach($files as $file){
if(substr($file,-3)==".pg" AND (substr($file,0,17)!="./pages/cs/error/" AND substr($file,0,17)!="./pages/en/error/" AND substr($file,0,17)!="./pages/de/error/")){
$list.=substr($file,0,-3)."\n";
}
}
echo(str_replace("./pages","http://".$_SERVER["HTTP_HOST"],$list));
?>

View File

@@ -1,52 +1,53 @@
<?php <?php
if($included==true){
$CMS["%by%"]="%author% ~ %date%, %time%"; if ($included == true) {
$CMS["%january%"]="leden"; $CMS['%by%'] = '%author% ~ %date%, %time%';
$CMS["%february%"]="únor"; $CMS['%january%'] = 'leden';
$CMS["%march%"]="březen"; $CMS['%february%'] = 'únor';
$CMS["%april%"]="duben"; $CMS['%march%'] = 'březen';
$CMS["%may%"]="květen"; $CMS['%april%'] = 'duben';
$CMS["%june%"]="červen"; $CMS['%may%'] = 'květen';
$CMS["%july%"]="červenec"; $CMS['%june%'] = 'červen';
$CMS["%august%"]="srpen"; $CMS['%july%'] = 'červenec';
$CMS["%september%"]="září"; $CMS['%august%'] = 'srpen';
$CMS["%october%"]="říjen"; $CMS['%september%'] = 'září';
$CMS["%november%"]="listopad"; $CMS['%october%'] = 'říjen';
$CMS["%december%"]="prosinec"; $CMS['%november%'] = 'listopad';
$CMS["%date%"]="%d%. %m%. %y%"; $CMS['%december%'] = 'prosinec';
$CMS["%byAuthor%"]="%author%"; $CMS['%date%'] = '%d%. %m%. %y%';
$CMS["%byDate%"]="%date%, %time%"; $CMS['%byAuthor%'] = '%author%';
$CMS["%longTitle%"]="%title% - %pretitle%"; $CMS['%byDate%'] = '%date%, %time%';
$CMS["%enterpost%"]="Zadejte zprávu"; $CMS['%longTitle%'] = '%title% - %pretitle%';
$CMS["%messages:%"]="Vzkazy:"; $CMS['%enterpost%'] = 'Zadejte zprávu';
$CMS["%name:%"]="Jméno:"; $CMS['%messages:%'] = 'Vzkazy:';
$CMS["%message:%"]="Vzkaz:"; $CMS['%name:%'] = 'Jméno:';
$CMS["%password:%"]="Heslo:"; $CMS['%message:%'] = 'Vzkaz:';
$CMS["%red%"]="červená"; $CMS['%password:%'] = 'Heslo:';
$CMS["%green%"]="zelená"; $CMS['%red%'] = 'červená';
$CMS["%blue%"]="modrá"; $CMS['%green%'] = 'zelená';
$CMS["%yellow%"]="žlutá"; $CMS['%blue%'] = 'modrá';
$CMS["%purple%"]="fialová"; $CMS['%yellow%'] = 'žlutá';
$CMS["%color:%"]="Barva:"; $CMS['%purple%'] = 'fialová';
$CMS["%send%"]="Odeslat"; $CMS['%color:%'] = 'Barva:';
$CMS["%notrequiredpassword%"]="Není vyžadováno"; $CMS['%send%'] = 'Odeslat';
$CMS["%no%"]="ne"; $CMS['%notrequiredpassword%'] = 'Není vyžadováno';
$CMS["%yes%"]="ano"; $CMS['%no%'] = 'ne';
$CMS["%areyourobot%"]="Jste robot?"; $CMS['%yes%'] = 'ano';
$CMS["%www:%"]="WWW:"; $CMS['%areyourobot%'] = 'Jste robot?';
$CMS["%email:%"]="E-Mail:"; $CMS['%www:%'] = 'WWW:';
$CMS["%search%"]="Hledat"; $CMS['%email:%'] = 'E-Mail:';
$CMS["%req%"]="(vyžadováno)"; $CMS['%search%'] = 'Hledat';
$CMS["%gotop%"]="&#8593;Nahoru"; $CMS['%req%'] = '(vyžadováno)';
$CMS["%misspost%"]="Nezadali jste zprávu"; $CMS['%gotop%'] = '&#8593;Nahoru';
$CMS["%missname%"]="Nezadali jste jméno"; $CMS['%misspost%'] = 'Nezadali jste zprávu';
$CMS["%wrongcode%"]="Zadal jste špatný ověřovací kód"; $CMS['%missname%'] = 'Nezadali jste jméno';
$CMS["%wrongmail%"]="To co jste zadali není platný e-mail"; $CMS['%wrongcode%'] = 'Zadal jste špatný ověřovací kód';
$CMS["%saved%"]="Zpráva byla odeslána"; $CMS['%wrongmail%'] = 'To co jste zadali není platný e-mail';
$CMS["%notsaved%"]="Zpráva nebyla odeslána"; $CMS['%saved%'] = 'Zpráva byla odeslána';
$CMS["%showmail%"]="Zobrazovat e-mail každému"; $CMS['%notsaved%'] = 'Zpráva nebyla odeslána';
$CMS["%wrongwww%"]="To co jste zadali není platné <abbr title=\"Uniform Resource Locale\">URL</abbr>"; $CMS['%showmail%'] = 'Zobrazovat e-mail každému';
$CMS["%sbhelp%"]=<<<EOT $CMS['%wrongwww%'] = 'To co jste zadali není platné <abbr title="Uniform Resource Locale">URL</abbr>';
$CMS['%sbhelp%'] = <<<EOT
<h3>Nápověda</h3> <h3>Nápověda</h3>
<dl> <dl>
<dt><abbr title="HyperText Markup Language">HTML</abbr></dt><dd>není podporováno</dd> <dt><abbr title="HyperText Markup Language">HTML</abbr></dt><dd>není podporováno</dd>
@@ -59,10 +60,9 @@ $CMS["%sbhelp%"]=<<<EOT
<dt>[yellow]žluté písmo[/yellow]</dt><dd><span class="yellow">žluté písmo</span></dd> <dt>[yellow]žluté písmo[/yellow]</dt><dd><span class="yellow">žluté písmo</span></dd>
</dl> </dl>
EOT; EOT;
$CMS["%searchform%"]="006883172923970328180:3wantrdnnzy"; $CMS['%searchform%'] = '006883172923970328180:3wantrdnnzy';
$CMS["%eustring%"]="Tento projekt byl podpořen z Evropského fondu pro regionální rozvoj, fondu malých projektů Programu Cíl 3 na podporu přeshraniční spolupráce mezi Českou republikou a Svobodným státem Sasko 2007-2013."; $CMS['%eustring%'] = 'Tento projekt byl podpořen z Evropského fondu pro regionální rozvoj, fondu malých projektů Programu Cíl 3 na podporu přeshraniční spolupráce mezi Českou republikou a Svobodným státem Sasko 2007-2013.';
}else{ } else {
header("HTTP/1.0 403 Forbidden"); header('HTTP/1.0 403 Forbidden');
header("Location: /en/error/403"); header('Location: /en/error/403');
} }
?>

View File

@@ -1,52 +1,53 @@
<?php <?php
if($included==true){
$CMS["%by%"]="%author% ~ %date%, %time%"; if ($included == true) {
$CMS["%january%"]="of January"; $CMS['%by%'] = '%author% ~ %date%, %time%';
$CMS["%february%"]="of February"; $CMS['%january%'] = 'of January';
$CMS["%march%"]="of March"; $CMS['%february%'] = 'of February';
$CMS["%april%"]="of April"; $CMS['%march%'] = 'of March';
$CMS["%may%"]="of May"; $CMS['%april%'] = 'of April';
$CMS["%june%"]="of June"; $CMS['%may%'] = 'of May';
$CMS["%july%"]="of July"; $CMS['%june%'] = 'of June';
$CMS["%august%"]="of August"; $CMS['%july%'] = 'of July';
$CMS["%september%"]="of September"; $CMS['%august%'] = 'of August';
$CMS["%october%"]="of October"; $CMS['%september%'] = 'of September';
$CMS["%november%"]="of November"; $CMS['%october%'] = 'of October';
$CMS["%december%"]="of December"; $CMS['%november%'] = 'of November';
$CMS["%date%"]="%d%. %m%. %y%"; $CMS['%december%'] = 'of December';
$CMS["%byAuthor%"]="%author%"; $CMS['%date%'] = '%d%. %m%. %y%';
$CMS["%byDate%"]="%date%, %time%"; $CMS['%byAuthor%'] = '%author%';
$CMS["%longTitle%"]="%title% - %pretitle%"; $CMS['%byDate%'] = '%date%, %time%';
$CMS["%enterpost%"]="Enter message"; $CMS['%longTitle%'] = '%title% - %pretitle%';
$CMS["%messages:%"]="Messages:"; $CMS['%enterpost%'] = 'Enter message';
$CMS["%name:%"]="Name:"; $CMS['%messages:%'] = 'Messages:';
$CMS["%message:%"]="Message:"; $CMS['%name:%'] = 'Name:';
$CMS["%password:%"]="Password:"; $CMS['%message:%'] = 'Message:';
$CMS["%red%"]="red"; $CMS['%password:%'] = 'Password:';
$CMS["%green%"]="green"; $CMS['%red%'] = 'red';
$CMS["%blue%"]="blue"; $CMS['%green%'] = 'green';
$CMS["%yellow%"]="yellow"; $CMS['%blue%'] = 'blue';
$CMS["%purple%"]="purple"; $CMS['%yellow%'] = 'yellow';
$CMS["%color:%"]="Color:"; $CMS['%purple%'] = 'purple';
$CMS["%send%"]="Submit"; $CMS['%color:%'] = 'Color:';
$CMS["%notrequiredpassword%"]="Not required"; $CMS['%send%'] = 'Submit';
$CMS["%no%"]="no"; $CMS['%notrequiredpassword%'] = 'Not required';
$CMS["%yes%"]="yes"; $CMS['%no%'] = 'no';
$CMS["%areyourobot%"]="Are you robot?"; $CMS['%yes%'] = 'yes';
$CMS["%www:%"]="WWW:"; $CMS['%areyourobot%'] = 'Are you robot?';
$CMS["%email:%"]="E-Mail:"; $CMS['%www:%'] = 'WWW:';
$CMS["%search%"]="Search"; $CMS['%email:%'] = 'E-Mail:';
$CMS["%req%"]="(required)"; $CMS['%search%'] = 'Search';
$CMS["%gotop%"]="&#8593;Go top"; $CMS['%req%'] = '(required)';
$CMS["%misspost%"]="Message is missing"; $CMS['%gotop%'] = '&#8593;Go top';
$CMS["%missname%"]="Name is missing"; $CMS['%misspost%'] = 'Message is missing';
$CMS["%wrongcode%"]="You have entered wrong verification code"; $CMS['%missname%'] = 'Name is missing';
$CMS["%wrongmail%"]="You have entered wrong e-mail"; $CMS['%wrongcode%'] = 'You have entered wrong verification code';
$CMS["%saved%"]="Message have been sent"; $CMS['%wrongmail%'] = 'You have entered wrong e-mail';
$CMS["%notsaved%"]="Message have not been sent"; $CMS['%saved%'] = 'Message have been sent';
$CMS["%showmail%"]="Show e-mail to everyone"; $CMS['%notsaved%'] = 'Message have not been sent';
$CMS["%wrongwww%"]="You have entered wrong <abbr title=\"Uniform Resource Locale\">URL</abbr>"; $CMS['%showmail%'] = 'Show e-mail to everyone';
$CMS["%sbhelp%"]=<<<EOT $CMS['%wrongwww%'] = 'You have entered wrong <abbr title="Uniform Resource Locale">URL</abbr>';
$CMS['%sbhelp%'] = <<<EOT
<h3>Help</h3> <h3>Help</h3>
<dl> <dl>
<dt><abbr title="HyperText Markup Language">HTML</abbr></dt><dd>not supported</dd> <dt><abbr title="HyperText Markup Language">HTML</abbr></dt><dd>not supported</dd>
@@ -59,10 +60,9 @@ $CMS["%sbhelp%"]=<<<EOT
<dt>[yellow]yellow text[/yellow]</dt><dd><span class="yellow">yellow text</span></dd> <dt>[yellow]yellow text[/yellow]</dt><dd><span class="yellow">yellow text</span></dd>
</dl> </dl>
EOT; EOT;
$CMS["%searchform%"]="006883172923970328180:bfehocs55i8"; $CMS['%searchform%'] = '006883172923970328180:bfehocs55i8';
$CMS["%eustring%"]="Das Projekt wurde von dem Europäischen Fonds für Regionalentwicklung (KPF, Ziel 3 - Programm zur Förderung der grenzübergreifenden Zusammenarbeit zwischen dem Freistaat Sachsen und der Tschechischen Republik 2007-2013) unterstützt."; $CMS['%eustring%'] = 'Das Projekt wurde von dem Europäischen Fonds für Regionalentwicklung (KPF, Ziel 3 - Programm zur Förderung der grenzübergreifenden Zusammenarbeit zwischen dem Freistaat Sachsen und der Tschechischen Republik 2007-2013) unterstützt.';
}else{ } else {
header("HTTP/1.0 403 Forbidden"); header('HTTP/1.0 403 Forbidden');
header("Location: /en/error/403"); header('Location: /en/error/403');
} }
?>

View File

@@ -1,52 +1,53 @@
<?php <?php
if($included==true){
$CMS["%by%"]="%author% ~ %date%, %time%"; if ($included == true) {
$CMS["%january%"]="of January"; $CMS['%by%'] = '%author% ~ %date%, %time%';
$CMS["%february%"]="of February"; $CMS['%january%'] = 'of January';
$CMS["%march%"]="of March"; $CMS['%february%'] = 'of February';
$CMS["%april%"]="of April"; $CMS['%march%'] = 'of March';
$CMS["%may%"]="of May"; $CMS['%april%'] = 'of April';
$CMS["%june%"]="of June"; $CMS['%may%'] = 'of May';
$CMS["%july%"]="of July"; $CMS['%june%'] = 'of June';
$CMS["%august%"]="of August"; $CMS['%july%'] = 'of July';
$CMS["%september%"]="of September"; $CMS['%august%'] = 'of August';
$CMS["%october%"]="of October"; $CMS['%september%'] = 'of September';
$CMS["%november%"]="of November"; $CMS['%october%'] = 'of October';
$CMS["%december%"]="of December"; $CMS['%november%'] = 'of November';
$CMS["%date%"]="%d%. %m%. %y%"; $CMS['%december%'] = 'of December';
$CMS["%byAuthor%"]="%author%"; $CMS['%date%'] = '%d%. %m%. %y%';
$CMS["%byDate%"]="%date%, %time%"; $CMS['%byAuthor%'] = '%author%';
$CMS["%longTitle%"]="%title% - %pretitle%"; $CMS['%byDate%'] = '%date%, %time%';
$CMS["%enterpost%"]="Enter message"; $CMS['%longTitle%'] = '%title% - %pretitle%';
$CMS["%messages:%"]="Messages:"; $CMS['%enterpost%'] = 'Enter message';
$CMS["%name:%"]="Name:"; $CMS['%messages:%'] = 'Messages:';
$CMS["%message:%"]="Message:"; $CMS['%name:%'] = 'Name:';
$CMS["%password:%"]="Password:"; $CMS['%message:%'] = 'Message:';
$CMS["%red%"]="red"; $CMS['%password:%'] = 'Password:';
$CMS["%green%"]="green"; $CMS['%red%'] = 'red';
$CMS["%blue%"]="blue"; $CMS['%green%'] = 'green';
$CMS["%yellow%"]="yellow"; $CMS['%blue%'] = 'blue';
$CMS["%purple%"]="purple"; $CMS['%yellow%'] = 'yellow';
$CMS["%color:%"]="Color:"; $CMS['%purple%'] = 'purple';
$CMS["%send%"]="Submit"; $CMS['%color:%'] = 'Color:';
$CMS["%notrequiredpassword%"]="Not required"; $CMS['%send%'] = 'Submit';
$CMS["%no%"]="no"; $CMS['%notrequiredpassword%'] = 'Not required';
$CMS["%yes%"]="yes"; $CMS['%no%'] = 'no';
$CMS["%areyourobot%"]="Are you robot?"; $CMS['%yes%'] = 'yes';
$CMS["%www:%"]="WWW:"; $CMS['%areyourobot%'] = 'Are you robot?';
$CMS["%email:%"]="E-Mail:"; $CMS['%www:%'] = 'WWW:';
$CMS["%search%"]="Search"; $CMS['%email:%'] = 'E-Mail:';
$CMS["%req%"]="(required)"; $CMS['%search%'] = 'Search';
$CMS["%gotop%"]="&#8593;Go top"; $CMS['%req%'] = '(required)';
$CMS["%misspost%"]="Message is missing"; $CMS['%gotop%'] = '&#8593;Go top';
$CMS["%missname%"]="Name is missing"; $CMS['%misspost%'] = 'Message is missing';
$CMS["%wrongcode%"]="You have entered wrong verification code"; $CMS['%missname%'] = 'Name is missing';
$CMS["%wrongmail%"]="You have entered wrong e-mail"; $CMS['%wrongcode%'] = 'You have entered wrong verification code';
$CMS["%saved%"]="Message have been sent"; $CMS['%wrongmail%'] = 'You have entered wrong e-mail';
$CMS["%notsaved%"]="Message have not been sent"; $CMS['%saved%'] = 'Message have been sent';
$CMS["%showmail%"]="Show e-mail to everyone"; $CMS['%notsaved%'] = 'Message have not been sent';
$CMS["%wrongwww%"]="You have entered wrong <abbr title=\"Uniform Resource Locale\">URL</abbr>"; $CMS['%showmail%'] = 'Show e-mail to everyone';
$CMS["%sbhelp%"]=<<<EOT $CMS['%wrongwww%'] = 'You have entered wrong <abbr title="Uniform Resource Locale">URL</abbr>';
$CMS['%sbhelp%'] = <<<EOT
<h3>Help</h3> <h3>Help</h3>
<dl> <dl>
<dt><abbr title="HyperText Markup Language">HTML</abbr></dt><dd>not supported</dd> <dt><abbr title="HyperText Markup Language">HTML</abbr></dt><dd>not supported</dd>
@@ -59,10 +60,9 @@ $CMS["%sbhelp%"]=<<<EOT
<dt>[yellow]yellow text[/yellow]</dt><dd><span class="yellow">yellow text</span></dd> <dt>[yellow]yellow text[/yellow]</dt><dd><span class="yellow">yellow text</span></dd>
</dl> </dl>
EOT; EOT;
$CMS["%searchform%"]="006883172923970328180:bfehocs55i8"; $CMS['%searchform%'] = '006883172923970328180:bfehocs55i8';
$CMS["%eustring%"]="The project was supported from European fund of regional development, Common fund of small projects, Programme \"Cil 3\" supporting collaboration of the Czech Republic and Free State Saxony 2007-2013."; $CMS['%eustring%'] = 'The project was supported from European fund of regional development, Common fund of small projects, Programme "Cil 3" supporting collaboration of the Czech Republic and Free State Saxony 2007-2013.';
}else{ } else {
header("HTTP/1.0 403 Forbidden"); header('HTTP/1.0 403 Forbidden');
header("Location: /en/error/403"); header('Location: /en/error/403');
} }
?>

View File

@@ -1,81 +1,84 @@
<?php <?php
function stringEndsWith($string, $end) { function stringEndsWith($string, $end) {
if(strLen($end)==0) if (strlen($end) == 0) {
return false; return false;
return (substr($string, -strLen($end))==$end); }
return substr($string, -strlen($end)) == $end;
} }
session_start(); session_start();
$included=true; $included = true;
$locale = 'cs'; $locale = 'cs';
$url=$_SERVER["REQUEST_URI"]; $url = $_SERVER['REQUEST_URI'];
$root="/2015/"; $root = '/2015/';
$uri = substr($_SERVER['REQUEST_URI'], strpos($_SERVER['REQUEST_URI'], $root)+strlen($root)); $uri = substr($_SERVER['REQUEST_URI'], strpos($_SERVER['REQUEST_URI'], $root) + strlen($root));
if($uri==''){ if ($uri == '') {
header('Location: http://'.$_SERVER['HTTP_HOST'].$root.$locale.'/'); header('Location: http://' . $_SERVER['HTTP_HOST'] . $root . $locale . '/');
exit; exit;
}elseif(preg_match('/^([a-z]{2})(?:\\/(.+)(\\?.*)?)?$/', $uri, $matches)){ } elseif (preg_match('/^([a-z]{2})(?:\\/(.+)(\\?.*)?)?$/', $uri, $matches)) {
$lang = htmlspecialchars(substr($matches[1], 0, 2)); $lang = htmlspecialchars(substr($matches[1], 0, 2));
if(stringEndsWith($matches[2], 'main')){ if (stringEndsWith($matches[2], 'main')) {
header('Location: http://'.$_SERVER['HTTP_HOST'].$root.$lang.'/'.substr($matches[2], 0, -4)); header('Location: http://' . $_SERVER['HTTP_HOST'] . $root . $lang . '/' . substr($matches[2], 0, -4));
exit; exit;
} }
$_GET['page'] = $matches[2]; $_GET['page'] = $matches[2];
}elseif(preg_match('/^([a-z]{2})\\/(?:(.*)\\/)?$/', $uri, $matches)){ } elseif (preg_match('/^([a-z]{2})\\/(?:(.*)\\/)?$/', $uri, $matches)) {
$lang = htmlspecialchars(substr($matches[1], 0, 2)); $lang = htmlspecialchars(substr($matches[1], 0, 2));
$_GET['page'] = (isset($matches[2])?$matches[2].'/':'').'main'; $_GET['page'] = (isset($matches[2]) ? $matches[2] . '/' : '') . 'main';
}else{ } else {
$_GET['error'] = 404; $_GET['error'] = 404;
} }
$page=htmlspecialchars($_GET["page"]); $page = htmlspecialchars($_GET['page']);
$pretitle="5. přeshraniční skirogaining"; $pretitle = '5. přeshraniční skirogaining';
$mainMail="tojnar@gmail.com"; $mainMail = 'tojnar@gmail.com';
include($lang.".php"); include $lang . '.php';
$CMS["%url%"]="http://".$_SERVER['HTTP_HOST'].htmlspecialchars($url); $CMS['%url%'] = 'http://' . $_SERVER['HTTP_HOST'] . htmlspecialchars($url);
$CMS["%root%"]=rtrim($root, '/'); $CMS['%root%'] = rtrim($root, '/');
$CMS["%lang%"]=$lang; $CMS['%lang%'] = $lang;
$CMS["%unknownAuthor%"]="Jan Tojnar"; $CMS['%unknownAuthor%'] = 'Jan Tojnar';
$CMS["%headerLinkHref%"]=rplc("%root%/").$lang; $CMS['%headerLinkHref%'] = rplc('%root%/') . $lang;
$CMS["%pretitle%"]=$pretitle; $CMS['%pretitle%'] = $pretitle;
$CMS["%comefrom%"]=$_SERVER["HTTP_REFERER"]; $CMS['%comefrom%'] = $_SERVER['HTTP_REFERER'];
$CMS["%dateFormat%"]="d.m.Y H:i"; $CMS['%dateFormat%'] = 'd.m.Y H:i';
function rplc($string){ function rplc($string) {
global $CMS; global $CMS;
return str_replace(array_keys($CMS),$CMS,$string);
return str_replace(array_keys($CMS), $CMS, $string);
} }
require __DIR__ . '/../sboard.php'; require __DIR__ . '/../sboard.php';
require __DIR__ . '/../load.lib.php'; require __DIR__ . '/../load.lib.php';
readPage($page); readPage($page);
$CMS["%releasedate%"]=toDate($date); $CMS['%releasedate%'] = toDate($date);
$CMS["%releasetime%"]=toTime($date); $CMS['%releasetime%'] = toTime($date);
if(isReleased($date)==false){ if (isReleased($date) == false) {
$notreleased=true; $notreleased = true;
}else{ } else {
$notreleased=false; $notreleased = false;
} }
if($notreleased==true){ if ($notreleased == true) {
readPage("error/notreleased"); readPage('error/notreleased');
} }
$CMS["%title%"]=$title; $CMS['%title%'] = $title;
$CMS["%titleTag%"]=str_replace(array("%pretitle%","%title%"),array($pretitle,$title),rplc("%longTitle%")); $CMS['%titleTag%'] = str_replace(['%pretitle%', '%title%'], [$pretitle, $title], rplc('%longTitle%'));
$CMS["%langPanel%"]=$langPanel; $CMS['%langPanel%'] = $langPanel;
$CMS["%article%"]=$article; $CMS['%article%'] = $article;
$CMS["%menu%"]=$menu; $CMS['%menu%'] = $menu;
if(!empty($author) AND !empty($date)){ if (!empty($author) and !empty($date)) {
$aInfo=str_replace(array("%author%","%date%","%time%"),array(author($author),toDate($date),toTime($date)),rplc("%by%")); $aInfo = str_replace(['%author%', '%date%', '%time%'], [author($author), toDate($date), toTime($date)], rplc('%by%'));
}elseif(!empty($author)){ } elseif (!empty($author)) {
$aInfo=str_replace("%author%",author($author),rplc("%byAuthor%")); $aInfo = str_replace('%author%', author($author), rplc('%byAuthor%'));
}elseif(!empty($date)){ } elseif (!empty($date)) {
$aInfo=str_replace(array("%date%","%time%"),array(toDate($date),toTime($date)),rplc("%byDate%")); $aInfo = str_replace(['%date%', '%time%'], [toDate($date), toTime($date)], rplc('%byDate%'));
}else{ } else {
$aInfo=""; $aInfo = '';
} }
//var_dump(date(rplc("%dateFormat%"),filemtime($realPage))); //var_dump(date(rplc("%dateFormat%"),filemtime($realPage)));
$CMS["%author%"]=$author; $CMS['%author%'] = $author;
$CMS["%ainfo%"]=$aInfo; $CMS['%ainfo%'] = $aInfo;
?> ?>
<?php <?php
ob_start(/*"ob_gzhandler"*/); ob_start(/*"ob_gzhandler"*/);
include("template.html"); include 'template.html';
$buffer=ob_get_clean(); $buffer = ob_get_clean();
echo(rplc(rplc($buffer))); echo rplc(rplc($buffer));
?> ?>

View File

@@ -1,30 +1,31 @@
<?php <?php
header("Content-Type: text/plain; charset=utf-8");
function directoryToArray($directory,$recursive){ header('Content-Type: text/plain; charset=utf-8');
$array_items=array(); function directoryToArray($directory, $recursive) {
if($handle=opendir($directory)){ $array_items = [];
while(false!==($file=readdir($handle))){ if ($handle = opendir($directory)) {
if($file!="."&&$file!=".."){ while (false !== ($file = readdir($handle))) {
if(is_dir($directory."/".$file)){ if ($file != '.' && $file != '..') {
if($recursive){ if (is_dir($directory . '/' . $file)) {
$array_items=array_merge($array_items,directoryToArray($directory. "/".$file,$recursive)); if ($recursive) {
$array_items = array_merge($array_items, directoryToArray($directory . '/' . $file, $recursive));
}
$file = $directory . '/' . $file;
} else {
$file = $directory . '/' . $file;
$array_items[] = preg_replace("/\/\//si", '/', $file);
}
}
}
closedir($handle);
}
return $array_items;
} }
$file=$directory."/".$file; $files = directoryToArray('./pages', true);
}else{ foreach ($files as $file) {
$file=$directory."/".$file; if (substr($file, -3) == '.pg' and (substr($file, 0, 17) != './pages/cs/error/' and substr($file, 0, 17) != './pages/en/error/' and substr($file, 0, 17) != './pages/de/error/')) {
$array_items[]=preg_replace("/\/\//si","/",$file); $list .= substr($file, 0, -3) . "\n";
}
} }
} echo str_replace('./pages', 'http://' . $_SERVER['HTTP_HOST'], $list);
}
closedir($handle);
}
return $array_items;
}
$files=directoryToArray("./pages",true);
foreach($files as $file){
if(substr($file,-3)==".pg" AND (substr($file,0,17)!="./pages/cs/error/" AND substr($file,0,17)!="./pages/en/error/" AND substr($file,0,17)!="./pages/de/error/")){
$list.=substr($file,0,-3)."\n";
}
}
echo(str_replace("./pages","http://".$_SERVER["HTTP_HOST"],$list));
?>