";
}
sub html_header {
local ($title, $xhtml) = @_;
return short_html_header($title, $xhtml) . "diff --git a/en/cgi/cgi-style.pl b/en/cgi/cgi-style.pl index 0ac69c242b..62cb5dfbec 100644 --- a/en/cgi/cgi-style.pl +++ b/en/cgi/cgi-style.pl @@ -1,205 +1,213 @@ -# $FreeBSD: www/en/cgi/cgi-style.pl,v 1.23 2005/10/28 14:55:13 fenner Exp $ +# $FreeBSD: www/en/cgi/cgi-style.pl,v 1.24 2005/10/28 19:07:36 fenner Exp $ # # Perl routines to encapsulate various elements of HTML page style. # For future reference, when is now? ($se,$mn,$hr,$md,$mo,$yr,$wd,$yd,$dst) = localtime(time); $yr += 1900; $mo += 1; $timestamp = "$mo-$md-$yr"; if (!defined($hsty_base)) { - $hsty_base = '..'; + # $hsty_base should be relative if possible, so that mirrors + # serve their local copy instead of going to the main site. + # However, if we aren't running as a cgi, or if we're + # running on docs or people, use the absolute home path. + if (!defined($ENV{'HTTP_HOST'}) || $ENV{'HTTP_HOST'} =~ /(docs|people).freebsd.org/) { + $hsty_base = 'http://www.FreeBSD.org' + } else { + $hsty_base = '..'; + } } if (!defined($hsty_email)) { $hsty_email = 'www@FreeBSD.org'; } if (!defined($hsty_author)) { $hsty_author = "$hsty_email"; } if (!defined($hsty_date)) { $hsty_date = ''; } # This can be set to either a string containing an inline CSS stylesheet # or to a element that references an external CSS stylesheet, to # make local modifications to the style of a CGI script's output. $t_style = ""; # Don't allow script to override completely, just # let the script's setting cascade with the master. $i_topbar = qq`
";
}
sub html_header {
local ($title, $xhtml) = @_;
return short_html_header($title, $xhtml) . "