mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-07 06:25:50 +01:00
generic "related topics" functionality
This commit is contained in:
@@ -192,12 +192,19 @@ var async = require('async'),
|
||||
}, next);
|
||||
},
|
||||
function(results, next) {
|
||||
if (plugins.hasListeners('filter:topic.getRelatedTopics')) {
|
||||
plugins.fireHook('filter:topic.getRelatedTopics', results, next);
|
||||
} else {
|
||||
Topics.getRelatedTopics(results, next);
|
||||
}
|
||||
}, function(results, next) {
|
||||
topicData.posts = results.posts;
|
||||
topicData.category = results.category;
|
||||
topicData.thread_tools = results.threadTools.tools;
|
||||
topicData.tags = results.tags;
|
||||
topicData.isFollowing = results.isFollowing[0];
|
||||
topicData.bookmark = results.bookmark;
|
||||
topicData.related = results.related || [];
|
||||
|
||||
topicData.unreplied = parseInt(topicData.postcount, 10) === 1;
|
||||
topicData.deleted = parseInt(topicData.deleted, 10) === 1;
|
||||
|
||||
Reference in New Issue
Block a user