mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-01-24 00:09:41 +01:00
Merge branch 'master' of https://github.com/designcreateplay/NodeBB
This commit is contained in:
@@ -101,69 +101,87 @@
|
||||
|
||||
@-webkit-keyframes scroll-2 /* Safari and Chrome */
|
||||
{
|
||||
0% {top: 0px;}
|
||||
25% {top: -90px;}
|
||||
50% {top: -180px;}
|
||||
75% {top: -270px;}
|
||||
0% {top: 0px;}
|
||||
3% {top:-90px;}
|
||||
25% {top: -90px;}
|
||||
28% {top:-180px;}
|
||||
50% {top: -180px;}
|
||||
53% {top: -270px;};
|
||||
75% {top: -270px;}
|
||||
78% {top: -360px;}
|
||||
100% {top: -360px;}
|
||||
}
|
||||
|
||||
@keyframes scroll-2
|
||||
{
|
||||
0% {top: 0px;}
|
||||
25% {top: -90px;}
|
||||
50% {top: -180px;}
|
||||
75% {top: -270px;}
|
||||
0% {top: 0px;}
|
||||
3% {top:-90px;}
|
||||
25% {top: -90px;}
|
||||
28% {top:-180px;}
|
||||
50% {top: -180px;}
|
||||
53% {top: -270px;};
|
||||
75% {top: -270px;}
|
||||
78% {top: -360px;}
|
||||
100% {top: -360px;}
|
||||
}
|
||||
|
||||
@-webkit-keyframes scroll-1 /* Safari and Chrome */
|
||||
{
|
||||
0% {top: 0px;}
|
||||
33% {top: -90px;}
|
||||
66% {top: -180px;}
|
||||
100% {top: -270px;}
|
||||
0% {top: 0px;}
|
||||
3% {top:-90px;}
|
||||
33% {top: -90px;}
|
||||
36% {top: -180px;}
|
||||
66% {top: -180px;}
|
||||
69% {top: -270px;}
|
||||
100% {top: -270px;}
|
||||
}
|
||||
|
||||
@keyframes scroll-1
|
||||
{
|
||||
0% {top: 0px;}
|
||||
33% {top: -90px;}
|
||||
66% {top: -180px;}
|
||||
100% {top: -270px;}
|
||||
0% {top: 0px;}
|
||||
3% {top:-90px;}
|
||||
33% {top: -90px;}
|
||||
36% {top: -180px;}
|
||||
66% {top: -180px;}
|
||||
69% {top: -270px;}
|
||||
100% {top: -270px;}
|
||||
}
|
||||
|
||||
@-webkit-keyframes scroll-0 /* Safari and Chrome */
|
||||
{
|
||||
0% {top: 0px;}
|
||||
50% {top: -90px;}
|
||||
100% {top: -180px;}
|
||||
0% {top: 0px;}
|
||||
3% {top:-90px;}
|
||||
50% {top: -90px;}
|
||||
53% {top: -180px;}
|
||||
100% {top: -180px;}
|
||||
}
|
||||
|
||||
@keyframes scroll-0
|
||||
{
|
||||
0% {top: 0px;}
|
||||
50% {top: -90px;}
|
||||
100% {top: -180px;}
|
||||
0% {top: 0px;}
|
||||
3% {top:-90px;}
|
||||
50% {top: -90px;}
|
||||
53% {top: -180px;}
|
||||
100% {top: -180px;}
|
||||
}
|
||||
|
||||
.category-slider-2:hover {
|
||||
position:relative;
|
||||
|
||||
-webkit-animation: scroll-2 10s ease 0.5s infinite normal;
|
||||
animation: scroll-2 10s ease 0.5s infinite normal;/* Safari and Chrome: */
|
||||
-webkit-animation: scroll-2 10s ease-in 0.5s infinite normal;
|
||||
animation: scroll-2 10s ease-in 0.5s infinite normal;/* Safari and Chrome: */
|
||||
}
|
||||
|
||||
.category-slider-1:hover {
|
||||
position:relative;
|
||||
|
||||
-webkit-animation: scroll-1 8s ease 0.5s infinite normal;
|
||||
animation: scroll-1 8s ease 0.5s infinite normal;/* Safari and Chrome: */
|
||||
-webkit-animation: scroll-1 8s ease-in 0.5s infinite normal;
|
||||
animation: scroll-1 8s ease-in 0.5s infinite normal;/* Safari and Chrome: */
|
||||
}
|
||||
|
||||
.category-slider-0:hover {
|
||||
position:relative;
|
||||
|
||||
-webkit-animation: scroll-0 6s ease 0.5s infinite normal;
|
||||
animation: scroll-0 6s ease 0.5s infinite normal;/* Safari and Chrome: */
|
||||
-webkit-animation: scroll-0 6s ease-in 0.5s infinite normal;
|
||||
animation: scroll-0 6s ease-in 0.5s infinite normal;/* Safari and Chrome: */
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<div>
|
||||
|
||||
<ul class="nav nav-pills">
|
||||
<li class='active'><a href='/users-latest'>Latest Users</a></li>
|
||||
<li class=''><a href='/users-latest'>Latest Users</a></li>
|
||||
<li class=''><a href='/users-sort-posts'>Top Posters</a></li>
|
||||
<li class=''><a href='/users-sort-reputation'>Most Reputation</a></li>
|
||||
<li class=''><a href='/users-search'>Search</a></li>
|
||||
|
||||
46
src/user.js
46
src/user.js
@@ -7,7 +7,8 @@ var utils = require('./../public/src/utils.js'),
|
||||
bcrypt = require('bcrypt'),
|
||||
notifications = require('./notifications.js'),
|
||||
topics = require('./topics.js'),
|
||||
async = require('async');
|
||||
async = require('async'),
|
||||
userSearch = require('reds').createSearch('nodebbusersearch');
|
||||
|
||||
(function(User) {
|
||||
User.create = function(username, password, email, callback) {
|
||||
@@ -90,6 +91,8 @@ var utils = require('./../public/src/utils.js'),
|
||||
RDB.zadd('users:postcount', 0, uid);
|
||||
RDB.zadd('users:reputation', 0, uid);
|
||||
|
||||
userSearch.index(username, uid);
|
||||
|
||||
io.sockets.emit('user.latest', {userslug: userslug, username: username});
|
||||
|
||||
if (password !== undefined) {
|
||||
@@ -385,25 +388,42 @@ var utils = require('./../public/src/utils.js'),
|
||||
});
|
||||
}
|
||||
|
||||
User.reIndexAll = function(callback) {
|
||||
User.getUsers('users:joindate', 0, -1, function(err, usersData) {
|
||||
if(err) {
|
||||
return callback(err, null);
|
||||
}
|
||||
|
||||
function reIndexUser(uid, username) {
|
||||
userSearch.remove(uid, function(){
|
||||
userSearch.index(username, uid);
|
||||
})
|
||||
}
|
||||
|
||||
for(var i=0; i<usersData.length; ++i) {
|
||||
reIndexUser(usersData[i].uid, usersData[i].username);
|
||||
}
|
||||
callback(null, 1);
|
||||
});
|
||||
}
|
||||
|
||||
User.search = function(username, callback) {
|
||||
if(!username) {
|
||||
callback([]);
|
||||
return;
|
||||
}
|
||||
|
||||
RDB.keys('username:*'+ username + '*:uid', function(err, keys) {
|
||||
if(!err) {
|
||||
if(keys && keys.length) {
|
||||
RDB.mget(keys, function(err, uids) {
|
||||
User.getDataForUsers(uids, function(userdata) {
|
||||
callback(userdata);
|
||||
});
|
||||
});
|
||||
} else {
|
||||
callback([]);
|
||||
}
|
||||
} else {
|
||||
userSearch.query(query = username).type('or').end(function(err, uids) {
|
||||
if(err) {
|
||||
console.log(err);
|
||||
return;
|
||||
}
|
||||
if(uids && uids.length) {
|
||||
User.getDataForUsers(uids, function(userdata) {
|
||||
callback(userdata);
|
||||
});
|
||||
} else {
|
||||
callback([]);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -403,10 +403,16 @@ var express = require('express'),
|
||||
app.get('/reindex', function(req, res) {
|
||||
topics.reIndexAll(function(err) {
|
||||
if(err) {
|
||||
res.json(err);
|
||||
} else {
|
||||
res.send('All topics reindexed');
|
||||
return res.json(err);
|
||||
}
|
||||
|
||||
user.reIndexAll(function(err) {
|
||||
if(err) {
|
||||
return res.json(err);
|
||||
} else {
|
||||
res.send('Topics and users reindexed');
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user