Wesley R. Elsberry
Posts: 4991 Joined: May 2002
|
Here's the code that generates the page links on the forum display page. I'm willing to experiment if someone wants to take a shot at code to also display the links to the final three pages when there are more than seven pages total.
Quote |
my $Pages = ($topic->{'TOPIC_POSTS'} + 1) / $iB::INFO->{'DISPLAY_MAX_POSTS'}; my ($Int, $Dec) = split /\./,$Pages; $Dec > 0 ? ($Pages = $Int + 1) : ($Pages = $Int); $Pages = 1 if $Pages < 1; if ($Pages > 1) { $topic->{'PAGES'} = qq[<span id="small">($Forum::lang->{topic_sp_pages} ]; my $i = 0; for(0 .. $Pages-1) { my $RealNo = $i * $iB::INFO->{'DISPLAY_MAX_POSTS'}; my $PageNo = $i + 1; if ($PageNo == 4) { $topic->{'PAGES'} .= qq[<a href='$iB::INFO->{'BOARD_URL'}/ikonboard.$iB::INFO->{'CG\ I_EXT'}?s=$iB::SESSION;act=ST;f=$iB::IN{'f'};t=$topic->{'TOPIC_ID'};st=] . ($Pages - 1) * $iB::INFO->{'DISPLAY_MAX_\ POSTS'} . qq['>..$Pages </a>]; last; } $topic->{'PAGES'} .= qq[<a href='$iB::INFO->{'BOARD_URL'}/ikonboard.$iB::INFO->{'CGI_EXT'}?s=$iB::SESSI\ ON;act=ST;f=$iB::IN{'f'};t=$topic->{'TOPIC_ID'};st=$RealNo'>$PageNo </a>]; ++$i; } $topic->{'PAGES'} .= qq[)</span>]; }
|
Note that for topics with 4 or more pages, it simply terminates with linking to the final page. That's what "last" does in Perl as a command.
-------------- "You can't teach an old dogma new tricks." - Dorothy Parker
|