"use strict"; var async = require('async'), gravatar = require('gravatar'), validator = require('validator'), db = require('./database'), posts = require('./posts'), utils = require('./../public/src/utils'), plugins = require('./plugins'), user = require('./user'), categories = require('./categories'), categoryTools = require('./categoryTools'), threadTools = require('./threadTools'); (function(Topics) { require('./topics/create')(Topics); require('./topics/unread')(Topics); require('./topics/recent')(Topics); require('./topics/fork')(Topics); require('./topics/posts')(Topics); Topics.getTopicData = function(tid, callback) { Topics.getTopicsData([tid], function(err, topics) { if (err) { return callback(err); } callback(null, topics ? topics[0] : null); }); }; Topics.getTopicsData = function(tids, callback) { var keys = []; for (var i=0; i