|
|
|
@ -2,9 +2,11 @@ var db = require('./database.js'),
|
|
|
|
|
posts = require('./posts.js'),
|
|
|
|
|
utils = require('./../public/src/utils.js'),
|
|
|
|
|
user = require('./user.js'),
|
|
|
|
|
async = require('async'),
|
|
|
|
|
topics = require('./topics.js'),
|
|
|
|
|
plugins = require('./plugins'),
|
|
|
|
|
CategoryTools = require('./categoryTools'),
|
|
|
|
|
|
|
|
|
|
async = require('async'),
|
|
|
|
|
winston = require('winston'),
|
|
|
|
|
nconf = require('nconf');
|
|
|
|
|
|
|
|
|
@ -210,11 +212,13 @@ var db = require('./database.js'),
|
|
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
Categories.getRecentReplies = function(cid, count, callback) {
|
|
|
|
|
Categories.getRecentReplies = function(cid, uid, count, callback) {
|
|
|
|
|
if(count === 0) {
|
|
|
|
|
return callback(null, []);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
CategoryTools.privileges(cid, uid, function(err, privileges) {
|
|
|
|
|
if (privileges.read) {
|
|
|
|
|
db.getSortedSetRevRange('categories:recent_posts:cid:' + cid, 0, count - 1, function(err, pids) {
|
|
|
|
|
|
|
|
|
|
if (err) {
|
|
|
|
@ -233,6 +237,10 @@ var db = require('./database.js'),
|
|
|
|
|
callback(null, postData);
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
} else {
|
|
|
|
|
callback(null, []);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
Categories.moveRecentReplies = function(tid, oldCid, cid, callback) {
|
|
|
|
|