Fix compatibility with latest PHP
This commit is contained in:
103
maincg.php
103
maincg.php
@@ -1,3 +1,7 @@
|
||||
<?php
|
||||
$lang = $_GET["lang"] ?? "cs";
|
||||
$page = $_GET["page"] ?? "";
|
||||
?>
|
||||
<!doctype html public "-//W3C//DTD HTML 4.01//EN">
|
||||
<html>
|
||||
<head>
|
||||
@@ -34,7 +38,7 @@
|
||||
</script>
|
||||
<?php
|
||||
echo"<script type=\"text/javascript\">";
|
||||
if($_REQUEST[lang]=="en"):
|
||||
if($lang=="en"):
|
||||
?>
|
||||
hs.lang = {
|
||||
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.'
|
||||
};
|
||||
<?php
|
||||
elseif($_REQUEST[lang]=="de"):
|
||||
elseif($lang=="de"):
|
||||
?>
|
||||
hs.lang = {
|
||||
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>
|
||||
<?php
|
||||
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/$_REQUEST[page]/$_REQUEST[page]-de.php")){
|
||||
if(file_exists("pages/" . $page . "-de.php") || file_exists("pages/" . $page . "/" . $page . "-de.php")){
|
||||
if(file_exists("pages/" . $page . "/" . $page . "-de.php")){
|
||||
$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{
|
||||
$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"";
|
||||
}else{
|
||||
echo $icona;
|
||||
}
|
||||
}
|
||||
if(file_exists("pages/$_REQUEST[page]-en.php") OR file_exists("pages/$_REQUEST[page]/$_REQUEST[page]-en.php")){
|
||||
if(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/" . $page . "/" . $page . "-en.php")){
|
||||
$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{
|
||||
$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"";
|
||||
}else{
|
||||
echo $icona;
|
||||
}
|
||||
}elseif(!isset($_REQUEST[page]) AND file_exists("pages/cyklogaining-en.php")){
|
||||
}elseif(!isset($page) && file_exists("pages/cyklogaining-en.php")){
|
||||
$lngc="en";
|
||||
$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"";
|
||||
}else{
|
||||
echo $icona;
|
||||
}
|
||||
}
|
||||
if(file_exists("pages/$_REQUEST[page].php") OR file_exists("pages/$_REQUEST[page]/$_REQUEST[page].php")){
|
||||
if(file_exists("pages/$_REQUEST[page]/$_REQUEST[page].php")){
|
||||
if(file_exists("pages/" . $page . ".php") || file_exists("pages/" . $page . "/" . $page . ".php")){
|
||||
if(file_exists("pages/" . $page . "/" . $page . ".php")){
|
||||
$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{
|
||||
$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"";
|
||||
}else{
|
||||
echo $icona;
|
||||
}
|
||||
}
|
||||
if($_REQUEST[lang]=="en" AND empty($_REQUEST[page])){
|
||||
if($lang=="en" && empty($page)){
|
||||
$lngc="";
|
||||
$icona="<a href=\"maincg.php?page=cyklogaining\"><img src=\"/images/".$lngc."f.png\" alt=\"\"></a>";
|
||||
echo $icona;
|
||||
@@ -186,9 +190,9 @@ echo"</span>";
|
||||
</div>
|
||||
<div class="top-menu">
|
||||
<?php
|
||||
if(empty($_REQUEST[lang]) OR $_REQUEST[lang]=="cs"){
|
||||
if(empty($lang) || $lang=="cs"){
|
||||
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");
|
||||
}
|
||||
?>
|
||||
@@ -196,14 +200,14 @@ include("./pages/cg_topmenu-en.php");
|
||||
<div class="sidebar"><div class="sidebar-content">
|
||||
<ul>
|
||||
<?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");
|
||||
}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");
|
||||
}elseif(ereg("mcr_2009",$_REQUEST[page])){
|
||||
}elseif(str_contains($page, "mcr_2009")){
|
||||
include("./pages/mcr_2009/menumcr_2009.php");
|
||||
}else{
|
||||
if(empty($_REQUEST[lang]) OR $_REQUEST[lang]=="cs"){
|
||||
if(empty($lang) || $lang=="cs"){
|
||||
include("./pages/menucg.php");
|
||||
}else{
|
||||
include("./pages/menucg-en.php");
|
||||
@@ -213,36 +217,31 @@ include("./pages/menucg-en.php");
|
||||
</ul><br><br><br>
|
||||
</div></div><div class="main"><div class="main-content">
|
||||
<?php
|
||||
$escaped_page=str_replace(array(")","(","\\","\"","\'",";","{","}","$","[","]","<",">"),"",$_REQUEST[page]);
|
||||
if($_REQUEST[page]){
|
||||
if($_GET[lang]){
|
||||
$jazycek="-".$_GET[lang];
|
||||
}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"){
|
||||
$escaped_page=str_replace(array(")","(","\\","\"","\'",";","{","}","$","[","]","<",">"),"",$page);
|
||||
$jazycek= $lang === "cs" ? "" : "-".$lang;
|
||||
if($page === ""){
|
||||
if($lang=="cs"){
|
||||
include"./pages/cyklogaining.php";
|
||||
}else{
|
||||
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 class="footer">
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
<a href="http://www.tojnar.cz/krk/mainkrk.php" target="_blank">Web KRK</a>
|
||||
¦<a href="http://www.tojnar.cz/krk/mainkrk.php?page=mcr_2009/mcr_2009" target="_blank">MČR v rogainingu</a> ¦<a href="/printcg.php?page=<?php echo"$_REQUEST[page]"; ?>" target="_blank">Verze pro tisk</a>
|
||||
¦<a href="http://www.tojnar.cz/krk/mainkrk.php?page=mcr_2009/mcr_2009" target="_blank">MČR v rogainingu</a> ¦<a href="/printcg.php?page=<?php echo$page; ?>" target="_blank">Verze pro tisk</a>
|
||||
|
||||
49
printcg.php
49
printcg.php
@@ -1,3 +1,7 @@
|
||||
<?php
|
||||
$lang = $_GET["lang"] ?? "cs";
|
||||
$page = $_GET["page"] ?? "";
|
||||
?>
|
||||
<!doctype html public "-//W3C//DTD HTML 4.01//EN">
|
||||
<html>
|
||||
<head>
|
||||
@@ -9,33 +13,32 @@
|
||||
<body><!-- onload="window.print()"-->
|
||||
<div class="main">
|
||||
<?php
|
||||
$escaped_page=str_replace(array(")","(","\\","\"","\'",";","{","}","$","[","]","<",">"),"",$_REQUEST[page]);
|
||||
if($_REQUEST[page]){
|
||||
if($_REQUEST[page]=="cestopisy"){
|
||||
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"){
|
||||
$escaped_page=str_replace(array(")","(","\\","\"","\'",";","{","}","$","[","]","<",">"),"",$page);
|
||||
if($page === ""){
|
||||
if($lang=="cs"){
|
||||
include"./pages/cyklogaining.php";
|
||||
}else{
|
||||
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>
|
||||
</body>
|
||||
|
||||
Reference in New Issue
Block a user