| Theme |
Download |
Notes |
Creator |
<:
$ALBUM = "/WWW/web/MarginalHacks.com/Hacks/album";
$THEMES = "$ALBUM/Themes";
$THEMES_URL = "Themes";
$CREDIT = "CREDIT";
$TAR = ".tar.gz";
$ZIP = ".zip";
$EXAMPLE = "/WWW/web/DavePics.com/Examples";
$EXAMPLE_URL = "http://DavePics.com/Examples";
opendir(DIR,$THEMES) || die("Couldn't opendir $THEMES\n");
my @themes = grep(!/^\.\.?$/, readdir(DIR));
closedir(DIR);
@themes = sort grep(-d "$THEMES/$_" && -f "$THEMES/$_/album.th", @themes);
sub safe_url {
my ($url) = @_;
$url =~ s|mailto:(.+)\@(.+)|mailto:$1 -AT- NOSPAM$2|g;
$url =~ s|(href=['"])(?=http)|$1/redir.cgi?|g;
$url =~ s|(href=)([^'"])|$1/redir.cgi?$2|g;
$url;
}
foreach my $theme ( @themes ) {
print " \n";
# Theme
my $prth = $theme; $prth =~ s/_/ /g;
my $ex = (-f "$EXAMPLE/$theme.html") ? 1 : 0;
print " | \n";
# No need to give g-juice to these pages..
print " \n" if ($ex);
print " $prth\n";
print " \n" if ($ex);
print " | \n";
# Download
print " \n";
print " \n";
print " dir,\n";
print " tar,\n" if (-f "$THEMES/$theme$TAR");
print " zip\n" if (-f "$THEMES/$theme$ZIP");
print " \n";
print " | \n";
my ($notes,$author,@junk);
if (open(CREDIT,"<$THEMES/$theme/$CREDIT")) {
($notes,$author,@junk) = ;
close CREDIT;
}
$author = safe_url($author);
$notes = safe_url($notes);
# Notes
print " \n";
print " $notes\n";
print " | \n";
# Creator
print " \n";
print " $author\n";
print " | \n";
print " \n";
}
:>
|