# File: shared/Posting/_lib.pm #
# #
# Authors: André Malo <nd@o3media.de>, 2001-03-03 #
-# Frank Schoenmann <fs@tower.de>, 2001-03-02 #
+# Frank Schoenmann <fs@tower.de>, 2001-03-13 #
# #
# Description: Message access interface, time format routines #
# #
\@smsg;
}
-### delete_messages () ##########################################################
+### delete_messages () #########################################################
#
# Filter out deleted messages
#
return;
}
-### get_all_threads () ##########################################################
+### get_all_threads () #########################################################
#
# Read and Parse the main file (without any XML-module, they are too slow)
#
# $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;
if (wantarray)
{
+ ($dtd) = $xml =~ /<!DOCTYPE\s+\S+\s+SYSTEM\s+"([^"]+)">/;
($last_thread) = map {/(\d+)/} $xml =~ /<Forum.+?lastThread="([^"]+)"[^>]*>/;
($last_message) = map {/(\d+)/} $xml =~ /<Forum.+?lastMessage="([^"]+)"[^>]*>/;
}
$threads{$tid} = $smsg if (@$smsg);
}
- wantarray ?
- (\%threads, $last_thread, $last_message, \@unids)
- : \%threads;
+ wantarray
+ ? (\%threads, $last_thread, $last_message, $dtd, \@unids)
+ : \%threads;
}
###########################
# ====================================================
# making require happy
-1;
\ No newline at end of file
+1;