1
0
Fork 0
deeptwisty.com/posts/index.php

52 lines
1.8 KiB
PHP
Raw Normal View History

2023-01-10 04:57:46 +00:00
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="icon" type="image/x-icon" href="../favicon.ico">
<title>deep twisty - posts</title>
<link href="../style.css" rel="stylesheet" type="text/css" media="all">
<link href="../subpage.css" rel="stylesheet" type="text/css" media="all">
<style>
article.post {
padding: 1rem;
max-width: 25rem;
margin: auto;
}
h2.datemarker {
margin-bottom: 0;
font-size: small;
}
.post p {
margin-top: 0.1rem;
}
</style>
</head>
<body>
<main>
<h1 id="header"><span id="headerblue">po</span><span id="headergreen">st</span><span id="headeryellow">s</span></h1>
<p><a class="white-color" style="text-decoration: none; font-size: 1.4em; font-family: var(--hfont);" href="../">home</a><span style="display: inline-block; margin: 0 0.3rem; font-size: 0;"></span><a class="white-color" style="text-decoration: none; font-size: 1.4em; font-family: var(--hfont);" href="https://journal.miso.town/atom?url=https://deeptwisty.com/posts/">feed</a></p><hr>
<div id="posts">
<?php
$infile = fopen("posts.txt", "r") or die("file read error -_-");
$content = fread($infile,filesize("posts.txt"));
fclose($infile);
$post_arr = explode("\n",$content);
$posts_out = "";
foreach($post_arr as $p) {
if(strlen($p) > 3) {
$date = substr($p, 0, strpos($p, " "));
$pcont = substr($p, strpos($p, " ") + 1);
$posts_out = "<article class='post'><h2 class='datemarker'>$date</h2><p>$pcont</p></article>$posts_out";
}
}
echo $posts_out;
?>
</div>
</main>
</body>
</html>