|
|
|
@ -25,7 +25,6 @@ var user = require('./../user.js'),
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
app.get('/users', function(req, res) {
|
|
|
|
@ -64,6 +63,15 @@ var user = require('./../user.js'),
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
app.get('/users/online', function(req, res) {
|
|
|
|
|
app.build_header({
|
|
|
|
|
req: req,
|
|
|
|
|
res: res
|
|
|
|
|
}, function(err, header) {
|
|
|
|
|
res.send(header + app.create_route("users/online", "users") + templates['footer']);
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
app.get('/users/search', function(req, res) {
|
|
|
|
|
app.build_header({
|
|
|
|
|
req: req,
|
|
|
|
@ -436,6 +444,7 @@ var user = require('./../user.js'),
|
|
|
|
|
app.get('/api/users/sort-posts', getUsersSortedByPosts);
|
|
|
|
|
app.get('/api/users/sort-reputation', getUsersSortedByReputation);
|
|
|
|
|
app.get('/api/users/latest', getUsersSortedByJoinDate);
|
|
|
|
|
app.get('/api/users/online', getOnlineUsers);
|
|
|
|
|
app.get('/api/users/search', getUsersForSearch);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -469,6 +478,16 @@ var user = require('./../user.js'),
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function getOnlineUsers(req, res) {
|
|
|
|
|
user.getUsers('users:online', 0, 49, function(err, data) {
|
|
|
|
|
res.json({
|
|
|
|
|
search_display: 'none',
|
|
|
|
|
loadmore_display: 'block',
|
|
|
|
|
users: data
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function getUsersForSearch(req, res) {
|
|
|
|
|
res.json({
|
|
|
|
|
search_display: 'block',
|
|
|
|
|