mirror of
				https://github.com/NodeBB/NodeBB.git
				synced 2025-10-31 02:55:58 +01:00 
			
		
		
		
	closes #1557
This commit is contained in:
		| @@ -13,7 +13,7 @@ define(function() { | ||||
| 		} | ||||
|  | ||||
| 		tagEl.tagsinput({ | ||||
| 			maxTags: 5 // TODO: make configurable | ||||
| 			maxTags: config.tagsPerTopic | ||||
| 		}); | ||||
| 		addTags(postData.tags, tagEl); | ||||
|  | ||||
|   | ||||
| @@ -32,6 +32,7 @@ apiController.getConfig = function(req, res, next) { | ||||
| 	config.disableSocialButtons = parseInt(meta.config.disableSocialButtons, 10) === 1; | ||||
| 	config.maxReconnectionAttempts = meta.config.maxReconnectionAttempts || 5; | ||||
| 	config.reconnectionDelay = meta.config.reconnectionDelay || 200; | ||||
| 	config.tagsPerTopic = meta.config.tagsPerTopic || 5; | ||||
| 	config.topicsPerPage = meta.config.topicsPerPage || 20; | ||||
| 	config.postsPerPage = meta.config.postsPerPage || 20; | ||||
| 	config.maximumFileSize = meta.config.maximumFileSize; | ||||
|   | ||||
| @@ -3,14 +3,16 @@ | ||||
|  | ||||
| var async = require('async'), | ||||
| 	db = require('../database'), | ||||
| 	meta = require('../meta'), | ||||
| 	utils = require('../../public/src/utils'); | ||||
|  | ||||
| module.exports = function(Topics) { | ||||
|  | ||||
| 	Topics.createTags = function(tags, tid, timestamp, callback) { | ||||
| 		if(Array.isArray(tags)) { | ||||
| 			tags = tags.slice(0, meta.config.tagsPerTopic || 5); | ||||
| 			async.each(tags, function(tag, next) { | ||||
| 				tag = utils.removePunctuation(tag.trim().toLowerCase()).substr(0, 20); // TODO: make max length configurable | ||||
| 				tag = utils.removePunctuation(tag.trim().toLowerCase()).substr(0, meta.config.maximumTagLength || 15); | ||||
|  | ||||
| 				db.setAdd('topic:' + tid + ':tags', tag); | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user