-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathblog.php
More file actions
24 lines (23 loc) · 779 Bytes
/
blog.php
File metadata and controls
24 lines (23 loc) · 779 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
<?php
ob_start();
$files = scandir("./blog");
$licha = true;
foreach($files as $soubor) {
if ($soubor == "." || $soubor == "..") {
continue;
}
$barva = $licha ? "#FDF5E6" : "#FFFFFF"; // nebo
echo "<div style=\"background-color:$barva\">";
$content = str_replace("\n", "<BR>", file_get_contents("./blog/".$soubor));
echo $content;
$datum = explode(".", $soubor);
echo "<p style=\"text-align:right\">".date("d.m.Y", strtotime($datum[0]))."</p>";
echo "<hr></div>";
$licha = !$licha;
}
$contents = ob_get_contents();
ob_end_clean();
header("Content-Description: File Transfer");
header("Content-Type: application/force-download");
header("Content-Disposition: attachment; filename=\"blog.html.gz\"");
echo gzencode($contents);