diff options
Diffstat (limited to 'routes/global_timeline.php')
| -rw-r--r-- | routes/global_timeline.php | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/routes/global_timeline.php b/routes/global_timeline.php new file mode 100644 index 0000000..55f64e1 --- /dev/null +++ b/routes/global_timeline.php @@ -0,0 +1,30 @@ +<?php + +use Digitigrade\Model\Note; +use Digitigrade\Router; + +Router::getInstance()->mount('/feed/global', function (array $args) { + // this is really rubbish as it doesn't put them in order, doesn't check visibility/indexable, etc + $posts = Note::findAllWhere('deleted = false', []); + ?> + <!DOCTYPE html> + <html lang="en"> + + <head> + <title>digitigrade global timeline</title> + </head> + + <body> + <h1>Global timeline</h1> + <?php foreach ($posts as $p): ?> + <div style="margin: 8px; padding: 8px; border: 1px solid"> + <b><?= $p->author->displayName ?></b> <small><?= $p->author->uri ?></small><br> + <p><?= $p->plainContent ?></p> + <small><?= $p->created->format('c') ?></small> + </div> + <?php endforeach; ?> + </body> + + </html> + <?php +});
\ No newline at end of file |
