RSS 2.0 Feed

» Welcome Guest Log In :: Register

Pages: (39) < [1] 2 3 4 5 6 ... >   
  Topic: Board Mechanics< Next Oldest | Next Newest >  
Henry J



Posts: 4079
Joined: Mar. 2005

(Permalink) Posted: May 13 2006,17:35   

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

  
  1144 replies since Oct. 19 2005,12:45 < Next Oldest | Next Newest >  

Pages: (39) < [1] 2 3 4 5 6 ... >   


Track this topic Email this topic Print this topic

[ Read the Board Rules ] | [Useful Links] | [Evolving Designs]