my $type = $c->stash('type');
# check parameter
- my $page_num = $c->param('page') || 0;
+ my $page_num = $c->param('page') || 1;
my $config = $c->app->config("Timeline") || {};
my $limit = $config->{item_per_page} || 10;
- my $offset = $limit * $page_num;
+ my $offset = $limit * ($page_num - 1);
my $show_future = $user->{is_admin} ? 1 : 0;
my $show_nonpublic = $user->{is_admin} ? 1 : 0;
- if ($type && !any { $_ eq $type } qw(story journal submission)) {
- $c->rendered(400);
+ if ($page_num < 1 || $type && !any { $_ eq $type } qw(story journal submission)) {
+ $c->rendered(404);
return;
}
my $page = { type => "tag",
tag_name => $topic_name,
+ tag_keyword => $topics->[0]->{keyword},
content_type => $type,
number => $page_num,
has_prev => @$items > $limit,