aboutsummaryrefslogtreecommitdiff
path: root/viewpost.php
blob: e4c6cabde5d88ad22b69b5294aa91fada645f6cf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
<?php
	if (!isset($_GET['post'])) {
		header("location: $blogRoot");
		exit(0);
	}

	require("top.php");

	$file = $_GET['post'];
	echo "<div>\n";
	echo "<a class=\"title\" href=\"{$blogRoot}post/" . urlencode($file) . "\">$file <span id=\"perma\">[Permalink]</span></a>\n";

	$stat = stat("{$blogPosts}$file");
	$date = date('d-m-Y H:i T', $stat['mtime']);
	echo "<span class=\"date\">$date</span>\n";
	echo "<br><br>\n";

	$post = file_get_contents("{$blogPosts}$file");
	$post = preg_replace('/\n/', "<br>\n", $post);
	echo $post;
	echo "</div>\n</a>\n\n";
?>

</body>

</html>