<: # Path setting - this is the path to the images my $level = num('parent_albums')-1; $PATH = Theme_URL(); $CSS = ""; my $album = Album_Filename(); my $path = $album; $path =~ s|[^/]+$||; $path = "." unless $path; sub listImages { my $pic = $_[0]; while ($pic) { print "

" . Get($pic, 'href', 'image') . Image($pic, 'thumb') . "

\n"; $pic = Next($pic); } } :> <: Meta() :> <:= Trans('Album:') :> <:= Path('album_name') :> <: if ($level == 0) { if ( my $dir = First('dirs') ) { print "\n"; } } else { print $CSS; } :>
<: if ($level == 1) { if ( my $dir = First('dirs') ) { :> <: while ($dir) { print "\n"; $dir = Next($dir); } :>
" . Get($dir, 'href', 'dir'); if (my $img = Image($dir, 'thumb')) { print $img; } print " 
"; print "
 " . Get($dir, 'name') . "
"; my $numPics = Get($dir, 'num_pics'); if ( $numPics > 0) { print "
 $numPics слика
"; } print "
<: } } if ( my $pic = First('pics') ) { my $thumbdir = Option('dir'); my $imgpath = Image(This_Image, 'medium'); $imgpath =~ s|src='|src='$thumbdir/|; :>
<: print "
" . $imgpath . "


"; :>
<: if (my $Prev = Prev($pic, $opt->{image_loop})) { _:> <: } _:> <: if (my $Next = Next(This_Image, $opt->{image_loop})) { _:> <: } _:>
<: my $picName = Get($Prev, 'name'); $prevLine = Get($Prev, 'href', 'album_page', 'image') . "
" . Trans('Prev') . "
"; $prevLine =~ s|html'|html#$picName'|; print $prevLine; :>
<: my $picName = Get($Next, 'name'); $nextLine = Get($Next, 'href', 'album_page', 'image') . "
" . Trans('Next') . "
"; $nextLine =~ s|html'|html#$picName'|; print $nextLine; :>
<: print "
" . Name(This_Image) . "

"; :>
<: } :>
<: if ( $level == 0 ) { if ( my $dir = First('dirs') ) { while ($dir) { my $dirName = Get($dir, 'name'); open(STDOUT, ">$path/$dirName.tmp") || die( "Can't write directory-specific index [$path/$dirName.tmp]\n"); my $dirInner = First('dirs'); while ( $dirInner ) { my $dirInnerName = Get($dirInner, 'name'); if ( $dirName == $dirInnerName ) { print "

" . $dirInnerName . "

\n"; } else { my $dirLink = Get($dirInner, 'cap'); if ( ! $dirLink ) { $dirLink = Get($dirInner, 'name'); } print "

" . $dirInnerName . "

\n"; } $dirInner = Next($dirInner); } close STDOUT; $dir = Next($dir); } } } # Spill all pictures as well if ( my $pic = First('pics') ) { open(STDOUT, ">$path/Pics.tmp") || die( "Can't write picture index [$path/Pics.tmp]\n"); while ( $pic ) { my $picName = Get($pic, 'name'); my $line = "

" . Get($pic, 'href', 'image') . Image($pic, 'thumb') . "

\n"; # To keep correct links and add anchor $line =~ s|href='|name='$picName' href='../|; $line =~ s|src='|src='../|; print $line; $pic = Next($pic); } close STDOUT; } :>