limit topic views by session

v1.18.x
barisusakli 9 years ago
parent e693843314
commit d9b6a06714

@ -266,7 +266,11 @@ topicsController.get = function(req, res, callback) {
res.locals.linkTags.push(rel);
});
req.session.tids_viewed = req.session.tids_viewed || {};
if (!req.session.tids_viewed[tid] || req.session.tids_viewed[tid] < Date.now() - 3600000) {
topics.increaseViewCount(tid);
req.session.tids_viewed[tid] = Date.now();
}
if (req.uid) {
topics.markAsRead([tid], req.uid, function(err, markedRead) {

Loading…
Cancel
Save