Skip to content

Node.js based forum software built for the modern web

fix: #7789

Barış Soner Uşaklı6a289fbac96d
diff --git a/install/data/defaults.json b/install/data/defaults.json
index 3c9221aa1a..bfdcd18f1d 100644
--- a/install/data/defaults.json
+++ b/install/data/defaults.json
@@ -20,6 +20,7 @@
"chatDeleteDuration": 0,
"chatMessageDelay": 200,
"newbiePostDelayThreshold": 3,
+ "postQueueReputationThreshold": 0,
"minimumPostLength": 8,
"maximumPostLength": 32767,
"minimumTagsPerTopic": 0,
diff --git a/public/language/en-GB/admin/manage/post-queue.json b/public/language/en-GB/admin/manage/post-queue.json
index 4de24c991b..2742e3a7af 100644
--- a/public/language/en-GB/admin/manage/post-queue.json
+++ b/public/language/en-GB/admin/manage/post-queue.json
@@ -1,6 +1,6 @@
{
"post-queue": "Post Queue",
- "description": "There are no posts in the post queue. <br> To enable this feature, go to <a href=\"%1\">Settings &rarr; Post &rarr; Posting Restrictions</a> and enable <strong>Post Queue</strong>.",
+ "description": "There are no posts in the post queue. <br> To enable this feature, go to <a href=\"%1\">Settings &rarr; Post &rarr; Post Queue</a> and enable <strong>Post Queue</strong>.",
"user": "User",
"category": "Category",
"title": "Title",
diff --git a/public/language/en-GB/admin/settings/post.json b/public/language/en-GB/admin/settings/post.json
index 7fc74a4d6b..b10ebe2c35 100644
--- a/public/language/en-GB/admin/settings/post.json
+++ b/public/language/en-GB/admin/settings/post.json
@@ -7,9 +7,11 @@
"sorting.most-posts": "Most Posts",
"sorting.topic-default": "Default Topic Sorting",
"length": "Post Length",
+ "post-queue": "Post Queue",
"restrictions": "Posting Restrictions",
"restrictions-new": "New User Restrictions",
"restrictions.post-queue": "Enable post queue",
+ "restrictions.post-queue-rep-threshold": "Reputation required to bypass post queue",
"restrictions-new.post-queue": "Enable new user restrictions",
"restrictions.post-queue-help": "Enabling post queue will put the posts of new users in a queue for approval",
"restrictions-new.post-queue-help": "Enabling new user restrictions will set restrictions on posts created by new users",
diff --git a/src/posts/queue.js b/src/posts/queue.js
index f84e707c7a..e811eaaa16 100644
--- a/src/posts/queue.js
+++ b/src/posts/queue.js
@@ -16,7 +16,7 @@ var socketHelpers = require('../socket.io/helpers');
module.exports = function (Posts) {
Posts.shouldQueue = async function (uid, data) {
const userData = await user.getUserFields(uid, ['uid', 'reputation', 'postcount']);
- const shouldQueue = meta.config.postQueue && (!userData.uid || userData.reputation < meta.config.newbiePostDelayThreshold || userData.postcount <= 0);
+ const shouldQueue = meta.config.postQueue && (!userData.uid || userData.reputation < meta.config.postQueueReputationThreshold || userData.postcount <= 0);
const result = await plugins.fireHook('filter:post.shouldQueue', {
shouldQueue: !!shouldQueue,
uid: uid,
diff --git a/src/views/admin/manage/post-queue.tpl b/src/views/admin/manage/post-queue.tpl
index f06acf6832..0f605613ab 100644
--- a/src/views/admin/manage/post-queue.tpl
+++ b/src/views/admin/manage/post-queue.tpl
@@ -7,7 +7,7 @@
<!-- IF !posts.length -->
<p class="panel-body">
- [[admin/manage/post-queue:description, {config.relative_path}/admin/settings/post#posting-restrictions]]
+ [[admin/manage/post-queue:description, {config.relative_path}/admin/settings/post#post-queue]]
</p>
<!-- ENDIF !posts.length -->
diff --git a/src/views/admin/settings/post.tpl b/src/views/admin/settings/post.tpl
index 24060b1391..e558141158 100644
--- a/src/views/admin/settings/post.tpl
+++ b/src/views/admin/settings/post.tpl
@@ -94,6 +94,29 @@
<label for="newbiePostDelayThreshold">[[admin/settings/post:restrictions.rep-threshold]]</label>
<input id="newbiePostDelayThreshold" type="text" class="form-control" value="3" data-field="newbiePostDelayThreshold">
</div>
+
+ <div class="form-group">
+ <label for="newbiePostDelay">[[admin/settings/post:restrictions.seconds-between-new]]</label>
+ <input id="newbiePostDelay" type="text" class="form-control" value="120" data-field="newbiePostDelay">
+ </div>
+
+ <div class="form-group">
+ <label for="initialPostDelay">[[admin/settings/post:restrictions.seconds-before-new]]</label>
+ <input id="initialPostDelay" type="text" class="form-control" value="10" data-field="initialPostDelay">
+ </div>
+
+ <div class="form-group">
+ <label for="newbiePostEditDuration">[[admin/settings/post:restrictions.seconds-edit-after]]</label>
+ <input id="newbiePostEditDuration" type="text" class="form-control" value="120" data-field="newbiePostEditDuration">
+ </div>
+ </form>
+ </div>
+</div>
+
+<div class="row">
+ <div class="col-sm-2 col-xs-12 settings-header">[[admin/settings/post:post-queue]]</div>
+ <div class="col-sm-10 col-xs-12">
+ <form>
<div class="row">
<div class="col-sm-6">
<div class="form-group">
@@ -110,22 +133,8 @@
</div>
<div class="col-sm-6">
<div class="form-group">
- <label for="newbiePostDelay">[[admin/settings/post:restrictions.seconds-between-new]]</label>
- <input id="newbiePostDelay" type="text" class="form-control" value="120" data-field="newbiePostDelay">
- </div>
- </div>
- </div>
- <div class="row">
- <div class="col-sm-6">
- <div class="form-group">
- <label for="initialPostDelay">[[admin/settings/post:restrictions.seconds-before-new]]</label>
- <input id="initialPostDelay" type="text" class="form-control" value="10" data-field="initialPostDelay">
- </div>
- </div>
- <div class="col-sm-6">
- <div class="form-group">
- <label for="newbiePostEditDuration">[[admin/settings/post:restrictions.seconds-edit-after]]</label>
- <input id="newbiePostEditDuration" type="text" class="form-control" value="120" data-field="newbiePostEditDuration">
+ <label for="postQueueReputationThreshold">[[admin/settings/post:restrictions.post-queue-rep-threshold]]</label>
+ <input id="postQueueReputationThreshold" type="text" class="form-control" value="0" data-field="postQueueReputationThreshold">
</div>
</div>
</div>