From 5994bce42cfd1c5cd6cfae505aaa93120d766420 Mon Sep 17 00:00:00 2001 From: aftercase <74765798+aftercase@users.noreply.github.com> Date: Sun, 18 Jul 2021 20:56:05 +0100 Subject: [PATCH] Fixed update time Time now displays time updated. --- discover.php | 1 + includes/functions.php | 2 +- theme/bulma/discover.php | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/discover.php b/discover.php index 50a7008..21a0312 100644 --- a/discover.php +++ b/discover.php @@ -26,6 +26,7 @@ function transformPasteRow(array $row) : array { 'title' => $row['title'], 'member' => $row['member'], 'time' => $row['created_at'], + 'friendly_update_time' => friendlyDateDifference(new DateTime($row['updated_at']), new DateTime()), 'friendly_time' => friendlyDateDifference(new DateTime($row['created_at']), new DateTime()), 'tags' => $row['tagsys'] ]; diff --git a/includes/functions.php b/includes/functions.php index 13d67f8..c0fad21 100644 --- a/includes/functions.php +++ b/includes/functions.php @@ -147,7 +147,7 @@ function getUserRecom(PDO $conn, int $user_id) : array { function recentupdate($conn, $count) { $query = $conn->prepare( - "SELECT pastes.id AS id, visible, title, created_at, users.username AS member, tagsys + "SELECT pastes.id AS id, visible, title, created_at, updated_at, users.username AS member, tagsys FROM pastes INNER JOIN users ON users.id = pastes.user_id WHERE visible = '0' ORDER BY updated_at DESC diff --git a/theme/bulma/discover.php b/theme/bulma/discover.php index 3cc8041..c1bcfcf 100644 --- a/theme/bulma/discover.php +++ b/theme/bulma/discover.php @@ -161,7 +161,7 @@