Henry J
Posts: 5786 Joined: Mar. 2005
|
This should work for the page link generation, if Perl follows rules similar to the languages I've used. It lists the page if page# is 1 or within 3 of the number of pages, and excludes any page#'s between those two ranges.
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 == 1) { $topic->{'PAGES'} .= qq[<ahref='$iB::INFO->{'BOARD_URL'}/ikonboard.$iB::INFO->{'CG\ I_EXT'}?s=$iB::SESSION;act=ST;f=$iB::IN{'f'};t=$topic->{'TOPIC_ID'};st=$RealNo'>$PageNo </a>]; } else if ($PageNo > $Pages-3) { $topic->{'PAGES'} .= qq[<ahref='$iB::INFO->{'BOARD_URL'}/ikonboard.$iB::INFO->{'CG\ I_EXT'}?s=$iB::SESSION;act=ST;f=$iB::IN{'f'};t=$topic->{'TOPIC_ID'};st=$RealNo'>$PageNo </a>]; } ++$i; } $topic->{'PAGES'} .= qq[)</span>]; }
|
Henry
|