]> ruin.nu Git - ndwebbie.git/blobdiff - ND.pm
make forum/allUnread work
[ndwebbie.git] / ND.pm
diff --git a/ND.pm b/ND.pm
index 82a477ab5a60e17c064b9b829fd399d92bb22163..e95198a8898fbc709b1a595fe9b87f6b85834531 100755 (executable)
--- 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"){