mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-02 03:55:55 +01:00
closes #199
This commit is contained in:
@@ -70,13 +70,18 @@ var RDB = require('./redis.js'),
|
||||
}
|
||||
|
||||
Posts.addUserInfoToPost(postData, function() {
|
||||
topics.getTopicField(postData.tid, 'slug', function(err, topicSlug) {
|
||||
topics.getTopicFields(postData.tid, ['slug', 'deleted'], function(err, topicData) {
|
||||
if(err)
|
||||
return callback(err);
|
||||
|
||||
if(topicData.deleted === '1')
|
||||
return callback(null);
|
||||
|
||||
if(postData.content)
|
||||
postData.content = utils.strip_tags(postTools.markdownToHTML(postData.content));
|
||||
|
||||
postData.relativeTime = utils.relativeTime(postData.timestamp);
|
||||
postData.topicSlug = topicSlug;
|
||||
postData.topicSlug = topicData.slug;
|
||||
posts.push(postData);
|
||||
callback(null);
|
||||
});
|
||||
|
||||
@@ -160,7 +160,7 @@ var RDB = require('./redis.js'),
|
||||
if (privileges.editable) {
|
||||
|
||||
topics.setTopicField(tid, 'pinned', 0);
|
||||
topics.getTopicFields(tid, ['cid', 'lastposttime'], function(topicData) {
|
||||
topics.getTopicFields(tid, ['cid', 'lastposttime'], function(err, topicData) {
|
||||
RDB.zadd('categories:' + topicData.cid + ':tid', topicData.lastposttime, tid);
|
||||
});
|
||||
if (socket) {
|
||||
@@ -180,7 +180,7 @@ var RDB = require('./redis.js'),
|
||||
|
||||
ThreadTools.move = function(tid, cid, socket) {
|
||||
|
||||
topics.getTopicFields(tid, ['cid', 'lastposttime'], function(topicData) {
|
||||
topics.getTopicFields(tid, ['cid', 'lastposttime'], function(err, topicData) {
|
||||
var oldCid = topicData.cid;
|
||||
var multi = RDB.multi();
|
||||
|
||||
|
||||
@@ -649,14 +649,7 @@ marked.setOptions({
|
||||
}
|
||||
|
||||
Topics.getTopicFields = function(tid, fields, callback) {
|
||||
RDB.hmgetObject('topic:' + tid, fields, function(err, data) {
|
||||
if(err === null) {
|
||||
callback(data);
|
||||
}
|
||||
else {
|
||||
console.log(err);
|
||||
}
|
||||
});
|
||||
RDB.hmgetObject('topic:' + tid, fields, callback);
|
||||
}
|
||||
|
||||
Topics.setTopicField = function(tid, field, value) {
|
||||
|
||||
Reference in New Issue
Block a user