mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-12 08:55:47 +01:00
shortened the user postcount update code
This commit is contained in:
@@ -270,16 +270,9 @@ define(['forum/pagination', 'forum/topic/threadTools', 'forum/topic/postTools'],
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
var posts = data.posts;
|
for (var i=0; i<data.posts.length; ++i) {
|
||||||
for (var p in posts) {
|
var postcount = $('.user_postcount_' + data.posts[i].uid);
|
||||||
if (posts.hasOwnProperty(p)) {
|
postcount.html(parseInt(postcount.html(), 10) + 1);
|
||||||
var post = posts[p],
|
|
||||||
postcount = $('.user_postcount_' + post.uid),
|
|
||||||
ptotal = parseInt(postcount.html(), 10);
|
|
||||||
|
|
||||||
ptotal += 1;
|
|
||||||
postcount.html(ptotal);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
socket.emit('topics.markAsRead', {tid: tid, uid: app.uid});
|
socket.emit('topics.markAsRead', {tid: tid, uid: app.uid});
|
||||||
|
|||||||
Reference in New Issue
Block a user