add early404 to board settings incase somebody wants it off

merge-requests/208/head
fatchan 5 years ago
parent cf3156fa4e
commit b10b7135dd
  1. 17
      db/posts.js
  2. 1
      gulpfile.js
  3. 1
      models/forms/changeboardsettings.js
  4. 1
      models/forms/create.js
  5. 4
      views/pages/manage.pug

@ -380,13 +380,16 @@ module.exports = {
'bumped': -1
}).skip(board.settings.threadLimit).toArray();
const early404Threads = await db.find({
'thread': null,
'board': board._id,
'replyposts': {
'$lte': 5 //less than 5 replies
}
}).skip(30).toArray() //after page 3
let early404Threads = [];
if (board.settings.early404 === true) {
early404Threads = await db.find({
'thread': null,
'board': board._id,
'replyposts': {
'$lt': 5
}
}).skip(Math.floor(board.settings.threadLimit/3)).toArray();
}
return oldThreads.concat(early404Threads);
},

@ -58,6 +58,7 @@ async function wipe() {
'tphTrigger': 10,
'tphTriggerAction': 2,
'forceAnon': true,
'early404': true,
'ids': false,
'userPostDelete': true,
'userPostSpoiler': true,

@ -43,6 +43,7 @@ module.exports = async (req, res, next) => {
description: req.body.description && req.body.description.trim().length > 0 ? req.body.description : oldSettings.description,
moderators,
locked: req.body.locked ? true : false,
early404: req.body.early404 ? true : false,
ids: req.body.ids ? true : false,
forceAnon: req.body.force_anon ? true : false,
userPostDelete: req.body.user_reply_delete ? true : false,

@ -34,6 +34,7 @@ module.exports = async (req, res, next) => {
'tphTrigger': 0,
'tphTriggerAction': 0,
'forceAnon': false,
'early404': true,
'ids': false,
'userPostDelete': true,
'userPostSpoiler': true,

@ -27,6 +27,10 @@ block content
section.row
.label Max Files
input(type='number' name='max_files' value=board.settings.maxFiles)
section.row
.label Early 404
label.postform-style.ph-5
input(type='checkbox', name='early404', value='true' checked=board.settings.early404)
section.row
.label IDs
label.postform-style.ph-5

Loading…
Cancel
Save