fix: #8073, configurable necroThreshold

v1.18.x
Baris Usakli 5 years ago
parent 160e0ab1f5
commit 4d66978338

@ -126,6 +126,7 @@
"eventLoopInterval": 500,
"onlineCutoff": 30,
"timeagoCutoff": 30,
"necroThreshold": 7,
"categoryWatchState": "watching",
"submitPluginUsage": 1
}

@ -32,6 +32,8 @@
"timestamp": "Timestamp",
"timestamp.cut-off": "Date cut-off (in days)",
"timestamp.cut-off-help": "Dates &amp; 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 &ndash; Show the latest post, including the original post, if no replies",
"teaser.last-reply": "Last &ndash; Show the latest reply, or a \"No replies\" placeholder if no replies",

@ -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;
}

@ -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;

@ -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>

Loading…
Cancel
Save