diff --git a/public/templates/search.tpl b/public/templates/search.tpl
index 3aae132913..30e8995925 100644
--- a/public/templates/search.tpl
+++ b/public/templates/search.tpl
@@ -14,7 +14,7 @@
-
+
Topics
No topics found!
diff --git a/src/posts.js b/src/posts.js
index dee76c0474..e2ab4fc69c 100644
--- a/src/posts.js
+++ b/src/posts.js
@@ -70,7 +70,7 @@ var RDB = require('./redis.js'),
Posts.getPostFields(pid, ['pid', 'tid', 'content', 'uid', 'timestamp', 'deleted'], function(postData) {
if (postData.deleted === '1') return callback(null);
else {
- postData.relativeTime = new Date(parseInt(postData.timestamp, 10)).toISOString();
+ postData.relativeTime = new Date(parseInt(postData.timestamp || 0, 10)).toISOString();
next(null, postData);
}
});
diff --git a/src/routes/api.js b/src/routes/api.js
index d7b7bd9acc..b09378c8ad 100644
--- a/src/routes/api.js
+++ b/src/routes/api.js
@@ -186,6 +186,7 @@ var user = require('./../user.js'),
return res.json({
show_no_topics: 'hide',
show_no_posts: 'hide',
+ show_results: 'hide',
search_query: '',
posts: [],
topics: []
@@ -235,6 +236,7 @@ var user = require('./../user.js'),
return res.json({
show_no_topics: results[1].length ? 'hide' : '',
show_no_posts: results[0].length ? 'hide' : '',
+ show_results: '',
search_query: req.params.term,
posts: results[0],
topics: results[1]