Node.js based forum software built for the modern web
fix: #8073, configurable necroThreshold
Baris Usakli4d66978338d8
diff --git a/install/data/defaults.json b/install/data/defaults.jsonindex 194283b400..a6f53f49c0 100644--- a/install/data/defaults.json+++ b/install/data/defaults.json@@ -126,6 +126,7 @@"eventLoopInterval": 500,"onlineCutoff": 30,"timeagoCutoff": 30,+ "necroThreshold": 7,"categoryWatchState": "watching","submitPluginUsage": 1}\ No newline at end of filediff --git a/public/language/en-GB/admin/settings/post.json b/public/language/en-GB/admin/settings/post.jsonindex 096b69026f..da708f4c6c 100644--- a/public/language/en-GB/admin/settings/post.json+++ b/public/language/en-GB/admin/settings/post.json@@ -32,6 +32,8 @@"timestamp": "Timestamp","timestamp.cut-off": "Date cut-off (in days)","timestamp.cut-off-help": "Dates & times will be shown in a relative manner (e.g. \"3 hours ago\" / \"5 days ago\"), and localised into various\n\t\t\t\t\tlanguages. After a certain point, this text can be switched to display the localised date itself\n\t\t\t\t\t(e.g. 5 Nov 2016 15:30).<br /><em>(Default: <code>30</code>, or one month). Set to 0 to always display dates, leave blank to always display relative times.</em>",+ "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: <code>7</code>, or one week). Set to 0 to disable.</em>","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.jsindex 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.jsindex 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.tplindex 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]]</p></div>+ <div class="form-group">+ <label for="necroThreshold">[[admin/settings/post:timestamp.necro-threshold]]</label>+ <input type="number" class="form-control" id="necroThreshold" data-field="necroThreshold" />+ <p class="help-block">+ [[admin/settings/post:timestamp.necro-threshold-help]]+ </p>+ </div></form></div></div>