#!/usr/bin/perl $discus_conf = '/usr/local/www/www.acheron.org/discus_admin_116439176/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 = ; 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 "Script Execution Error\n"; print "\n"; print "

Script Execution Error

\n"; print "Discus scripts could not execute because the discus.conf file\n"; print "could not be opened."; print "

Reason: $!" if $!; print "

This generally indicates a setup error of some kind.\n"; print "Consult the Discus "; print "Resource Center for troubleshooting information.\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 "

$L{ILTITLE}
\n"; print "
\n"; print "$L{ILINSTR}\n"; print "

\n"; print "

\n"; print "\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 ""; print ""; print "\n"; } } print "
$L{ILTAG}$L{ILIMAGE}
\", $L{ILCLIPTAG}, "{$name}
\n"; print "


$L{ILBACK}"; print "

\n\n"; &ex('printuntil', 3, 17, 0, "", 0, 1); exit(0);