diff --git a/install/data/defaults.json b/install/data/defaults.json index 574a8bfe01..67557efabe 100644 --- a/install/data/defaults.json +++ b/install/data/defaults.json @@ -38,6 +38,7 @@ "maximumTagLength": 15, "undoTimeout": 0, "allowTopicsThumbnail": 1, + "showPostUploadsAsThumbnails": 1, "registrationType": "normal", "registrationApprovalType": "normal", "allowAccountDelete": 1, diff --git a/public/language/en-GB/admin/settings/uploads.json b/public/language/en-GB/admin/settings/uploads.json index 22046915d9..e91a7bee36 100644 --- a/public/language/en-GB/admin/settings/uploads.json +++ b/public/language/en-GB/admin/settings/uploads.json @@ -22,6 +22,7 @@ "reject-image-height": "Maximum Image Height (in pixels)", "reject-image-height-help": "Images taller than this value will be rejected.", "allow-topic-thumbnails": "Allow users to upload topic thumbnails", + "show-post-uploads-as-thumbnails": "Show post uploads as thumbnails", "topic-thumb-size": "Topic Thumb Size", "allowed-file-extensions": "Allowed File Extensions", "allowed-file-extensions-help": "Enter comma-separated list of file extensions here (e.g. pdf,xls,doc). An empty list means all extensions are allowed.", diff --git a/src/topics/thumbs.js b/src/topics/thumbs.js index 22fa2c48bd..3239ab0fdc 100644 --- a/src/topics/thumbs.js +++ b/src/topics/thumbs.js @@ -33,8 +33,9 @@ Thumbs.load = async function (topicData) { const topicsWithThumbs = topicData.filter((tid, idx) => hasThumbs[idx]); const tidsWithThumbs = topicsWithThumbs.map(t => t.tid); - - const thumbs = await loadFromTopicData(topicsWithThumbs); + const thumbs = await loadFromTopicData(topicsWithThumbs, { + thumbsOnly: meta.config.showPostUploadsAsThumbnails !== 1, + }); const tidToThumbs = _.zipObject(tidsWithThumbs, thumbs); return topicData.map(t => (t && t.tid ? (tidToThumbs[t.tid] || []) : [])); diff --git a/src/views/admin/settings/uploads.tpl b/src/views/admin/settings/uploads.tpl index aa138c8c67..400058eb20 100644 --- a/src/views/admin/settings/uploads.tpl +++ b/src/views/admin/settings/uploads.tpl @@ -88,6 +88,11 @@ +
+ + +
+