Gossamer Forum
Home : Products : Gossamer Forum : Discussion :

Using a CSS script

Quote Reply
Using a CSS script
I would like to add the following to GF:

Code:
sub serve_css {
my ($usage) = @_;
$site = "site URL";
$path = "css";
$browser = "$ENV{'HTTP_USER_AGENT'}";
$browser =~ tr/A-Z/a-z/;
if ($browser =~ /win/ && $browser =~ /msie/) { $css_file = "ie.css"; }
elsif ($browser =~ /win/ && $browser =~ /mozilla/) { $css_file = "nav.css"; }
elsif ($browser =~ /mac/) { $css_file = "mac.css"; }
else { $css_file = "unix.css"; }
$css_serve_code_line .= "<!-- Browser detected: $browser -->\n";
$css_serve_code_line .= "<link rel=\"stylesheet\" href=\"$site/$path/$css_file\" type=\"text/css\">\n";
$css_serve_code_line .= "<style type=\"text/css\">\n";
$css_serve_code_line .= "<!--\n";
$css_serve_code_line .= "a:link { color: #3366CC; text-decoration: none; }\n";
$css_serve_code_line .= "a:visited { color: #3366CC; text-decoration: none; }\n";
$css_serve_code_line .= "a:hover { color: #AC9431; text-decoration: underline; }\n";
$css_serve_code_line .= "-->\n";
$css_serve_code_line .= "</style>\n";
if ($usage eq "") {
print "Content-type: text/html\n\n";
print "$css_serve_code_line";
exit;
}
else { return $css_serve_code_line; }
}

How can be added to the globals, so the sub will execute?

Thanks in advance...

--
David
Subject Author Views Date
Thread; hot thread Using a CSS script unixman 6079 Apr 21, 2002, 6:19 PM
Thread; hot thread Re: [unixman] Using a CSS script
Alex 5978 Apr 21, 2002, 7:08 PM
Thread; hot thread Re: [Alex] Using a CSS script
unixman 5947 Apr 21, 2002, 7:24 PM
Thread; hot thread Re: [unixman] Using a CSS script
Alex 5943 Apr 21, 2002, 7:25 PM
Thread; hot thread Re: [Alex] Using a CSS script
unixman 5948 Apr 21, 2002, 7:43 PM
Thread; hot thread Re: [unixman] Using a CSS script
Paul 5987 Apr 22, 2002, 1:43 AM
Thread; hot thread Re: [Paul] Using a CSS script
unixman 5934 Apr 22, 2002, 5:42 AM
Thread; hot thread Re: [unixman] Using a CSS script
Wil 5986 Apr 22, 2002, 6:05 AM
Thread; hot thread Re: [Wil] Using a CSS script
unixman 5956 Apr 22, 2002, 6:50 AM
Thread; hot thread Re: [unixman] Using a CSS script
Wil 6048 Apr 22, 2002, 6:53 AM
Thread; hot thread Re: [Wil] Using a CSS script
unixman 5983 Apr 22, 2002, 6:54 AM
Thread; hot thread Re: [unixman] Using a CSS script
Wil 5998 Apr 22, 2002, 6:58 AM
Thread; hot thread Re: [Wil] Using a CSS script
unixman 6006 Apr 22, 2002, 7:03 AM
Post; hot thread Re: [unixman] Using a CSS script
Wil 5948 Apr 22, 2002, 7:04 AM
Post; hot thread Re: [unixman] Using a CSS script
unixman 5957 Apr 22, 2002, 7:20 AM
Thread; hot thread Re: [Wil] Using a CSS script
Paul 6006 Apr 22, 2002, 7:05 AM
Thread; hot thread Re: [Paul] Using a CSS script
unixman 5978 Apr 22, 2002, 7:09 AM
Thread; hot thread Re: [unixman] Using a CSS script
Wil 5984 Apr 22, 2002, 7:14 AM
Post; hot thread Re: [Wil] Using a CSS script
unixman 5954 Apr 22, 2002, 7:17 AM
Thread; hot thread Re: [Wil] Using a CSS script
Paul 5919 Apr 22, 2002, 7:24 AM
Thread; hot thread Re: [Paul] Using a CSS script
unixman 5957 Apr 22, 2002, 7:27 AM
Post; hot thread Re: [unixman] Using a CSS script
Paul 5901 Apr 22, 2002, 7:31 AM
Thread; hot thread Re: [Paul] Using a CSS script
Wil 5926 Apr 22, 2002, 7:35 AM
Thread; hot thread Re: [Wil] Using a CSS script
Paul 1214 Apr 22, 2002, 7:41 AM
Thread; hot thread Re: [Paul] Using a CSS script
Jagerman 1194 Apr 22, 2002, 12:22 PM
Post; hot thread Re: [Jagerman] Using a CSS script
Wil 1164 Apr 22, 2002, 12:23 PM
Thread; hot thread Re: [Paul] Using a CSS script
Wil 5942 Apr 22, 2002, 7:10 AM
Post; hot thread Re: [Wil] Using a CSS script
unixman 5931 Apr 22, 2002, 7:13 AM