This repository has been archived on 2021-12-22. You can view files and clone it, but cannot push or open issues or pull requests.
blog-legacy/index.php

45 lines
1.3 KiB
PHP

<?php
include('config/main.php');
if(isset($_GET['lang'])){
if(!empty($_GET['lang'])){
if(file_exists('assets/lang/'.$_GET['lang'].'.php')){
include('assets/lang/'.$_GET['lang'].'.php');
}
}
}
if(isset($_GET['page'])){
if(!empty($_GET['page'])){
if(file_exists('views/'.$_GET['page'].'.php')){
include('views/'.$_GET['page'].'.php');
}else{
$title = "Page not found";
$content = "Sorry, the page you asked for doesn't exist";
}
}else{
$title = "Page empty";
$content = "Sorry, we are not able to show you a content because the page to show is empty";
header("location:?page=index");
}
}else{
$title = "Page not set";
$content = "Sorry, we are not able to show you a content because the page to show is not defined";
header("location:?page=index");
}
?>
<!DOCTYPE html>
<html>
<head>
<title><?php echo $config["title"]; ?></title>
<meta charset="utf-8" />
</head>
<body>
<h1><?php echo $config["title"]; ?></h1>
<p><?php echo $config["description"] ?></p>
<a href="?page=index"><?php echo isset($lang["homeMenu"])?$lang["homeMenu"]:"Return to home"; ?></a> - <a href="?page=write"><?php echo isset($lang["writeArticle"])?$lang["writeArticle"]:"Write an article"; ?></a>
<hr />
<?php echo isset($content)?$content:'Content not found'; ?>
</body>
</html>