From ce93b224107a65b43253c36812b636321eb55a78 Mon Sep 17 00:00:00 2001
From: stevendegroote
Date: Tue, 17 Sep 2019 23:01:59 +0200
Subject: [PATCH 1/2] [ticket/16159] Wrap post times in html time tag
PHPBB3-16159
---
phpBB/includes/functions_display.php | 4 +++-
phpBB/search.php | 3 +++
phpBB/styles/prosilver/template/forumlist_body.html | 2 +-
phpBB/styles/prosilver/template/search_results.html | 6 +++---
phpBB/styles/prosilver/template/viewforum_body.html | 6 +++---
phpBB/styles/prosilver/template/viewtopic_body.html | 2 +-
phpBB/viewforum.php | 3 +++
phpBB/viewtopic.php | 1 +
8 files changed, 18 insertions(+), 9 deletions(-)
diff --git a/phpBB/includes/functions_display.php b/phpBB/includes/functions_display.php
index 32bee14eef..e5d6d683fe 100644
--- a/phpBB/includes/functions_display.php
+++ b/phpBB/includes/functions_display.php
@@ -547,11 +547,12 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod
$last_post_subject = $last_post_subject_truncated = '';
}
$last_post_time = $user->format_date($row['forum_last_post_time']);
+ $last_post_time_rfc3339 = gmdate("Y-m-d H:i:sP", $row['forum_last_post_time']);
$last_post_url = append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $row['forum_id_last_post'] . '&p=' . $row['forum_last_post_id']) . '#p' . $row['forum_last_post_id'];
}
else
{
- $last_post_subject = $last_post_time = $last_post_url = $last_post_subject_truncated = '';
+ $last_post_subject = $last_post_time = $last_post_time_rfc3339 = $last_post_url = $last_post_subject_truncated = '';
}
// Output moderator listing ... if applicable
@@ -622,6 +623,7 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod
'LAST_POST_SUBJECT' => $last_post_subject,
'LAST_POST_SUBJECT_TRUNCATED' => $last_post_subject_truncated,
'LAST_POST_TIME' => $last_post_time,
+ 'LAST_POST_TIME_RFC3339'=> $last_post_time_rfc3339,
'LAST_POSTER' => get_username_string('username', $row['forum_last_poster_id'], $row['forum_last_poster_name'], $row['forum_last_poster_colour']),
'LAST_POSTER_COLOUR' => get_username_string('colour', $row['forum_last_poster_id'], $row['forum_last_poster_name'], $row['forum_last_poster_colour']),
'LAST_POSTER_FULL' => get_username_string('full', $row['forum_last_poster_id'], $row['forum_last_poster_name'], $row['forum_last_poster_colour']),
diff --git a/phpBB/search.php b/phpBB/search.php
index 0d9b2bbfe8..f3988d7d04 100644
--- a/phpBB/search.php
+++ b/phpBB/search.php
@@ -1073,9 +1073,12 @@ if ($keywords || $author || $author_id || $search_id || $submit)
'TOPIC_AUTHOR_COLOUR' => get_username_string('colour', $row['topic_poster'], $row['topic_first_poster_name'], $row['topic_first_poster_colour']),
'TOPIC_AUTHOR_FULL' => get_username_string('full', $row['topic_poster'], $row['topic_first_poster_name'], $row['topic_first_poster_colour']),
'FIRST_POST_TIME' => $user->format_date($row['topic_time']),
+ 'FIRST_POST_TIME_RFC3339' => gmdate("Y-m-d H:i:sP", $row['topic_time']),
'LAST_POST_SUBJECT' => $row['topic_last_post_subject'],
'LAST_POST_TIME' => $user->format_date($row['topic_last_post_time']),
+ 'LAST_POST_TIME_RFC3339' => gmdate("Y-m-d H:i:sP", $row['topic_last_post_time']),
'LAST_VIEW_TIME' => $user->format_date($row['topic_last_view_time']),
+ 'LAST_VIEW_TIME_RFC3339' => gmdate("Y-m-d H:i:sP", $row['topic_last_view_time']),
'LAST_POST_AUTHOR' => get_username_string('username', $row['topic_last_poster_id'], $row['topic_last_poster_name'], $row['topic_last_poster_colour']),
'LAST_POST_AUTHOR_COLOUR' => get_username_string('colour', $row['topic_last_poster_id'], $row['topic_last_poster_name'], $row['topic_last_poster_colour']),
'LAST_POST_AUTHOR_FULL' => get_username_string('full', $row['topic_last_poster_id'], $row['topic_last_poster_name'], $row['topic_last_poster_colour']),
diff --git a/phpBB/styles/prosilver/template/forumlist_body.html b/phpBB/styles/prosilver/template/forumlist_body.html
index 621e226260..c1a1445483 100644
--- a/phpBB/styles/prosilver/template/forumlist_body.html
+++ b/phpBB/styles/prosilver/template/forumlist_body.html
@@ -97,7 +97,7 @@
{L_VIEW_LATEST_POST}
-
{forumrow.LAST_POST_TIME}
+
{L_NO_POSTS}
diff --git a/phpBB/styles/prosilver/template/search_results.html b/phpBB/styles/prosilver/template/search_results.html
index 6bc5c72a87..3e1be4d4cb 100644
--- a/phpBB/styles/prosilver/template/search_results.html
+++ b/phpBB/styles/prosilver/template/search_results.html
@@ -108,7 +108,7 @@
{L_REPLIES}{L_COLON} {searchresults.TOPIC_REPLIES}
@@ -117,7 +117,7 @@
@@ -148,7 +148,7 @@
{VIEW_LATEST_POST}
-
{searchresults.LAST_POST_TIME}
+
diff --git a/phpBB/styles/prosilver/template/viewforum_body.html b/phpBB/styles/prosilver/template/viewforum_body.html
index 16d972056d..b7093cbac5 100644
--- a/phpBB/styles/prosilver/template/viewforum_body.html
+++ b/phpBB/styles/prosilver/template/viewforum_body.html
@@ -186,7 +186,7 @@
@@ -197,7 +197,7 @@
- {L_POST_BY_AUTHOR} {topicrow.TOPIC_AUTHOR_FULL} » {topicrow.FIRST_POST_TIME}
+ {L_POST_BY_AUTHOR} {topicrow.TOPIC_AUTHOR_FULL} »
» {L_IN}
{topicrow.FORUM_NAME}
@@ -229,7 +229,7 @@
{VIEW_LATEST_POST}
-
{topicrow.LAST_POST_TIME}
+
diff --git a/phpBB/styles/prosilver/template/viewtopic_body.html b/phpBB/styles/prosilver/template/viewtopic_body.html
index 40249f24eb..0de641c985 100644
--- a/phpBB/styles/prosilver/template/viewtopic_body.html
+++ b/phpBB/styles/prosilver/template/viewtopic_body.html
@@ -289,7 +289,7 @@
{postrow.MINI_POST}
- {L_POST_BY_AUTHOR} {postrow.POST_AUTHOR_FULL} » {postrow.POST_DATE}
+ {L_POST_BY_AUTHOR} {postrow.POST_AUTHOR_FULL} »
diff --git a/phpBB/viewforum.php b/phpBB/viewforum.php
index 9cc75988f7..94309afc5a 100644
--- a/phpBB/viewforum.php
+++ b/phpBB/viewforum.php
@@ -892,9 +892,12 @@ if (sizeof($topic_list))
'TOPIC_AUTHOR_COLOUR' => get_username_string('colour', $row['topic_poster'], $row['topic_first_poster_name'], $row['topic_first_poster_colour']),
'TOPIC_AUTHOR_FULL' => get_username_string('full', $row['topic_poster'], $row['topic_first_poster_name'], $row['topic_first_poster_colour']),
'FIRST_POST_TIME' => $user->format_date($row['topic_time']),
+ 'FIRST_POST_TIME_RFC3339' => gmdate("Y-m-d H:i:sP", $row['topic_time']),
'LAST_POST_SUBJECT' => censor_text($row['topic_last_post_subject']),
'LAST_POST_TIME' => $user->format_date($row['topic_last_post_time']),
+ 'LAST_POST_TIME_RFC3339' => gmdate("Y-m-d H:i:sP", $row['topic_last_post_time']),
'LAST_VIEW_TIME' => $user->format_date($row['topic_last_view_time']),
+ 'LAST_VIEW_TIME_RFC3339' => gmdate("Y-m-d H:i:sP", $row['topic_last_view_time']),
'LAST_POST_AUTHOR' => get_username_string('username', $row['topic_last_poster_id'], $row['topic_last_poster_name'], $row['topic_last_poster_colour']),
'LAST_POST_AUTHOR_COLOUR' => get_username_string('colour', $row['topic_last_poster_id'], $row['topic_last_poster_name'], $row['topic_last_poster_colour']),
'LAST_POST_AUTHOR_FULL' => get_username_string('full', $row['topic_last_poster_id'], $row['topic_last_poster_name'], $row['topic_last_poster_colour']),
diff --git a/phpBB/viewtopic.php b/phpBB/viewtopic.php
index c94675a741..a1dc60955c 100644
--- a/phpBB/viewtopic.php
+++ b/phpBB/viewtopic.php
@@ -1934,6 +1934,7 @@ for ($i = 0, $end = sizeof($post_list); $i < $end; ++$i)
'CONTACT_USER' => $user_cache[$poster_id]['contact_user'],
'POST_DATE' => $user->format_date($row['post_time'], false, ($view == 'print') ? true : false),
+ 'POST_DATE_RFC3339' => gmdate("Y-m-d H:i:sP", $row['post_time']),
'POST_SUBJECT' => $row['post_subject'],
'MESSAGE' => $message,
'SIGNATURE' => ($row['enable_sig']) ? $user_cache[$poster_id]['sig'] : '',
From 8160a8a1efe06de06a199be5c7e8262e0c199873 Mon Sep 17 00:00:00 2001
From: stevendegroote
Date: Wed, 18 Sep 2019 20:58:13 +0200
Subject: [PATCH 2/2] [ticket/16159] Use predefined DATE_RFC3339
PHPBB3-16159
---
phpBB/includes/functions_display.php | 2 +-
phpBB/search.php | 6 +++---
phpBB/viewforum.php | 6 +++---
phpBB/viewtopic.php | 2 +-
4 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/phpBB/includes/functions_display.php b/phpBB/includes/functions_display.php
index d0a0c97c4e..f8c882e771 100644
--- a/phpBB/includes/functions_display.php
+++ b/phpBB/includes/functions_display.php
@@ -547,7 +547,7 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod
$last_post_subject = $last_post_subject_truncated = '';
}
$last_post_time = $user->format_date($row['forum_last_post_time']);
- $last_post_time_rfc3339 = gmdate("Y-m-d H:i:sP", $row['forum_last_post_time']);
+ $last_post_time_rfc3339 = gmdate(DATE_RFC3339, $row['forum_last_post_time']);
$last_post_url = append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $row['forum_id_last_post'] . '&p=' . $row['forum_last_post_id']) . '#p' . $row['forum_last_post_id'];
}
else
diff --git a/phpBB/search.php b/phpBB/search.php
index 791e5cc448..64f6041371 100644
--- a/phpBB/search.php
+++ b/phpBB/search.php
@@ -1093,12 +1093,12 @@ if ($keywords || $author || $author_id || $search_id || $submit)
'TOPIC_AUTHOR_COLOUR' => get_username_string('colour', $row['topic_poster'], $row['topic_first_poster_name'], $row['topic_first_poster_colour']),
'TOPIC_AUTHOR_FULL' => get_username_string('full', $row['topic_poster'], $row['topic_first_poster_name'], $row['topic_first_poster_colour']),
'FIRST_POST_TIME' => $user->format_date($row['topic_time']),
- 'FIRST_POST_TIME_RFC3339' => gmdate("Y-m-d H:i:sP", $row['topic_time']),
+ 'FIRST_POST_TIME_RFC3339' => gmdate(DATE_RFC3339, $row['topic_time']),
'LAST_POST_SUBJECT' => $row['topic_last_post_subject'],
'LAST_POST_TIME' => $user->format_date($row['topic_last_post_time']),
- 'LAST_POST_TIME_RFC3339' => gmdate("Y-m-d H:i:sP", $row['topic_last_post_time']),
+ 'LAST_POST_TIME_RFC3339' => gmdate(DATE_RFC3339, $row['topic_last_post_time']),
'LAST_VIEW_TIME' => $user->format_date($row['topic_last_view_time']),
- 'LAST_VIEW_TIME_RFC3339' => gmdate("Y-m-d H:i:sP", $row['topic_last_view_time']),
+ 'LAST_VIEW_TIME_RFC3339' => gmdate(DATE_RFC3339, $row['topic_last_view_time']),
'LAST_POST_AUTHOR' => get_username_string('username', $row['topic_last_poster_id'], $row['topic_last_poster_name'], $row['topic_last_poster_colour']),
'LAST_POST_AUTHOR_COLOUR' => get_username_string('colour', $row['topic_last_poster_id'], $row['topic_last_poster_name'], $row['topic_last_poster_colour']),
'LAST_POST_AUTHOR_FULL' => get_username_string('full', $row['topic_last_poster_id'], $row['topic_last_poster_name'], $row['topic_last_poster_colour']),
diff --git a/phpBB/viewforum.php b/phpBB/viewforum.php
index a77c08cdd0..0a5484cdf2 100644
--- a/phpBB/viewforum.php
+++ b/phpBB/viewforum.php
@@ -933,12 +933,12 @@ if (count($topic_list))
'TOPIC_AUTHOR_COLOUR' => get_username_string('colour', $row['topic_poster'], $row['topic_first_poster_name'], $row['topic_first_poster_colour']),
'TOPIC_AUTHOR_FULL' => get_username_string('full', $row['topic_poster'], $row['topic_first_poster_name'], $row['topic_first_poster_colour']),
'FIRST_POST_TIME' => $user->format_date($row['topic_time']),
- 'FIRST_POST_TIME_RFC3339' => gmdate("Y-m-d H:i:sP", $row['topic_time']),
+ 'FIRST_POST_TIME_RFC3339' => gmdate(DATE_RFC3339, $row['topic_time']),
'LAST_POST_SUBJECT' => censor_text($row['topic_last_post_subject']),
'LAST_POST_TIME' => $user->format_date($row['topic_last_post_time']),
- 'LAST_POST_TIME_RFC3339' => gmdate("Y-m-d H:i:sP", $row['topic_last_post_time']),
+ 'LAST_POST_TIME_RFC3339' => gmdate(DATE_RFC3339, $row['topic_last_post_time']),
'LAST_VIEW_TIME' => $user->format_date($row['topic_last_view_time']),
- 'LAST_VIEW_TIME_RFC3339' => gmdate("Y-m-d H:i:sP", $row['topic_last_view_time']),
+ 'LAST_VIEW_TIME_RFC3339' => gmdate(DATE_RFC3339, $row['topic_last_view_time']),
'LAST_POST_AUTHOR' => get_username_string('username', $row['topic_last_poster_id'], $row['topic_last_poster_name'], $row['topic_last_poster_colour']),
'LAST_POST_AUTHOR_COLOUR' => get_username_string('colour', $row['topic_last_poster_id'], $row['topic_last_poster_name'], $row['topic_last_poster_colour']),
'LAST_POST_AUTHOR_FULL' => get_username_string('full', $row['topic_last_poster_id'], $row['topic_last_poster_name'], $row['topic_last_poster_colour']),
diff --git a/phpBB/viewtopic.php b/phpBB/viewtopic.php
index e49959b3b5..dadbe9a06c 100644
--- a/phpBB/viewtopic.php
+++ b/phpBB/viewtopic.php
@@ -2044,7 +2044,7 @@ for ($i = 0, $end = count($post_list); $i < $end; ++$i)
'CONTACT_USER' => $user_cache[$poster_id]['contact_user'],
'POST_DATE' => $user->format_date($row['post_time'], false, ($view == 'print') ? true : false),
- 'POST_DATE_RFC3339' => gmdate("Y-m-d H:i:sP", $row['post_time']),
+ 'POST_DATE_RFC3339' => gmdate(DATE_RFC3339, $row['post_time']),
'POST_SUBJECT' => $row['post_subject'],
'MESSAGE' => $message,
'SIGNATURE' => ($row['enable_sig']) ? $user_cache[$poster_id]['sig'] : '',