mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-03 20:45:58 +01:00
get pid and tid and cid methods in posts and topics
This commit is contained in:
@@ -166,6 +166,12 @@ var RDB = require('./redis.js'),
|
||||
});
|
||||
}
|
||||
|
||||
Topics.get_cid_by_tid = function(tid, callback) {
|
||||
RDB.get('tid:' + pid + ':cid', function(err, cid) {
|
||||
if (cid && parseInt(cid) > 0) callback(cid);
|
||||
else callback(false);
|
||||
});
|
||||
}
|
||||
|
||||
Topics.markAsRead = function(tid, uid) {
|
||||
RDB.sadd('tid:' + tid + ':read_by_uid', uid);
|
||||
|
||||
Reference in New Issue
Block a user