From 1bc8d7a9de9ec3bcd8bd1d494449a5dcf4250b71 Mon Sep 17 00:00:00 2001 From: fox_two <> Date: Mon, 4 Jun 2001 18:45:53 +0000 Subject: [PATCH 1/1] -n/a- --- selfforum-cgi/shared/Template/Archive.pm | 45 +++++++++++++++++++++--- 1 file changed, 40 insertions(+), 5 deletions(-) diff --git a/selfforum-cgi/shared/Template/Archive.pm b/selfforum-cgi/shared/Template/Archive.pm index c71c359..08d215c 100644 --- a/selfforum-cgi/shared/Template/Archive.pm +++ b/selfforum-cgi/shared/Template/Archive.pm @@ -73,10 +73,29 @@ sub print_month_as_HTML($$$) { my $template = new Template $tempfile; + # + # check if XML file exists + # + unless (-e $mainfile) { + print ${$template->scrap( + $assign->{'error'}, + { + $assign->{'errorText'} => "Es existieren keine Nachrichten für diesen Monat." + } + )}; + return; + } + + # + # try locking and read/parse threads + # my ($threads, $locked); unless ($locked = lock_file($mainfile) and $threads = get_all_threads($mainfile, KILL_DELETED)) { print ${$template->scrap( - $assign->{'errorLocking'} + $assign->{'error'}, + { + $assign->{'errorText'} => "Fehler beim Locking." + } )}; return; } @@ -143,6 +162,19 @@ sub print_thread_as_HTML($$$) { my $template = new Template $tempfile; + # + # check if XML file exists + # + unless (-e $mainfile) { + print ${$template->scrap( + $assign->{'error'}, + { + $assign->{'errorText'} => "Der gewünschte Thread existiert nicht." + } + )}; + return; + } + my $view = get_view_params ({ 'adminDefault' => $param->{'adminDefault'} }); @@ -180,7 +212,8 @@ sub print_thread_as_HTML($$$) { print ${$template->scrap( $assign->{'threadDocStart'}, - $tmplparam + $tmplparam, + 1 )}; # @@ -191,7 +224,7 @@ sub print_thread_as_HTML($$$) { my $header = get_message_header($mnode); my $body = get_message_body($xml, 'm'.$_->{'mid'}); - my $text = message_field ( + my $text = message_field( $body, { 'quoteChars' => plain($view->{'quoteChars'}), @@ -213,7 +246,8 @@ sub print_thread_as_HTML($$$) { $assign->{'msgCategory'} => plain($header->{'category'}), $assign->{'msgSubject'} => plain($header->{'subject'}), $assign->{'msgBody'} => $text - } + }, + 1 )}; } @@ -222,7 +256,8 @@ sub print_thread_as_HTML($$$) { # print ${$template->scrap( $assign->{'threadDocEnd'}, - $tmplparam + $tmplparam, + 1 )}; } -- 2.34.1