aboutsummaryrefslogtreecommitdiff
path: root/index.cgi
diff options
context:
space:
mode:
authorBenjamin Kellermann <Benjamin.Kellermann@gmx.de>2008-11-17 19:00:30 +0100
committerBenjamin Kellermann <Benjamin.Kellermann@gmx.de>2008-11-17 19:00:30 +0100
commite75a34bc2c2454d582b44e71baf1cd9945a29d1b (patch)
tree312d4073a5a98cd04dcc602252975d13c669d868 /index.cgi
parent911b56477925248808aab2e8cd075faeeaefaf48 (diff)
fixed some bugs coming from last commit
Diffstat (limited to '')
-rwxr-xr-xindex.cgi17
1 files changed, 12 insertions, 5 deletions
diff --git a/index.cgi b/index.cgi
index f2b1423..04dcd57 100755
--- a/index.cgi
+++ b/index.cgi
@@ -9,12 +9,12 @@
require "yaml"
require "cgi"
-load "config.rb"
if __FILE__ == $0
$cgi = CGI.new
+
utfcookie = CGI::Cookie.new("utf", "true")
utfcookie.path = "/"
if ($cgi.include?("utf") || $cgi.cookies["utf"][0]) && !$cgi.include?("ascii")
@@ -47,21 +47,28 @@ else
YEARFORWARD = CGI.escapeHTML(">>")
end
+TYPE = "text/html"
+#TYPE = "application/xhtml+xml"
+CHARSET = "utf-8"
+
$htmlout = <<HEAD
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
HEAD
-if File.exist?("data.yaml")
+if File.exist?("data.yaml")
+ olddir = File.expand_path(".")
+ Dir.chdir("..")
+ load "config.rb"
+ Dir.chdir(olddir)
+
load "../participate.rb"
else
+ load "config.rb"
load "overview.rb"
end
-TYPE = "text/html"
-#TYPE = "application/xhtml+xml"
-CHARSET = "utf-8"
$cgi.out("type" => TYPE ,"charset" => CHARSET,"cookie" => utfcookie, "Cache-Control" => "no-cache"){$htmlout}
end