#!/usr/bin/perl -w
# This script is part of the NoonQuilt project:
#
#
#
# © Ali Graham, 1998
#
# Start of makeQuilt.pl (Build the main quilt page)
# make sure this is syntactically clear...
use strict; use English;
# ...and running under Perl5...
require 5.001;
# ################ DEFAULT VARIABLES ##################
my %html_measure = (
# these set the values for building the quilt
'M_NumColumns' => 5,
'M_NumRows', => 7,
'M_NumIntCols' => 3,
'M_NumIntRows' => 3,
);
my @layout = (
1, 0, 0,
0, 2, 0,
0, 0, 3,
);
# (reversed every second block)
I probably could have come up with something more extensible than the
above scheme (and in fact I did try a number of different layout methods)
but I decided that brevity was probably more improtant in this case....
# #####################################################
# Start of main()
# include the external functions
my $path = "";
if ( $OSNAME =~ /^mswin/i ) {
$path = "d:\\Inetpub\\wwwroot\\quilt\\scripts\\";
chdir($path);
}
(I needed to add the above lines to the start of every script, otherwise
the Perl interpreter on Windows NT would not change to the directory the
scripts were running in -- this is inconsistent with the behaviour on Unix,
Amiga & Macintosh Perl, which did.)
(require $path."nq_config.pl") or (die "Can't open \"nq_config.pl\": $!\n");
(require $path."nq_dirstuff.pl") or (die "Can't open \"nq_dirstuff.pl\": $!\n");
(require $path."nq_mkpatch.pl") or (die "Can't open \"nq_mkpatch.pl\": $!\n");
# setup for quiltmaking...
my $script_defs = &nqco_getScriptDefaults;
my $html_defs = &nqco_getHTMLDefaults;
&statusHeader;
# get the list of files in the submissions directory
my @patch_files = sort( &nqds_getDirList($script_defs->{'S_PatchDir'}) );
# delete all of the files in the patch HTML directory
my @phtml_files = sort( &nqds_getDirList($script_defs->{'S_PatchHTMLDir'}) );
my $num_ph = $#phtml_files + 1;
foreach my $patch ( @phtml_files ) { unlink "$script_defs->{'S_PatchHTMLDir'}$patch"; }
print STDOUT "Deleted ( $num_ph ) patch HTML files",
" from ( $script_defs->{'S_PatchHTMLDir'} ).\n \n \n";
my $quilt_num = 1; my @patch_buffer;
until ( $#patch_files == -1 ) {
There are 105 patches per Quilt ([3 per cell] x [7 cells per row] x
[5 rows]) so we need to pass that many to the subroutine that makes the
quilt HTML - if there are less than 105 left, then all of them must be passed.
#split patch_files into 105-element sections
@patch_buffer = splice(@patch_files, 0, 105);
&nqmq_makeQuilt($quilt_num++, \@patch_buffer);
}
print STDOUT "makeQuilt.pl finished.\n";
print STDOUT "\n |