Baris Soner Usakli 11 years ago
parent 55e990f71d
commit ab1015b11e

@ -87,11 +87,6 @@ var RDB = require('./redis.js'),
function getTopics(next) {
topics.getTopicsByTids(tids, current_user, function(topicsData) {
// Float pinned topics to the top of the list
topicsData = topicsData.sort(function(a, b) {
return parseInt(b.pinned, 10) - parseInt(a.pinned, 10);
});
next(null, topicsData);
}, category_id);
}

@ -365,13 +365,18 @@ var RDB = require('./redis.js'),
RDB.incr('totalpostcount');
topics.getTopicField(tid, 'cid', function(err, cid) {
topics.getTopicFields(tid, ['cid', 'pinned'], function(err, topicData) {
RDB.handle(err);
var cid = topicData.cid;
feed.updateTopic(tid);
RDB.zadd('categories:recent_posts:cid:' + cid, timestamp, pid);
RDB.zadd('categories:' + cid + ':tid', timestamp, tid);
if(topicData.pinned === '0')
RDB.zadd('categories:' + cid + ':tid', timestamp, tid);
RDB.scard('cid:' + cid + ':active_users', function(err, amount) {
if (amount > 10) {

Loading…
Cancel
Save