diff options
| author | unknown <andrew@.cern.ch> | 2011-06-21 16:33:26 +0200 |
|---|---|---|
| committer | unknown <andrew@.cern.ch> | 2011-06-21 16:33:26 +0200 |
| commit | fa170afd817648f306e322802ca85b6abbd37f74 (patch) | |
| tree | 44a68e68859429bc5f6bcb164111bcb8df1ee165 /cgi-bin/news.plx | |
Initial commit
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; |
