X-Git-Url: https://git.p6c8.net/selfforum.git/blobdiff_plain/ba659b53059e637777865e646f0f2a6fb7f2988e..53e7fdde3ffd5fa8d1591d2131a6866e6be1f598:/selfforum-cgi/shared/Posting/_lib.pm diff --git a/selfforum-cgi/shared/Posting/_lib.pm b/selfforum-cgi/shared/Posting/_lib.pm index fea4097..e8065ab 100644 --- a/selfforum-cgi/shared/Posting/_lib.pm +++ b/selfforum-cgi/shared/Posting/_lib.pm @@ -2,7 +2,7 @@ # ==================================================== # Autor: n.d.p. / 2001-01-07 -# lm : n.d.p. / 2001-01-08 +# lm : n.d.p. / 2001-02-25 # ==================================================== # Funktion: # * Schnittstellen fuer den Zugriff auf Messages @@ -13,7 +13,8 @@ use strict; package Posting::_lib; -use vars qw(@ISA @EXPORT_OK); +use vars qw(@EXPORT_OK); +use base qw(Exporter); use Encode::Plain; $Encode::Plain::utf8 = 1; @@ -23,8 +24,6 @@ use XML::DOM; # Funktionsexport # ==================================================== -require Exporter; -@ISA = qw(Exporter); @EXPORT_OK = qw(get_message_header get_message_body get_message_node parse_single_thread hr_time short_hr_time long_hr_time get_all_threads @@ -71,14 +70,19 @@ sub get_message_header ($) { # Messagebody auslesen ########################### -sub get_message_body ($$) { - my ($xml,$mid) = @_; +sub get_message_body ($$) +{ + my ($xml, $mid) = @_; my $body; - foreach ($xml -> getElementsByTagName ('ContentList', 1) -> item (0) -> getElementsByTagName ('MessageContent', 0)) { - if ($_ -> getAttribute ('mid') eq $mid) { + foreach ($xml -> getElementsByTagName ('ContentList', 1) -> item (0) -> getElementsByTagName ('MessageContent', 0)) + { + if ($_ -> getAttribute ('mid') eq $mid) + { $body = ($_ -> hasChildNodes)?$_ -> getFirstChild -> getData:''; - last;}} + last; + } + } \$body; } @@ -164,14 +168,15 @@ sub create_message_xml ($$$) { $message -> setAttribute ('flag', 'deleted') if ($msg -> {deleted}); # Header erzeugen - my $header = $xml -> createElement ('Header'); + my $header = $xml -> createElement ('Header'); # alles inside of 'Header' my $author = $xml -> createElement ('Author'); - my $name = $xml -> createElement ('Name'); - $name -> addText (toUTF8($msg -> {name})); - my $email = $xml -> createElement ('Email'); + my $name = $xml -> createElement ('Name'); + $name -> addText (toUTF8($msg -> {name})); + + my $email = $xml -> createElement ('Email'); my $category = $xml -> createElement ('Category'); $category -> addText (toUTF8($msg -> {cat})); @@ -182,8 +187,8 @@ sub create_message_xml ($$$) { my $date = $xml -> createElement ('Date'); $date -> setAttribute ('longSec', $msg -> {time}); - $author -> appendChild ($name); - $author -> appendChild ($email); + $author -> appendChild ($name); + $author -> appendChild ($email); $header -> appendChild ($author); $header -> appendChild ($category); $header -> appendChild ($subject); @@ -192,7 +197,9 @@ sub create_message_xml ($$$) { if ($msg -> {kids}) { for (@{$msg -> {kids}}) { - $message -> appendChild (&create_message_xml ($xml, $msges, $_));}} + $message -> appendChild (&create_message_xml ($xml, $msges, $_)); + } + } $message; } @@ -506,4 +513,4 @@ sub long_hr_time ($) { # ==================================================== # end of Posting::_lib -# ==================================================== \ No newline at end of file +# ====================================================