Format PHP code

This commit is contained in:
2022-01-13 23:09:36 +01:00
parent c56a9bf56d
commit 9a3656ef28
20 changed files with 1229 additions and 1219 deletions

View File

@@ -1,67 +1,68 @@
<?php
session_start();
$included=true;
$lang=empty($_GET["lang"])?"cs":$_GET["lang"];
$page=htmlspecialchars($_GET["page"]);
$url=$_SERVER["REQUEST_URI"];
$root="/Skirogaining_2010";
$pretitle="1. Skirogaining 2010";
$mainMail="tojnar@gmail.com";
include($lang.".php");
$CMS["%url%"]="http://skirogaining.tojnar.cz".htmlspecialchars($url);
$CMS["%root%"]=$root;
$CMS["%lang%"]=$lang;
$CMS["%unknownAuthor%"]="Jan Tojnar";
$CMS["%headerLinkHref%"]=rplc("%root%/").$lang;
$CMS["%pretitle%"]=$pretitle;
$CMS["%comefrom%"]=$_SERVER["HTTP_REFERER"];
$CMS["%dateFormat%"]="d.m.Y H:i";
function rplc($string){
global $CMS;
return str_replace(array_keys($CMS),$CMS,$string);
$included = true;
$lang = empty($_GET['lang']) ? 'cs' : $_GET['lang'];
$page = htmlspecialchars($_GET['page']);
$url = $_SERVER['REQUEST_URI'];
$root = '/Skirogaining_2010';
$pretitle = '1. Skirogaining 2010';
$mainMail = 'tojnar@gmail.com';
include $lang . '.php';
$CMS['%url%'] = 'http://skirogaining.tojnar.cz' . htmlspecialchars($url);
$CMS['%root%'] = $root;
$CMS['%lang%'] = $lang;
$CMS['%unknownAuthor%'] = 'Jan Tojnar';
$CMS['%headerLinkHref%'] = rplc('%root%/') . $lang;
$CMS['%pretitle%'] = $pretitle;
$CMS['%comefrom%'] = $_SERVER['HTTP_REFERER'];
$CMS['%dateFormat%'] = 'd.m.Y H:i';
function rplc($string) {
global $CMS;
return str_replace(array_keys($CMS), $CMS, $string);
}
include("sboard.php");
include("load.lib.php");
include 'sboard.php';
include 'load.lib.php';
readPage($page);
$CMS["%releasedate%"]=toDate($date);
$CMS["%releasetime%"]=toTime($date);
if(isReleased($date)==false){
$notreleased=true;
}else{
$notreleased=false;
$CMS['%releasedate%'] = toDate($date);
$CMS['%releasetime%'] = toTime($date);
if (isReleased($date) == false) {
$notreleased = true;
} else {
$notreleased = false;
}
if($notreleased==true){
readPage("error/notreleased");
if ($notreleased == true) {
readPage('error/notreleased');
}
$CMS["%title%"]=$title;
$CMS["%titleTag%"]=str_replace(array("%pretitle%","%title%"),array($pretitle,$title),rplc("%longTitle%"));
$CMS["%langPanel%"]=$langPanel;
$CMS["%article%"]=$article;
$CMS["%menu%"]=$menu;
if(!empty($author) AND !empty($date)){
$aInfo=str_replace(array("%author%","%date%","%time%"),array(author($author),toDate($date),toTime($date)),rplc("%by%"));
}elseif(!empty($author)){
$aInfo=str_replace("%author%",author($author),rplc("%byAuthor%"));
}elseif(!empty($date)){
$aInfo=str_replace(array("%date%","%time%"),array(toDate($date),toTime($date)),rplc("%byDate%"));
}else{
$aInfo="";
$CMS['%title%'] = $title;
$CMS['%titleTag%'] = str_replace(['%pretitle%', '%title%'], [$pretitle, $title], rplc('%longTitle%'));
$CMS['%langPanel%'] = $langPanel;
$CMS['%article%'] = $article;
$CMS['%menu%'] = $menu;
if (!empty($author) and !empty($date)) {
$aInfo = str_replace(['%author%', '%date%', '%time%'], [author($author), toDate($date), toTime($date)], rplc('%by%'));
} elseif (!empty($author)) {
$aInfo = str_replace('%author%', author($author), rplc('%byAuthor%'));
} elseif (!empty($date)) {
$aInfo = str_replace(['%date%', '%time%'], [toDate($date), toTime($date)], rplc('%byDate%'));
} else {
$aInfo = '';
}
//var_dump(date(rplc("%dateFormat%"),filemtime($realPage)));
$CMS["%author%"]=$author;
$CMS["%ainfo%"]=$aInfo;
if($eu==true){
$CMS["%eu%"]="<table class=\"table-no-border\" id=\"ziel3\">
<tr><td colspan=\"2\"><h6>%eustring%</h6></td></tr>
<tr><td><img src=\"/images/EU-Logo_rgb.jpg\" height=\"45\" width=\"361\"></td><td><img src=\"/images/ziel-small.jpg\" class=\"margin-05\"></td></tr>
</table>";
}else{
$CMS["%eu%"]="";
$CMS['%author%'] = $author;
$CMS['%ainfo%'] = $aInfo;
if ($eu == true) {
$CMS['%eu%'] = '<table class="table-no-border" id="ziel3">
<tr><td colspan="2"><h6>%eustring%</h6></td></tr>
<tr><td><img src="/images/EU-Logo_rgb.jpg" height="45" width="361"></td><td><img src="/images/ziel-small.jpg" class="margin-05"></td></tr>
</table>';
} else {
$CMS['%eu%'] = '';
}
?>
<?php
ob_start(/*"ob_gzhandler"*/);
include("template.html");
$buffer=ob_get_clean();
echo(rplc(rplc($buffer)));
include 'template.html';
$buffer = ob_get_clean();
echo rplc(rplc($buffer));
?>