X-Git-Url: https://git.p6c8.net/selfforum.git/blobdiff_plain/50e18aa2c9ae7c3bcc78d533a03a21338c94e006..5eee41e4c8f4a9f494d4457c088803a260efcac3:/selfforum-cgi/shared/Posting/_lib.pm?ds=sidebyside diff --git a/selfforum-cgi/shared/Posting/_lib.pm b/selfforum-cgi/shared/Posting/_lib.pm index 3d082ac..05a0285 100644 --- a/selfforum-cgi/shared/Posting/_lib.pm +++ b/selfforum-cgi/shared/Posting/_lib.pm @@ -5,7 +5,7 @@ package Posting::_lib; # File: shared/Posting/_lib.pm # # # # Authors: André Malo , 2001-03-03 # -# Frank Schoenmann , 2001-03-02 # +# Frank Schoenmann , 2001-03-13 # # # # Description: Message access interface, time format routines # # # @@ -273,7 +273,7 @@ sub sort_thread ($$) { \@smsg; } -### delete_messages () ########################################################## +### delete_messages () ######################################################### # # Filter out deleted messages # @@ -318,7 +318,7 @@ sub delete_messages ($) return; } -### get_all_threads () ########################################################## +### get_all_threads () ######################################################### # # Read and Parse the main file (without any XML-module, they are too slow) # @@ -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 =~ /]*>/; } @@ -439,9 +440,9 @@ sub get_all_threads ($$;$) $threads{$tid} = $smsg if (@$smsg); } - wantarray ? - (\%threads, $last_thread, $last_message, \@unids) - : \%threads; + wantarray + ? (\%threads, $last_thread, $last_message, $dtd, \@unids) + : \%threads; } ########################### @@ -571,4 +572,4 @@ sub long_hr_time ($) { # ==================================================== # making require happy -1; \ No newline at end of file +1;