summaryrefslogtreecommitdiff
path: root/lib/VNDB
diff options
context:
space:
mode:
authorYorhel <git@yorhel.nl>2019-12-01 13:59:06 +0100
committerYorhel <git@yorhel.nl>2019-12-01 13:59:09 +0100
commite69504ae68f4d37bae69919aaee484aee3c0aa84 (patch)
tree3fb33117916cb7c97d376e70662c1a371cd4ac9f /lib/VNDB
parent165b62acc991cbf30cb721af27b04a066dbc9413 (diff)
Discussions: Do not highlight post when nagivating to the "last post"
That behavior was more distracting, especially when the intention of the link isn't to link to that post in particular, but just to the more recent part of the thread. As an additional advantage, this doesn't rely on the t#.# redirect anymore, this making browsing the forums slightly faster.
Diffstat (limited to 'lib/VNDB')
-rw-r--r--lib/VNDB/Handler/Discussions.pm2
-rw-r--r--lib/VNDB/Handler/Misc.pm2
2 files changed, 2 insertions, 2 deletions
diff --git a/lib/VNDB/Handler/Discussions.pm b/lib/VNDB/Handler/Discussions.pm
index aa15f360..b10e7aaf 100644
--- a/lib/VNDB/Handler/Discussions.pm
+++ b/lib/VNDB/Handler/Discussions.pm
@@ -159,7 +159,7 @@ sub edit {
$self->dbPostEdit($tid, $num, %post) if $num;
$nnum = $self->dbPostAdd($ntid, %post) if !$num;
- return $self->resRedirect("/t$ntid".($nnum > 25 ? '/'.ceil($nnum/25) : '').'#'.$nnum, 'post');
+ return $self->resRedirect(VNWeb::Discussions::Lib::post_url($ntid, $nnum, 'last'), 'post');
}
}
diff --git a/lib/VNDB/Handler/Misc.pm b/lib/VNDB/Handler/Misc.pm
index 76663601..25d10c39 100644
--- a/lib/VNDB/Handler/Misc.pm
+++ b/lib/VNDB/Handler/Misc.pm
@@ -122,7 +122,7 @@ sub homepage {
my $boards = join ', ', map $BOARD_TYPE{$_->{type}}{txt}.($_->{iid}?' > '.$_->{title}:''), @{$_->{boards}};
li;
txt fmtage($_->{lastpost_date}).' ';
- a href => "/t$_->{id}.$_->{count}", title => "Posted in $boards", shorten $_->{title}, 25;
+ a href => VNWeb::Discussions::Lib::post_url($_->{id}, $_->{count}, 'last'), title => "Posted in $boards", shorten $_->{title}, 25;
lit ' by ';
VNWeb::HTML::user_($_, 'lastpost_');
end;