summaryrefslogtreecommitdiff
path: root/cgi-bin/news.plx
blob: cf42681c40e3f3367669c869dc729b0ce953c3a9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
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."\">&nbsp;</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;