########################
sub table {
if ($caption_file ne "") {
open(CAPS,"$caption_file");
while (<CAPS>) {
chop;
($key,$value) = split(/:/);
$photos{$key} = $value;
}
close(CAPS);
foreach (sort keys %photos) {
push (@tnlist,$_);
push (@captions,$photos{$_});
}
}
else {
opendir (TN, "$tn_dir");
rewinddir (TN);
@tnlist = grep(!/^\.\.?$/, readdir (TN));
closedir (TN);
$temp = pop @tnlist;
@tntemp = reverse(@tnlist);
push (@tntemp,$temp);
@tnlist = reverse(@tntemp);
}
$tnnum = @tnlist;
$anum = int ($tnnum / 3);
$bnum = ((($tnnum / 3) - $anum) * 3);
print "Content-type: text/html\n\n";
print "<html><head><title>$title</title></head>\n";
print "<body bgcolor=$bgcolor>\n";
print "$header\n";
if ($bnum eq "0") {
&main_table;
&end;
}
if ($bnum eq "1") {
&main_table;
print "<hr><table width=100% border=5 cellpadding=3>\n";
print "<tr align=center>\n";
print "<td width=33%></td>\n";
print "<td width=33%><img src=\"$tn_dir_url/$tnlist[($anum * 3)]\"><br>$captions[($anum * 3)]<br></td>\n";
print "<td width=33%></td>\n";
print "</tr></table><hr>\n";
}
if ($bnum eq "2") {
&main_table;
print "<hr><table width=100% border=5 cellpadding=3>\n";
print "<tr align=center>\n";
print "<td width=33%><img src=\"$tn_dir_url/$tnlist[($anum * 3)]\"><br>$captions[($anum * 3)]<br></td>\n";
print "<td width=34%></td>\n";
print "<td width=33%><img src=\"$tn_dir_url/$tnlist[($anum * 3) + 1]\"><br>$captions[($anum * 3) + 1]<br></td>\n";
print "</tr></table><hr>\n";
}
print "$footer\n";
print "</body></html>\n";
}
sub main_table {
$dnum = ($anum * 3);
$cnum = "0";
while ($dnum > $cnum) {
print "<hr><table width=100% border=5 cellpadding=3>\n";
print "<tr align=center>\n";
print "<td width=33%><img src=\"$tn_dir_url/$tnlist[$cnum]\"><br>$captions[$cnum]<br></td>\n";
print "<td width=33%><img src=\"$tn_dir_url/$tnlist[$cnum + 1]\"><br>$captions[$cnum + 1]<br></td>\n";
print "<td width=33%><img src=\"$tn_dir_url/$tnlist[$cnum + 2]\"><br>$captions[$cnum + 2]<br></td>\n";
print "</tr></table>\n";
$cnum = $cnum + 3;
print "<hr>\n";
}
}
#################################
I see where there's 3 columns w/ 33% width, but don't think deleting just one of those lines would work. I'll probably screw up the script, so I figured I'd check with you all first! Thanks so much!
Ramsey