Skip to content

Node.js based forum software built for the modern web

C:/Program Files (x86)/Git/recent shows only the last 24 hours

Baris Soner Usakli3f8b3894d86d
diff --git a/public/templates/account.tpl b/public/templates/account.tpl
index bb471baa57..e6b98690bb 100644
--- a/public/templates/account.tpl
+++ b/public/templates/account.tpl
@@ -3,7 +3,7 @@
- <div class="account-username-box">
+ <div class="account-username-box">
<span class="account-username">
<a href="/users/{userslug}">{username}</a>
</span>
diff --git a/src/categories.js b/src/categories.js
index ea4b4ec01d..64a1afac71 100644
--- a/src/categories.js
+++ b/src/categories.js
@@ -99,7 +99,11 @@ var RDB = require('./redis.js'),
// not the permanent location for this function
Categories.getLatestTopics = function(current_user, start, end, callback) {
- RDB.zrevrange('topics:recent', 0, -1, function(err, tids) {
+
+ var args = [ 'topics:recent', '+inf', Date.now() - 86400000];
+
+ RDB.zrevrangebyscore(args, function(err, tids) {
+
var latestTopics = {
'category_name' : 'Recent',
'show_sidebar' : 'hidden',
@@ -110,7 +114,7 @@ var RDB = require('./redis.js'),
'topics' : []
};
- if (!tids.length) {
+ if (!tids || !tids.length) {
callback(latestTopics);
return;
}