Simple latest comment list
[anoweco.git] / www / latest.php
diff --git a/www/latest.php b/www/latest.php
new file mode 100644 (file)
index 0000000..12105d9
--- /dev/null
@@ -0,0 +1,17 @@
+<?php
+namespace anoweco;
+require 'www-header.php';
+
+$storage = new Storage();
+$comments = $storage->listLatest();
+
+foreach ($comments as $comment) {
+    $comment->url = Urls::comment($comment->comment_id);
+    $comment->domain = parse_url($comment->comment_of_url, PHP_URL_HOST);
+}
+
+$vars = [
+    'comments' => $comments,
+];
+render('latest', $vars);
+?>