refactors to sitemap, closed #2254

v1.18.x
Julian Lam 10 years ago
parent 9b0ba6c7a4
commit dfbac595b6

@ -54,34 +54,34 @@ var path = require('path'),
topicUrls: function(next) {
var topicUrls = [];
db.getSortedSetRevRange('topics:recent', 0, 49, function(err, tids) {
async.waterfall([
async.apply(db.getSortedSetRevRange, 'topics:recent', 0, -1),
function(tids, next) {
db.getSortedSetRevRange('topics:recent', 0, -1, next);
},
function(tids, next) {
privileges.topics.filter('read', tids, 0, next);
},
function(tids, next) {
topics.getTopicsFields(tids, ['tid', 'title', 'lastposttime'], next);
}
], function(err, topics) {
if (err) {
return next(err);
}
privileges.topics.filter('read', tids, 0, function(err, tids) {
if (err) {
return next(err);
}
topics.getTopicsFields(tids, ['tid', 'title', 'lastposttime'], function(err, topics) {
if (err) {
return next(err);
}
topics.forEach(function(topic) {
if (topic) {
topicUrls.push({
url: '/topic/' + topic.tid + '/' + encodeURIComponent(utils.slugify(topic.title)),
lastmodISO: utils.toISOString(topic.lastposttime),
changefreq: 'daily',
priority: '0.6'
});
}
topics.forEach(function(topic) {
if (topic) {
topicUrls.push({
url: '/topic/' + topic.tid + '/' + encodeURIComponent(utils.slugify(topic.title)),
lastmodISO: utils.toISOString(topic.lastposttime),
changefreq: 'daily',
priority: '0.6'
});
next(null, topicUrls);
});
}
});
next(null, topicUrls);
});
}
}, function(err, data) {

Loading…
Cancel
Save