Skip to content

Commit 388f654

Browse files
committed
fix announment page count and page link
1 parent 4250d5d commit 388f654

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

controllers/announcement.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,8 @@ exports.index = function (req, res, next) {
5858
tops: tops,
5959
no_reply_topics: no_reply_topics,
6060
pages: pages,
61-
keyword: keyword
61+
keyword: keyword,
62+
base:req.path
6263
});
6364
};
6465

@@ -125,7 +126,7 @@ exports.index = function (req, res, next) {
125126
});
126127

127128
// 計算頁數
128-
topic_ctrl.get_count_by_query(query, function (err, all_topics_count) {
129+
topic_ctrl.get_announcements_count_by_query(query, function (err, all_topics_count) {
129130
if (err) {
130131
return proxy.emit('error', err);
131132
}

controllers/site.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,8 @@ exports.index = function (req, res, next) {
6666
no_reply_topics: no_reply_topics,
6767
pages: pages,
6868
announcement: announcements[0],
69-
keyword: keyword
69+
keyword: keyword,
70+
base:req.path
7071
});
7172
};
7273

views/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
topics: topics,
2727
pages: pages,
2828
current_pages: current_page,
29-
base: keyword ? ('/?q=' + keyword) : '/'
29+
base: keyword ? ( base +'?q=' + keyword ) : base
3030
}) %>
3131
<% } else { %>
3232
<div class='inner'>

0 commit comments

Comments
 (0)