mirrored from git://git.rockbox.org/www.git
-
Notifications
You must be signed in to change notification settings - Fork 0
/
rockbox.pm
53 lines (44 loc) · 997 Bytes
/
rockbox.pm
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
48
49
50
51
52
53
push (@INC, "./");
require "builds.pm";
my $sitedir = "/home/rockbox/www";
sub playerpic {
my $m = shift @_;
my $p = $builds{$m}{icon} ?
"/playerpics/$builds{$m}{icon}-small.png" :
"/playerpics/$m-small.png";
if (-r "$sitedir/$p") {
return $p;
}
else {
return "/rockbox100.png";
}
}
sub header {
my ($t) = @_;
print "Content-Type: text/html\n\n";
open (HEAD, "$sitedir/head.html");
while(<HEAD>) {
$_ =~ s:^<title>Rockbox<\/title>:<title>$t<\/title>:;
$_ =~ s:^<h1>_PAGE_<\/h1>:<h1>$t<\/h1>:;
print $_;
}
close(HEAD);
}
sub header_b {
my ($t) = @_;
open (HEAD, "$sitedir/head.html");
while(<HEAD>) {
$_ =~ s:^<title>Rockbox<\/title>:<title>$t<\/title>:;
$_ =~ s:^<h1>_PAGE_<\/h1>:<h1>$t<\/h1>:;
print $_;
}
close(HEAD);
}
sub footer {
open (FOOT, "$sitedir/foot.html");
while(<FOOT>) {
print $_;
}
close(FOOT);
}
1;