Fix compatibility with latest PHP

This commit is contained in:
2022-01-13 01:31:30 +01:00
parent 28ab33b38f
commit 3b60b1cbed
3 changed files with 78 additions and 76 deletions

View File

@@ -1,3 +1,7 @@
<?php
$lang = $_GET["lang"] ?? "cs";
$page = $_GET["page"] ?? "";
?>
<!doctype html public "-//W3C//DTD HTML 4.01//EN"> <!doctype html public "-//W3C//DTD HTML 4.01//EN">
<html> <html>
<head> <head>
@@ -34,7 +38,7 @@
</script> </script>
<?php <?php
echo"<script type=\"text/javascript\">"; echo"<script type=\"text/javascript\">";
if($_REQUEST[lang]=="en"): if($lang=="en"):
?> ?>
hs.lang = { hs.lang = {
cssDirection: 'ltr', cssDirection: 'ltr',
@@ -62,7 +66,7 @@ hs.lang = {
restoreTitle : 'Click to close image, click and drag to move. Use arrow keys for next and previous.' restoreTitle : 'Click to close image, click and drag to move. Use arrow keys for next and previous.'
}; };
<?php <?php
elseif($_REQUEST[lang]=="de"): elseif($lang=="de"):
?> ?>
hs.lang = { hs.lang = {
loadingText : 'Lade...', loadingText : 'Lade...',
@@ -124,59 +128,59 @@ echo"</script>";
<div class="header"><span class="title"><?php include"./pages/title_cg.php"; ?></span><br><span class="slogan"><?php include"./pages/slogan.php"; ?></span> <div class="header"><span class="title"><?php include"./pages/title_cg.php"; ?></span><br><span class="slogan"><?php include"./pages/slogan.php"; ?></span>
<?php <?php
echo"<span class=\"floatright\">"; echo"<span class=\"floatright\">";
if(file_exists("pages/$_REQUEST[page]-de.php") OR file_exists("pages/$_REQUEST[page]/$_REQUEST[page]-de.php")){ if(file_exists("pages/" . $page . "-de.php") || file_exists("pages/" . $page . "/" . $page . "-de.php")){
if(file_exists("pages/$_REQUEST[page]/$_REQUEST[page]-de.php")){ if(file_exists("pages/" . $page . "/" . $page . "-de.php")){
$lngc="de"; $lngc="de";
$icona="<a href=\"maincg.php?page=$_REQUEST[page]/$_REQUEST[page]&lang=$lngc\"><img src=\"/images/".$lngc."f.png\" alt=\"\"></a>"; $icona="<a href=\"maincg.php?page=" . $page . "/" . $page . "&lang=$lngc\"><img src=\"/images/".$lngc."f.png\" alt=\"\"></a>";
}else{ }else{
$lngc="de"; $lngc="de";
$icona="<a href=\"maincg.php?page=$_REQUEST[page]&lang=$lngc\"><img src=\"/images/".$lngc."f.png\" alt=\"\"></a>"; $icona="<a href=\"maincg.php?page=" . $page . "&lang=$lngc\"><img src=\"/images/".$lngc."f.png\" alt=\"\"></a>";
} }
if($_REQUEST[lang]=="de"){ if($lang=="de"){
echo""; echo"";
}else{ }else{
echo $icona; echo $icona;
} }
} }
if(file_exists("pages/$_REQUEST[page]-en.php") OR file_exists("pages/$_REQUEST[page]/$_REQUEST[page]-en.php")){ if(file_exists("pages/" . $page . "-en.php") || file_exists("pages/" . $page . "/" . $page . "-en.php")){
if(file_exists("pages/$_REQUEST[page]/$_REQUEST[page]-en.php")){ if(file_exists("pages/" . $page . "/" . $page . "-en.php")){
$lngc="en"; $lngc="en";
$icona="<a href=\"maincg.php?page=$_REQUEST[page]/$_REQUEST[page]&lang=$lngc\"><img src=\"/images/".$lngc."f.png\" alt=\"\"></a>"; $icona="<a href=\"maincg.php?page=" . $page . "/" . $page . "&lang=$lngc\"><img src=\"/images/".$lngc."f.png\" alt=\"\"></a>";
}else{ }else{
$lngc="en"; $lngc="en";
$icona="<a href=\"maincg.php?page=$_REQUEST[page]&lang=$lngc\"><img src=\"/images/".$lngc."f.png\" alt=\"\"></a>"; $icona="<a href=\"maincg.php?page=" . $page . "&lang=$lngc\"><img src=\"/images/".$lngc."f.png\" alt=\"\"></a>";
} }
if($_REQUEST[lang]=="en"){ if($lang=="en"){
echo""; echo"";
}else{ }else{
echo $icona; echo $icona;
} }
}elseif(!isset($_REQUEST[page]) AND file_exists("pages/cyklogaining-en.php")){ }elseif(!isset($page) && file_exists("pages/cyklogaining-en.php")){
$lngc="en"; $lngc="en";
$icona="<a href=\"maincg.php?page=cyklogaining&lang=$lngc\"><img src=\"/images/".$lngc."f.png\" alt=\"\"></a>"; $icona="<a href=\"maincg.php?page=cyklogaining&lang=$lngc\"><img src=\"/images/".$lngc."f.png\" alt=\"\"></a>";
if($_REQUEST[lang]=="en"){ if($lang=="en"){
echo""; echo"";
}else{ }else{
echo $icona; echo $icona;
} }
} }
if(file_exists("pages/$_REQUEST[page].php") OR file_exists("pages/$_REQUEST[page]/$_REQUEST[page].php")){ if(file_exists("pages/" . $page . ".php") || file_exists("pages/" . $page . "/" . $page . ".php")){
if(file_exists("pages/$_REQUEST[page]/$_REQUEST[page].php")){ if(file_exists("pages/" . $page . "/" . $page . ".php")){
$lngc=""; $lngc="";
$icona="<a href=\"maincg.php?page=$_REQUEST[page]/$_REQUEST[page]$lngc\"><img src=\"/images/".$lngc."f.png\" alt=\"\"></a>"; $icona="<a href=\"maincg.php?page=" . $page . "/" . $page . "$lngc\"><img src=\"/images/".$lngc."f.png\" alt=\"\"></a>";
}else{ }else{
$lngc=""; $lngc="";
$icona="<a href=\"maincg.php?page=$_REQUEST[page]$lngc\"><img src=\"/images/".$lngc."f.png\" alt=\"\"></a>"; $icona="<a href=\"maincg.php?page=" . $page . "$lngc\"><img src=\"/images/".$lngc."f.png\" alt=\"\"></a>";
} }
if($_REQUEST[lang]=="cs" OR empty($_REQUEST[lang])){ if($lang=="cs" || empty($lang)){
echo""; echo"";
}else{ }else{
echo $icona; echo $icona;
} }
} }
if($_REQUEST[lang]=="en" AND empty($_REQUEST[page])){ if($lang=="en" && empty($page)){
$lngc=""; $lngc="";
$icona="<a href=\"maincg.php?page=cyklogaining\"><img src=\"/images/".$lngc."f.png\" alt=\"\"></a>"; $icona="<a href=\"maincg.php?page=cyklogaining\"><img src=\"/images/".$lngc."f.png\" alt=\"\"></a>";
echo $icona; echo $icona;
@@ -186,9 +190,9 @@ echo"</span>";
</div> </div>
<div class="top-menu"> <div class="top-menu">
<?php <?php
if(empty($_REQUEST[lang]) OR $_REQUEST[lang]=="cs"){ if(empty($lang) || $lang=="cs"){
include("./pages/cg_topmenu.php"); include("./pages/cg_topmenu.php");
}elseif($_REQUEST[lang]=="en" AND file_exists("./pages/cg_topmenu-en.php")){ }elseif($lang=="en" && file_exists("./pages/cg_topmenu-en.php")){
include("./pages/cg_topmenu-en.php"); include("./pages/cg_topmenu-en.php");
} }
?> ?>
@@ -196,14 +200,14 @@ include("./pages/cg_topmenu-en.php");
<div class="sidebar"><div class="sidebar-content"> <div class="sidebar"><div class="sidebar-content">
<ul> <ul>
<?php <?php
if(ereg("mcr_2009",$_REQUEST[page]) AND $_REQUEST[lang]=="en"){ if(str_contains($page, "mcr_2009") && $lang=="en"){
include("./pages/mcr_2009/menumcr_2009-en.php"); include("./pages/mcr_2009/menumcr_2009-en.php");
}elseif(ereg("mcr_2009",$_REQUEST[page]) AND $_REQUEST[lang]=="de"){ }elseif(str_contains($page, "mcr_2009") && $lang=="de"){
include("./pages/mcr_2009/menumcr_2009-de.php"); include("./pages/mcr_2009/menumcr_2009-de.php");
}elseif(ereg("mcr_2009",$_REQUEST[page])){ }elseif(str_contains($page, "mcr_2009")){
include("./pages/mcr_2009/menumcr_2009.php"); include("./pages/mcr_2009/menumcr_2009.php");
}else{ }else{
if(empty($_REQUEST[lang]) OR $_REQUEST[lang]=="cs"){ if(empty($lang) || $lang=="cs"){
include("./pages/menucg.php"); include("./pages/menucg.php");
}else{ }else{
include("./pages/menucg-en.php"); include("./pages/menucg-en.php");
@@ -213,36 +217,31 @@ include("./pages/menucg-en.php");
</ul><br><br><br> </ul><br><br><br>
</div></div><div class="main"><div class="main-content"> </div></div><div class="main"><div class="main-content">
<?php <?php
$escaped_page=str_replace(array(")","(","\\","\"","\'",";","{","}","$","[","]","<",">"),"",$_REQUEST[page]); $escaped_page=str_replace(array(")","(","\\","\"","\'",";","{","}","$","[","]","<",">"),"",$page);
if($_REQUEST[page]){ $jazycek= $lang === "cs" ? "" : "-".$lang;
if($_GET[lang]){ if($page === ""){
$jazycek="-".$_GET[lang]; if($lang=="cs"){
}else{
$jazycek="";
}
if($_REQUEST[page]=="mcr_2009"){
include("./pages/mcr_2009/mcr_2009$jazycek.php");
}elseif($_REQUEST[page]=="clanky"){
include"./pages/clanky/clanky$jazycek.php";
}elseif($_REQUEST[page]=="akce_ob"){
include"./pages/akce_ob/akce_ob$jazycek.php";
}elseif($_REQUEST[page]=="akce_litvinov"){
include"./pages/akce_litvinov/akce_litvinov$jazycek.php";
}elseif($_REQUEST[page]=="ski_krusnohori"){
include"./pages/ski_krusnohori/ski_krusnohori$jazycek.php";
}elseif(empty($_REQUEST[lang]) AND file_exists("pages/$escaped_page.php")){
include"./pages/$escaped_page.php";
}elseif(file_exists("pages/$escaped_page-$_REQUEST[lang].php")){
include"./pages/$escaped_page-$_REQUEST[lang].php";
}else{
include"/pages/404.php";
}}else{
if(empty($_GET["lang"]) OR $_GET["lang"]=="cs"){
include"./pages/cyklogaining.php"; include"./pages/cyklogaining.php";
}else{ }else{
include"./pages/cyklogaining-en.php"; include"./pages/cyklogaining-en.php";
} }
} }elseif($page=="mcr_2009"){
include("./pages/mcr_2009/mcr_2009$jazycek.php");
}elseif($page=="clanky"){
include"./pages/clanky/clanky$jazycek.php";
}elseif($page=="akce_ob"){
include"./pages/akce_ob/akce_ob$jazycek.php";
}elseif($page=="akce_litvinov"){
include"./pages/akce_litvinov/akce_litvinov$jazycek.php";
}elseif($page=="ski_krusnohori"){
include"./pages/ski_krusnohori/ski_krusnohori$jazycek.php";
}elseif($lang === "cs" && file_exists("pages/$escaped_page.php")){
include"./pages/$escaped_page.php";
}elseif(file_exists("pages/$escaped_page-" . $lang . ".php")){
include"./pages/$escaped_page-" . $lang . ".php";
}else{
include"/pages/404.php";
}
?> ?>
</div></div> </div></div>
<div class="footer"> <div class="footer">

View File

@@ -1,2 +1,2 @@
<a href="http://www.tojnar.cz/krk/mainkrk.php" target="_blank">Web&nbsp;KRK</a> <a href="http://www.tojnar.cz/krk/mainkrk.php" target="_blank">Web&nbsp;KRK</a>
&brvbar;<a href="http://www.tojnar.cz/krk/mainkrk.php?page=mcr_2009/mcr_2009" target="_blank">MČR&nbsp;v&nbsp;rogainingu</a> &brvbar;<a href="/printcg.php?page=<?php echo"$_REQUEST[page]"; ?>" target="_blank">Verze&nbsp;pro&nbsp;tisk</a> &brvbar;<a href="http://www.tojnar.cz/krk/mainkrk.php?page=mcr_2009/mcr_2009" target="_blank">MČR&nbsp;v&nbsp;rogainingu</a> &brvbar;<a href="/printcg.php?page=<?php echo$page; ?>" target="_blank">Verze&nbsp;pro&nbsp;tisk</a>

View File

@@ -1,3 +1,7 @@
<?php
$lang = $_GET["lang"] ?? "cs";
$page = $_GET["page"] ?? "";
?>
<!doctype html public "-//W3C//DTD HTML 4.01//EN"> <!doctype html public "-//W3C//DTD HTML 4.01//EN">
<html> <html>
<head> <head>
@@ -9,33 +13,32 @@
<body><!-- onload="window.print()"--> <body><!-- onload="window.print()"-->
<div class="main"> <div class="main">
<?php <?php
$escaped_page=str_replace(array(")","(","\\","\"","\'",";","{","}","$","[","]","<",">"),"",$_REQUEST[page]); $escaped_page=str_replace(array(")","(","\\","\"","\'",";","{","}","$","[","]","<",">"),"",$page);
if($_REQUEST[page]){ if($page === ""){
if($_REQUEST[page]=="cestopisy"){ if($lang=="cs"){
include"./pages/cestopisy/cestopisy.php";
}else if($_REQUEST[page]=="clanky"){
include"./pages/clanky/clanky.php";
}else if($_REQUEST[page]=="akce_ob"){
include"./pages/akce_ob/akce_ob.php";
}else if($_REQUEST[page]=="akce_litvinov"){
include"./pages/akce_litvinov/akce_litvinov.php";
}else if($_REQUEST[page]=="ski_krusnohori"){
include"./pages/ski_krusnohori/ski_krusnohori.php";
}else if($_REQUEST[page]=="zakonceni_2008"){
include"./pages/zakonceni_2008/zakonceni_2008.php";
}elseif(empty($_REQUEST[lang]) AND file_exists("pages/$escaped_page.php")){
include"./pages/$escaped_page.php";
}elseif(file_exists("pages/$escaped_page-$_REQUEST[lang].php")){
include"./pages/$escaped_page-$_REQUEST[lang].php";
}else{
include"./pages/404.php";
}}else{
if(empty($_GET["lang"]) OR $_GET["lang"]=="cs"){
include"./pages/cyklogaining.php"; include"./pages/cyklogaining.php";
}else{ }else{
include"./pages/cyklogaining-en.php"; include"./pages/cyklogaining-en.php";
} }
} }elseif($page=="cestopisy"){
include"./pages/cestopisy/cestopisy.php";
}else if($page=="clanky"){
include"./pages/clanky/clanky.php";
}else if($page=="akce_ob"){
include"./pages/akce_ob/akce_ob.php";
}else if($page=="akce_litvinov"){
include"./pages/akce_litvinov/akce_litvinov.php";
}else if($page=="ski_krusnohori"){
include"./pages/ski_krusnohori/ski_krusnohori.php";
}else if($page=="zakonceni_2008"){
include"./pages/zakonceni_2008/zakonceni_2008.php";
}elseif($lang == "cs" && file_exists("pages/$escaped_page.php")){
include"./pages/$escaped_page.php";
}elseif(file_exists("pages/$escaped_page-" . $lang . ".php")){
include"./pages/$escaped_page-" . $lang . ".php";
}else{
include"./pages/404.php";
}
?> ?>
</div> </div>
</body> </body>