aboutsummaryrefslogtreecommitdiff
path: root/txt/index.php
blob: 8c6c4453cb79750c2854ef9b3cd346ccb0f55fff (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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<!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>/log/txt</title>
    <link href="../style.css" rel="stylesheet" type="text/css" media="all">
    <style>
    </style>
  </head>
 <body>
  <nav><a href="../"><<<</a></nav>
  <p>$ pwd</p>
  <h1 class="title">/log/txt</h1>
  <p>$ cat sys.log</p>
  <section class="dir">
    <?php
      $infile = fopen("sys.log", "r") or die("file read error -_-");
      $content = fread($infile,filesize("sys.log"));
      fclose($infile);
      $post_arr = explode("\n",$content);
      $posts_out = "";
      date_default_timezone_set("Etc/GMT-1");
      foreach($post_arr as $p) {
        if(strlen($p) > 3) {
          $date = substr($p, 0, strpos($p, " "));
          $sdate = date(DateTime::ATOM, $date);
          $hdate = date("Y-m-d@B", $date);
          $pcont = substr($p, strpos($p, " ") + 1);
          $posts_out = "<article><time datetime='$sdate'>$hdate</time> >> $pcont</article>$posts_out";
        }
      }
      echo $posts_out;
    ?>
  </section>
  <p>$</p>
  </body>

</html>