From b2f1ca8d9367d38b919afebbdc2e1b7002dc2563 Mon Sep 17 00:00:00 2001 From: ndparker <> Date: Thu, 8 Mar 2001 22:37:36 +0000 Subject: [PATCH] modified 'get_all_threads', returns now additionally the dtd resource, fo_posting.pl adjusted --- selfforum-cgi/shared/Posting/_lib.pm | 7 ++++--- selfforum-cgi/user/fo_posting.pl | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/selfforum-cgi/shared/Posting/_lib.pm b/selfforum-cgi/shared/Posting/_lib.pm index 3d082ac..9ede105 100644 --- a/selfforum-cgi/shared/Posting/_lib.pm +++ b/selfforum-cgi/shared/Posting/_lib.pm @@ -326,12 +326,12 @@ sub delete_messages ($) # $deleted hold deleted (invisible) messages in result (1) oder not (0) # $sorted direction of message sort: descending (0) (default) or ascending (1) # Return: scalar context: hash reference -# list context: list (\%threads, $last_thread, $last_message, \@unids) +# list context: list (\%threads, $last_thread, $last_message, $dtd, \@unids) # sub get_all_threads ($$;$) { my ($file, $deleted, $sorted) = @_; - my ($last_thread, $last_message, @unids, %threads); + my ($last_thread, $last_message, $dtd, @unids, %threads); local (*FILE, $/); open FILE, $file or return undef; @@ -340,6 +340,7 @@ sub get_all_threads ($$;$) if (wantarray) { + ($dtd) = $xml =~ //; ($last_thread) = map {/(\d+)/} $xml =~ /]*>/; ($last_message) = map {/(\d+)/} $xml =~ /]*>/; } @@ -440,7 +441,7 @@ sub get_all_threads ($$;$) } wantarray ? - (\%threads, $last_thread, $last_message, \@unids) + (\%threads, $last_thread, $last_message, $dtd, \@unids) : \%threads; } diff --git a/selfforum-cgi/user/fo_posting.pl b/selfforum-cgi/user/fo_posting.pl index 6bcde80..89e0e24 100644 --- a/selfforum-cgi/user/fo_posting.pl +++ b/selfforum-cgi/user/fo_posting.pl @@ -104,7 +104,7 @@ sub check_reply_dupe () { $flocked = 1; - ($threads, $last_thread, $last_message, my $unids) = get_all_threads (forum_filename, 1, 0); + ($threads, $last_thread, $last_message, undef, my $unids) = get_all_threads (forum_filename, 1, 0); ($ftid,$fmid) = split /;/,$dparam{$formdata -> {followUp} -> {name}},2; # Thread existiert nicht -- 2.34.1