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 >
Text File  |  1999-02-12  |  3KB  |  75 lines

  1. #!/usr/bin/perl
  2. $discus_conf = '/usr/local/www/www.hirez.org/discus_admin_149349189/discus.conf';
  3. #Discus board image lister script
  4. #-------------------------------------------------------------------------------
  5. # This script is copyright (c) 1998 by DiscusWare, LLC, all rights reserved.
  6. # Its use is subject to the license agreement that can be found at the following
  7. # URL:  http://www.chem.hope.edu/discus/license
  8. #-------------------------------------------------------------------------------
  9. if (open (FILE, "$discus_conf")) {
  10.     @file = <FILE>;
  11.     close (FILE);
  12.     $evals = "";
  13.     foreach $line (@file) {
  14.         if ($line =~ /^(\w+)=(.*)/) {
  15.             $varname = $1;
  16.             $value = $2;
  17.             $value =~ s/'/\\'/g; $value =~ s/\r//g;
  18.             $evals .= "\$$varname='$value'; ";
  19.         }
  20.     }
  21.     eval($evals);
  22.     require "$admin_dir/source/src-board-subs-common";
  23. } else {
  24.     print "Content-type: text/html\n\n";
  25.     print "<HTML><HEAD><TITLE>Script Execution Error</TITLE></HEAD>\n";
  26.     print "<BODY BGCOLOR=#ffffff TEXT=#000000>\n";
  27.     print "<H1>Script Execution Error</H1>\n";
  28.     print "Discus scripts could not execute because the discus.conf file\n";
  29.     print "could not be opened.";
  30.     print "<P>Reason: <FONT COLOR=#ff0000><B>$!</B></FONT>" if $!;
  31.     print "<P>This generally indicates a setup error of some kind.\n";
  32.     print "Consult the <A HREF=\"http://www.chem.hope.edu/discus/rc\">Discus ";
  33.     print "Resource Center</A> for troubleshooting information.</BODY></HTML>\n";
  34.     exit(0);
  35. }
  36. $titlej = $title;
  37. $titlej =~ s/['"<>]//g; #Not friendly characters for our JavaScript!
  38. $acceptable_images = 'gif';
  39. $image_directory = "$html_dir/clipart";
  40. $image_url = "$html_url/clipart";
  41. &header;
  42. &ex('printuntil', 1, 1, 0, "$L{ILTITLE}");
  43. ($bgcolor, $text, $link, $vlink, $alink, $font, $size, $img) = &ex('extract_colorsonly', 1);
  44. print "<CENTER><FONT SIZE=+1><B>$L{ILTITLE}</B></FONT></CENTER>\n";
  45. print "<HR>\n";
  46. print "$L{ILINSTR}\n";
  47. print "<P>\n";
  48. print "<P><TABLE BORDER=1>\n";
  49. print "<TR><TD><B><FONT FACE=\"$face\">$L{ILTAG}</FONT></B></TD><TD><B><FONT FACE=\"$face\">$L{ILIMAGE}</FONT></B></TD></TR>\n";
  50. undef @files;
  51. opendir(IMAGES, "$html_dir/clipart");
  52. while ($name = readdir(IMAGES)) {
  53.     push (@files, $name) if $name =~ /$acceptable_images/;
  54. }
  55. closedir(IMAGES);
  56. foreach $file (sort(@files)) {
  57.     $_ = $file;
  58.     /\/?([^\/]*$)/;
  59.     $_ = $1;
  60.     $filename = $_;
  61.     /(.*)\.(.*)/;
  62.     $name = $1;
  63.     $type = $2;
  64.     if ($type =~ $acceptable_images && $filename !~ /your_image.gif/ && $filename !~ /board_logo.gif/ && $filename !~ /poweredby.gif/) {
  65.         print "<TR>";
  66.         print "<TD><FONT FACE=\"$face\" SIZE=\"$size\"><B>\", $L{ILCLIPTAG}, "{</B>$name<B>}</B></FONT></TD>";
  67.         print "<TD><IMG SRC=\"$image_url/$filename\"></TD></TR>\n";
  68.     }
  69. }
  70. print "</TABLE>\n";
  71. print "<HR><CENTER><A HREF=\"javascript:history.back()\">$L{ILBACK}";
  72. print "</A></CENTER><P>\n\n";
  73. &ex('printuntil', 3, 17, 0, "", 0, 1);
  74. exit(0);
  75.