generic "related topics" functionality

This commit is contained in:
psychobunny
2015-12-17 16:44:22 -05:00
parent 0af11c5c0c
commit ba719148c1
2 changed files with 45 additions and 0 deletions

View File

@@ -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;