%args> $page_no=>1 %args>
<% $table %>
<%init> my @photos = sort { $rank_file{$b} <=> $rank_file{$a} } grep {$rank_file{$_} >= 0} keys %rank_file; $_ = $m->scomp('SELF:.prod_view',file=>$_,height=>$height) for @photos; my $allthumbs = []; push @{$allthumbs}, [ shift @photos ] while @photos; # $allthumbs is a ref to an array of array refs my $page_nos = 1; if ($rows > 0) { $page_nos= int( @$allthumbs / $rows ); $page_nos +=1 if $page_nos < @$allthumbs / $rows; } my @thumbs = splice @$allthumbs, $rows*($page_no-1), $rows; my $table = HTML::Table->new(-data => \@thumbs); $table->setClass('show-prod'); %init> %method> <%method .pager> <%args> $page_no $page_nos %args> ( % for ( 1 .. $page_nos) { % if ( $_ == $page_no) { <% $page_no %> % } else { <% $_ %> % } <% $_ != $page_nos ? "·" : "" %> % } ) <%init> return unless $page_nos > 1; %init> %method> <%method .prod_view> <%args> $file $height %args>|
%# pics are 650px but need to leave room for IE6 scrollbar; also need to add
%# extra pixel to height to remove scrollbar in Safari2
|