From 24c6637b3dcdc7021873928c0a84e6586f180d85 Mon Sep 17 00:00:00 2001 From: towards-a-new-leftypol Date: Sun, 31 Mar 2024 21:19:12 +0000 Subject: [PATCH] API - threads.json last_modified is now really the timestamp of the last post, put bump time in a new field 'bump' --- inc/api.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/inc/api.php b/inc/api.php index 0a4dca76..15123677 100644 --- a/inc/api.php +++ b/inc/api.php @@ -45,7 +45,7 @@ class Api { $this->threadsPageFields = array( 'id' => 'no', - 'bump' => 'last_modified', + 'bump' => 'bump', 'board' => 'board', ); @@ -197,6 +197,7 @@ class Api { $ips[] = $p->ip; } $apiPosts['posts'][0]['unique_ips'] = count(array_unique($ips)); + $apiPosts['posts'][0]['last_modified'] = (empty($thread->posts) ? $thread : end($thread->posts))->time; return $apiPosts; }