From 4d66978338d802a05cafd03bafcba0890da4cfdb Mon Sep 17 00:00:00 2001
From: Baris Usakli
(Default: 30, or one month). Set to 0 to always display dates, leave blank to always display relative times.",
+ "timestamp.necro-threshold": "Necro Threshold (in days)",
+ "timestamp.necro-threshold-help": "A message will be shown between posts if the time between them is longer than the necro threshold. (Default: 7, or one week). Set to 0 to disable.",
"teaser": "Teaser Post",
"teaser.last-post": "Last – Show the latest post, including the original post, if no replies",
"teaser.last-reply": "Last – Show the latest reply, or a \"No replies\" placeholder if no replies",
diff --git a/public/src/client/topic/posts.js b/public/src/client/topic/posts.js
index 61b000d8ac..6bcc05ddc2 100644
--- a/public/src/client/topic/posts.js
+++ b/public/src/client/topic/posts.js
@@ -261,8 +261,8 @@ define('forum/topic/posts', [
};
function addNecroPostMessage() {
- var necroThreshold = 7 * 24 * 60 * 60 * 1000;
- if (config.topicPostSort !== 'newest_to_oldest' && config.topicPostSort !== 'oldest_to_newest') {
+ var necroThreshold = ajaxify.data.necroThreshold * 24 * 60 * 60 * 1000;
+ if (!necroThreshold || (config.topicPostSort !== 'newest_to_oldest' && config.topicPostSort !== 'oldest_to_newest')) {
return;
}
diff --git a/src/controllers/topics.js b/src/controllers/topics.js
index 5ac12e629d..a42747c0d4 100644
--- a/src/controllers/topics.js
+++ b/src/controllers/topics.js
@@ -81,6 +81,7 @@ topicsController.get = async function getTopic(req, res, callback) {
topicData['downvote:disabled'] = meta.config['downvote:disabled'];
topicData['feeds:disableRSS'] = meta.config['feeds:disableRSS'];
topicData.bookmarkThreshold = meta.config.bookmarkThreshold;
+ topicData.necroThreshold = meta.config.necroThreshold;
topicData.postEditDuration = meta.config.postEditDuration;
topicData.postDeleteDuration = meta.config.postDeleteDuration;
topicData.scrollToMyPost = settings.scrollToMyPost;
diff --git a/src/views/admin/settings/post.tpl b/src/views/admin/settings/post.tpl
index 4a1657b096..5ee1dbdc6c 100644
--- a/src/views/admin/settings/post.tpl
+++ b/src/views/admin/settings/post.tpl
@@ -163,6 +163,13 @@
[[admin/settings/post:timestamp.cut-off-help]]
+ [[admin/settings/post:timestamp.necro-threshold-help]] +
+