Actualizar 'index.php'

This commit is contained in:
Lucas 2021-04-09 17:22:04 +00:00
parent f1a2289474
commit d091e6cdd1
1 changed files with 5 additions and 4 deletions

View File

@ -1,19 +1,20 @@
<?php include "blog_config.php";
if($custom_css!=False){if(file_exists($custom_css)){$custom_css="<link rel='stylesheet' href='$custom_css'>";}else{$custom_css="";}}else{$custom_css="";}
$style="body{text-align:center;font-family:monospace;}p{font-size:large;}a#logo{color:black;text-decoration:none;}#article{text-align:left;margin:1px 30%;background:grey;font-size:large;}footer{margin:1em 0 0 0;}";
$footer="<footer>pwd by <a href='https://tildegit.org/lucas/logs'>~weblogs</a></footer></body></html>";
$style="body{text-align:center;font-family:monospace;}p{font-size:large;}a#logo{color:black;text-decoration:none;}.notlogo{margin:5px 0 0 0;}#article{text-align:left;margin:1px 30%;background:grey;font-size:large;}footer{margin:1em 0 0 0;}";
$footer="</div><footer>pwd by <a href='https://tildegit.org/lucas/logs'>~weblogs</a></footer></body></html>";
if(isset($_GET["p"])){
function notfound($errno, $errstr){die("Error!\nPost not found");}
set_error_handler("notfound");
header("Content-type: text/html");
$post=$_GET["p"]-1;
echo "<!DOCTYPE html><html><head><!--~weblogs v1--><title>".$posts[$post][1]." | $title</title><style>$style</style>$custom_css</head><body><a id='logo' href='?'><h1>$title</h1></a>";
echo "<!DOCTYPE html><html><head><!--~weblogs v1--><title>".$posts[$post][1]." | $title</title><style>$style</style>$custom_css</head><body><a id='logo' href='?'><h1>$title</h1></a><div class='notlogo'>";
if(strpos($posts[$post][1],"\n")){$html_log=str_replace("\n","<br>",$posts[$post][2]);}else{$html_log=$posts[$post][1];}
echo "<h1>".$posts[$post][1]."</h1>".$posts[$post][0]."<br><br><div id='article'>$html_log</div>";
echo $footer;
}else{
header("Content-type: text/html");
echo "<!DOCTYPE html><html><head><title>$title</title><style>$style</style>$custom_css</head><body><a id='logo' href='?'><h1>$title</h1></a>";
if($website!=False){$website="<p><a href='$website'>Website</a></p>";}else{$website="";}
echo "<!DOCTYPE html><html><head><title>$title</title><style>$style</style>$custom_css</head><body><a id='logo' href='?'><h1>$title</h1></a>$website<hr><div class='notlogo'>";
$a=count($posts)-1;$ao=0;$next=$a+1;
while($ao < count($posts)){
echo "<p><b><a href='?p=$next'>".$posts[$a][1]."</a></b> ".$posts[$a][0]."</p>";