# Generic configuration file for UCW::Gallery use common::sense; use UCW::Gallery; use Cwd; our $base_dir; our $gallery; our $static_dir; our $lib_dir; BEGIN { my $current_dir = getcwd; if (($base_dir, $gallery) = $current_dir =~ m{(.*)/lib/photos/(.*)}) { # We are called from the generated web tree $static_dir = "$base_dir/static"; $lib_dir = "$base_dir/lib"; } elsif (($base_dir, $gallery) = $current_dir =~ m{(.*/web)/photos/(.*)}) { # We are called from the source tree $static_dir = "$base_dir/static"; # Expecting symlink to static $lib_dir = $base_dir; } else { die "photos/default.cf: Please call me from the right directory\n"; } } use lib "$lib_dir/perl"; my $gal = UCW::Gallery->new(); $gal->set( OrigDir => '/home/mj/photos', PhotoDir => "$static_dir/gallery/photo/$gallery", CacheDir => "$static_dir/gallery/cache/$gallery", CacheExif => 1, PhotoUrlPrefix => 'photo/', # Rewritten by mod_rewrite later ThumbUrlPrefix => 'thumb/', ThemeUrlPrefix => '/gal/', ParentURL => '/photos/', WebHeadExtras => "\n", WebBotExtras => sub ($) { my ($self) = @_; return "" if $self->showing_image; my $ziplink = "

The whole gallery can be also "; return <


$ziplink
AMEN }, ); return $gal;