From: Michael Andreen Date: Sat, 6 Jan 2007 22:12:05 +0000 (+0000) Subject: make forum/allUnread work X-Git-Url: https://ruin.nu/git/?p=ndwebbie.git;a=commitdiff_plain;h=e6872eb1f7192cca4f020a3440bf14d8789f2366 make forum/allUnread work --- diff --git a/ND.pm b/ND.pm index 82a477a..e95198a 100755 --- a/ND.pm +++ b/ND.pm @@ -49,6 +49,9 @@ sub handler { if ($ENV{'SCRIPT_NAME'} =~ /(\w+)(\.(pl|php|pm))?$/){ $ND::PAGE = $1 unless $1 eq 'index' and $3 eq 'pl'; } + if ($ENV{REQUEST_URI} =~ m{^.*/(\w+)$}){ + param($1,1); + } $ND::PAGE = '' unless defined $ND::PAGE; page(); return Apache2::Const::OK; @@ -58,7 +61,7 @@ sub page { our $DBH = ND::DB::DB(); $DBH->do(q{SET timezone = 'GMT'}); - our $ERROR = ''; + our $ERROR; chdir '/var/www/ndawn/code'; @@ -96,7 +99,7 @@ sub page { $ND::BODY = HTML::Template->new(filename => "templates/$ND::PAGE.xml.tmpl", cache => 1); }else{ $ND::BODY = HTML::Template->new(filename => "templates/$ND::PAGE.tmpl", global_vars => 1, cache => 1); - $ND::BODY->param(PAGE => $ND::PAGE); + $ND::BODY->param(PAGE => '/'.$ND::PAGE); } unless (my $return = do "$ND::PAGE.pl"){ diff --git a/apache-conf.conf b/apache-conf.conf index 6d7738b..68a4df7 100644 --- a/apache-conf.conf +++ b/apache-conf.conf @@ -120,7 +120,7 @@ PerlSwitches -T -I/var/www/ndawn/code/ PerlRequire /var/www/ndawn/code/startup.pl - + SetHandler perl-script PerlResponseHandler ND diff --git a/templates/skel.tmpl b/templates/skel.tmpl index 133ce3a..7d00672 100644 --- a/templates/skel.tmpl +++ b/templates/skel.tmpl @@ -5,65 +5,65 @@ NewDawn: <TMPL_VAR NAME=TITLE> - - + +