diff options
Diffstat (limited to 'cgi-bin/news.plx')
| -rw-r--r-- | cgi-bin/news.plx | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/cgi-bin/news.plx b/cgi-bin/news.plx new file mode 100644 index 0000000..cf42681 --- /dev/null +++ b/cgi-bin/news.plx @@ -0,0 +1,47 @@ +#!c:/perl/bin/perl + +use CGI; +use strict; +use Globals; +use Globals qw($audioRocketman); +use Globals qw($videoRocketman); +use Globals qw($bgcolour); + +my $WEBPAGE; # Source for the webpage will be written here + +# get the template +# +$WEBPAGE = openTemplate("news"); + +# get news + +my $NEWS; +my $SHATNER; +if (open(NEWS, '../data/news.txt')) { + $SHATNER = <NEWS>; + while(<NEWS>) { + chomp; + if (/^\[*(.*)\]$/) { + $NEWS.="<p><b>".$1."</b><a name=\"".$1."\"> </a><br>\n"; + } + else { + $NEWS.=$_; + } + } +} + +# Put in what we know +# +$WEBPAGE =~ s/%AUDROCKET%/$audioRocketman/g; +$WEBPAGE =~ s/%VIDROCKET%/$videoRocketman/g; +$WEBPAGE =~ s/%SHATNER%/$SHATNER/g; +$WEBPAGE =~ s/%NEWS%/$NEWS/g; +$WEBPAGE =~ s/%BGCOLOUR%/$bgcolour/g; + +# Display the finished Web page +# +print $WEBPAGE; + +# Fin +# +exit; |
