mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-26 08:36:12 +01:00
fix: #8073, configurable necroThreshold
This commit is contained in:
@@ -126,6 +126,7 @@
|
|||||||
"eventLoopInterval": 500,
|
"eventLoopInterval": 500,
|
||||||
"onlineCutoff": 30,
|
"onlineCutoff": 30,
|
||||||
"timeagoCutoff": 30,
|
"timeagoCutoff": 30,
|
||||||
|
"necroThreshold": 7,
|
||||||
"categoryWatchState": "watching",
|
"categoryWatchState": "watching",
|
||||||
"submitPluginUsage": 1
|
"submitPluginUsage": 1
|
||||||
}
|
}
|
||||||
@@ -32,6 +32,8 @@
|
|||||||
"timestamp": "Timestamp",
|
"timestamp": "Timestamp",
|
||||||
"timestamp.cut-off": "Date cut-off (in days)",
|
"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.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": "Teaser Post",
|
||||||
"teaser.last-post": "Last – Show the latest post, including the original post, if no replies",
|
"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",
|
"teaser.last-reply": "Last – Show the latest reply, or a \"No replies\" placeholder if no replies",
|
||||||
|
|||||||
@@ -261,8 +261,8 @@ define('forum/topic/posts', [
|
|||||||
};
|
};
|
||||||
|
|
||||||
function addNecroPostMessage() {
|
function addNecroPostMessage() {
|
||||||
var necroThreshold = 7 * 24 * 60 * 60 * 1000;
|
var necroThreshold = ajaxify.data.necroThreshold * 24 * 60 * 60 * 1000;
|
||||||
if (config.topicPostSort !== 'newest_to_oldest' && config.topicPostSort !== 'oldest_to_newest') {
|
if (!necroThreshold || (config.topicPostSort !== 'newest_to_oldest' && config.topicPostSort !== 'oldest_to_newest')) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -81,6 +81,7 @@ topicsController.get = async function getTopic(req, res, callback) {
|
|||||||
topicData['downvote:disabled'] = meta.config['downvote:disabled'];
|
topicData['downvote:disabled'] = meta.config['downvote:disabled'];
|
||||||
topicData['feeds:disableRSS'] = meta.config['feeds:disableRSS'];
|
topicData['feeds:disableRSS'] = meta.config['feeds:disableRSS'];
|
||||||
topicData.bookmarkThreshold = meta.config.bookmarkThreshold;
|
topicData.bookmarkThreshold = meta.config.bookmarkThreshold;
|
||||||
|
topicData.necroThreshold = meta.config.necroThreshold;
|
||||||
topicData.postEditDuration = meta.config.postEditDuration;
|
topicData.postEditDuration = meta.config.postEditDuration;
|
||||||
topicData.postDeleteDuration = meta.config.postDeleteDuration;
|
topicData.postDeleteDuration = meta.config.postDeleteDuration;
|
||||||
topicData.scrollToMyPost = settings.scrollToMyPost;
|
topicData.scrollToMyPost = settings.scrollToMyPost;
|
||||||
|
|||||||
@@ -163,6 +163,13 @@
|
|||||||
[[admin/settings/post:timestamp.cut-off-help]]
|
[[admin/settings/post:timestamp.cut-off-help]]
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</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>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user