get pid and tid and cid methods in posts and topics

This commit is contained in:
Julian Lam
2013-05-16 18:15:58 -04:00
parent 6492da0876
commit e5716145ae
2 changed files with 25 additions and 0 deletions

View File

@@ -181,6 +181,25 @@ marked.setOptions({
}
}
Posts.editable = function(uid, pid) {
}
Posts.get_tid_by_pid = function(pid, callback) {
RDB.get('pid:' + pid + ':tid', function(err, tid) {
if (tid && parseInt(tid) > 0) callback(tid);
else callback(false);
});
}
Posts.get_cid_by_pid = function(pid, callback) {
Posts.get_tid(pid, function(tid) {
if (tid) topics.get_cid_by_tid(tid, function(cid) {
if (cid) callback(cid);
else callback(false);
});
})
}
Posts.reply = function(socket, tid, uid, content) {
if (uid < 1) {