mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-07 22:45:46 +01:00
moved related up
This commit is contained in:
@@ -192,7 +192,8 @@ var social = require('./social');
|
|||||||
isFollowing: async.apply(Topics.isFollowing, [topicData.tid], uid),
|
isFollowing: async.apply(Topics.isFollowing, [topicData.tid], uid),
|
||||||
isIgnoring: async.apply(Topics.isIgnoring, [topicData.tid], uid),
|
isIgnoring: async.apply(Topics.isIgnoring, [topicData.tid], uid),
|
||||||
bookmark: async.apply(Topics.getUserBookmark, topicData.tid, uid),
|
bookmark: async.apply(Topics.getUserBookmark, topicData.tid, uid),
|
||||||
postSharing: async.apply(social.getActivePostSharing)
|
postSharing: async.apply(social.getActivePostSharing),
|
||||||
|
related: async.apply(Topics.getRelatedTopics, topicData, uid)
|
||||||
}, next);
|
}, next);
|
||||||
},
|
},
|
||||||
function (results, next) {
|
function (results, next) {
|
||||||
@@ -205,6 +206,7 @@ var social = require('./social');
|
|||||||
topicData.isIgnoring = results.isIgnoring[0];
|
topicData.isIgnoring = results.isIgnoring[0];
|
||||||
topicData.bookmark = results.bookmark;
|
topicData.bookmark = results.bookmark;
|
||||||
topicData.postSharing = results.postSharing;
|
topicData.postSharing = results.postSharing;
|
||||||
|
topicData.related = results.related || [];
|
||||||
|
|
||||||
topicData.unreplied = parseInt(topicData.postcount, 10) === 1;
|
topicData.unreplied = parseInt(topicData.postcount, 10) === 1;
|
||||||
topicData.deleted = parseInt(topicData.deleted, 10) === 1;
|
topicData.deleted = parseInt(topicData.deleted, 10) === 1;
|
||||||
@@ -213,10 +215,6 @@ var social = require('./social');
|
|||||||
|
|
||||||
topicData.icons = [];
|
topicData.icons = [];
|
||||||
|
|
||||||
Topics.getRelatedTopics(topicData, uid, next);
|
|
||||||
},
|
|
||||||
function (related, next) {
|
|
||||||
topicData.related = related || [];
|
|
||||||
plugins.fireHook('filter:topic.get', {topic: topicData, uid: uid}, next);
|
plugins.fireHook('filter:topic.get', {topic: topicData, uid: uid}, next);
|
||||||
},
|
},
|
||||||
function (data, next) {
|
function (data, next) {
|
||||||
|
|||||||
@@ -316,7 +316,7 @@ module.exports = function(Topics) {
|
|||||||
return plugins.fireHook('filter:topic.getRelatedTopics', {topic: topicData, uid: uid}, callback);
|
return plugins.fireHook('filter:topic.getRelatedTopics', {topic: topicData, uid: uid}, callback);
|
||||||
}
|
}
|
||||||
|
|
||||||
var maximumTopics = parseInt(meta.config.maximumRelatedTopics, 10);
|
var maximumTopics = parseInt(meta.config.maximumRelatedTopics, 10) || 0;
|
||||||
if (maximumTopics === 0 || !topicData.tags.length) {
|
if (maximumTopics === 0 || !topicData.tags.length) {
|
||||||
return callback(null, []);
|
return callback(null, []);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user