aboutsummaryrefslogtreecommitdiffhomepage
path: root/routes/global_timeline.php
diff options
context:
space:
mode:
Diffstat (limited to 'routes/global_timeline.php')
-rw-r--r--routes/global_timeline.php13
1 files changed, 6 insertions, 7 deletions
diff --git a/routes/global_timeline.php b/routes/global_timeline.php
index 55f64e1..c32419c 100644
--- a/routes/global_timeline.php
+++ b/routes/global_timeline.php
@@ -1,11 +1,10 @@
<?php
-use Digitigrade\Model\Note;
use Digitigrade\Router;
+use Digitigrade\Timeline\GlobalTimeline;
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', []);
+ $notes = (new GlobalTimeline())->getNotes();
?>
<!DOCTYPE html>
<html lang="en">
@@ -16,11 +15,11 @@ Router::getInstance()->mount('/feed/global', function (array $args) {
<body>
<h1>Global timeline</h1>
- <?php foreach ($posts as $p): ?>
+ <?php foreach ($notes as $n): ?>
<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>
+ <b><?= $n->author->displayName ?></b> <small><?= $n->author->uri ?></small><br>
+ <p><?= $n->plainContent ?></p>
+ <small><?= $n->created->format('c') ?></small>
</div>
<?php endforeach; ?>
</body>