store pinned topics in new zset

keep pinned topics on top on different sort types
This commit is contained in:
barisusakli
2016-11-25 17:46:29 +03:00
parent d4638ffc15
commit c33d3e874a
10 changed files with 190 additions and 64 deletions

View File

@@ -53,23 +53,8 @@ var social = require('./social');
};
Topics.getTidPage = function (tid, uid, callback) {
if(!tid) {
return callback(new Error('[[error:invalid-tid]]'));
}
async.parallel({
index: function (next) {
categories.getTopicIndex(tid, next);
},
settings: function (next) {
user.getSettings(uid, next);
}
}, function (err, results) {
if (err) {
return callback(err);
}
callback(null, Math.ceil((results.index + 1) / results.settings.topicsPerPage));
});
console.warn('[Topics.getTidPage] deprecated!');
callback(null, 1);
};
Topics.getTopicsFromSet = function (set, uid, start, stop, callback) {