home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.sunet.sepub/pictures
/
2014.11.ftp.sunet.se-pictures.tar
/
ftp.sunet.se
/
pub
/
pictures
/
ACiD-artpacks
/
www
/
mirrors
/
hirez
/
cgi-bin
/
discus
/
board-image-lister.cgi
< prev
next >
Wrap
Text File
|
1999-02-12
|
3KB
|
75 lines
#!/usr/bin/perl
$discus_conf = '/usr/local/www/www.hirez.org/discus_admin_149349189/discus.conf';
#Discus board image lister script
#-------------------------------------------------------------------------------
# This script is copyright (c) 1998 by DiscusWare, LLC, all rights reserved.
# Its use is subject to the license agreement that can be found at the following
# URL: http://www.chem.hope.edu/discus/license
#-------------------------------------------------------------------------------
if (open (FILE, "$discus_conf")) {
@file = <FILE>;
close (FILE);
$evals = "";
foreach $line (@file) {
if ($line =~ /^(\w+)=(.*)/) {
$varname = $1;
$value = $2;
$value =~ s/'/\\'/g; $value =~ s/\r//g;
$evals .= "\$$varname='$value'; ";
}
}
eval($evals);
require "$admin_dir/source/src-board-subs-common";
} else {
print "Content-type: text/html\n\n";
print "<HTML><HEAD><TITLE>Script Execution Error</TITLE></HEAD>\n";
print "<BODY BGCOLOR=#ffffff TEXT=#000000>\n";
print "<H1>Script Execution Error</H1>\n";
print "Discus scripts could not execute because the discus.conf file\n";
print "could not be opened.";
print "<P>Reason: <FONT COLOR=#ff0000><B>$!</B></FONT>" if $!;
print "<P>This generally indicates a setup error of some kind.\n";
print "Consult the <A HREF=\"http://www.chem.hope.edu/discus/rc\">Discus ";
print "Resource Center</A> for troubleshooting information.</BODY></HTML>\n";
exit(0);
}
$titlej = $title;
$titlej =~ s/['"<>]//g; #Not friendly characters for our JavaScript!
$acceptable_images = 'gif';
$image_directory = "$html_dir/clipart";
$image_url = "$html_url/clipart";
&header;
&ex('printuntil', 1, 1, 0, "$L{ILTITLE}");
($bgcolor, $text, $link, $vlink, $alink, $font, $size, $img) = &ex('extract_colorsonly', 1);
print "<CENTER><FONT SIZE=+1><B>$L{ILTITLE}</B></FONT></CENTER>\n";
print "<HR>\n";
print "$L{ILINSTR}\n";
print "<P>\n";
print "<P><TABLE BORDER=1>\n";
print "<TR><TD><B><FONT FACE=\"$face\">$L{ILTAG}</FONT></B></TD><TD><B><FONT FACE=\"$face\">$L{ILIMAGE}</FONT></B></TD></TR>\n";
undef @files;
opendir(IMAGES, "$html_dir/clipart");
while ($name = readdir(IMAGES)) {
push (@files, $name) if $name =~ /$acceptable_images/;
}
closedir(IMAGES);
foreach $file (sort(@files)) {
$_ = $file;
/\/?([^\/]*$)/;
$_ = $1;
$filename = $_;
/(.*)\.(.*)/;
$name = $1;
$type = $2;
if ($type =~ $acceptable_images && $filename !~ /your_image.gif/ && $filename !~ /board_logo.gif/ && $filename !~ /poweredby.gif/) {
print "<TR>";
print "<TD><FONT FACE=\"$face\" SIZE=\"$size\"><B>\", $L{ILCLIPTAG}, "{</B>$name<B>}</B></FONT></TD>";
print "<TD><IMG SRC=\"$image_url/$filename\"></TD></TR>\n";
}
}
print "</TABLE>\n";
print "<HR><CENTER><A HREF=\"javascript:history.back()\">$L{ILBACK}";
print "</A></CENTER><P>\n\n";
&ex('printuntil', 3, 17, 0, "", 0, 1);
exit(0);