"use strict"; var async = require('async'), validator = require('validator'), db = require('./database'), posts = require('./posts'), utils = require('../public/src/utils'), plugins = require('./plugins'), user = require('./user'), categories = require('./categories'), privileges = require('./privileges'); (function(Topics) { require('./topics/create')(Topics); require('./topics/delete')(Topics); require('./topics/unread')(Topics); require('./topics/recent')(Topics); require('./topics/popular')(Topics); require('./topics/fork')(Topics); require('./topics/posts')(Topics); require('./topics/follow')(Topics); require('./topics/tags')(Topics); Topics.getTopicData = function(tid, callback) { Topics.getTopicsData([tid], function(err, topics) { callback(err, Array.isArray(topics) && topics.length ? topics[0] : null); }); }; Topics.getTopicsData = function(tids, callback) { var keys = []; for (var i=0; i