X-Git-Url: https://git.p6c8.net/selfforum.git/blobdiff_plain/9f19cb68669296f87eefd27f8e9765deeef85106..03e918e15295c454bbcd6aa0e3a0459d99090afe:/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 e8065ab..5136b21 100644 --- a/selfforum-cgi/shared/Posting/_lib.pm +++ b/selfforum-cgi/shared/Posting/_lib.pm @@ -127,7 +127,8 @@ sub parse_single_thread ($$;$) { ip => $_ -> getAttribute ('ip'), kids => [$_ -> getElementsByTagName ('Message', 0)], answers => $_ -> getElementsByTagName ('Message') -> getLength, - deleted => ($_ -> getAttribute ('flag') eq 'deleted')?1:0, + deleted => $_ -> getAttribute ('invisible'), + archive => $_ -> getAttribute ('archive'), name => plain($header -> {name}), cat => plain($header -> {category} or ''), subject => plain($header -> {subject}), @@ -165,7 +166,8 @@ sub create_message_xml ($$$) { my $message = $xml -> createElement ('Message'); $message -> setAttribute ('id', 'm'.$msg -> {mid}); - $message -> setAttribute ('flag', 'deleted') if ($msg -> {deleted}); + $message -> setAttribute ('invisible', '1') if ($msg -> {deleted}); + $message -> setAttribute ('archive', '1') if ($msg -> {archive}); # Header erzeugen my $header = $xml -> createElement ('Header'); @@ -295,7 +297,7 @@ sub get_all_threads ($$;$) { ($last_message) = map {/(\d+)/} $xml =~ /]*>/;} my $reg_msg = qr~(?: - |]*>\s* + |]*>\s*
[^<]*(?:<(?!Name>)[^<]*)* ([^<]+)[^<]*(?:<(?!Category>)[^<]*)* ([^<]*)\s* @@ -310,7 +312,7 @@ sub get_all_threads ($$;$) { while ($thread =~ m;$reg_msg;g) { - if (defined($9)) { + if (defined($10)) { push @stack,$cmno if (defined $cmno); push @msg, {}; @@ -329,9 +331,10 @@ sub get_all_threads ($$;$) { $msg[-1] -> {name}, $msg[-1] -> {cat}, $msg[-1] -> {subject}, - $msg[-1] -> {time}) = ($1, $2, $4, $5, $6, $7); + $msg[-1] -> {time}) = ($1, $2, $5, $6, $7, $8); - $msg[-1] -> {deleted} = ($3 eq 'deleted')?1:undef; + $msg[-1] -> {deleted} = $3; + $msg[-1] -> {archive} = $4; $msg[-1] -> {name} =~ s/&/&/g; $msg[-1] -> {cat} =~ s/&/&/g; @@ -342,7 +345,7 @@ sub get_all_threads ($$;$) { $msg[-1] -> {answers} = 0; $msg[-1] -> {level} = $level++;} - elsif (defined ($8)) { + elsif (defined ($9)) { push @msg, {}; if (defined $cmno) { @@ -359,9 +362,10 @@ sub get_all_threads ($$;$) { $msg[-1] -> {name}, $msg[-1] -> {cat}, $msg[-1] -> {subject}, - $msg[-1] -> {time}) = ($1, $2, $4, $5, $6, $7); + $msg[-1] -> {time}) = ($1, $2, $5, $6, $7, $8); - $msg[-1] -> {deleted} = ($3 eq 'deleted')?1:undef; + $msg[-1] -> {deleted} = $3; + $msg[-1] -> {archive} = $4; $msg[-1] -> {name} =~ s/&/&/g; $msg[-1] -> {cat} =~ s/&/&/g; @@ -411,7 +415,8 @@ sub create_forum_xml_string ($$) { $level = $msg -> {level}; $xml .= ' {deleted})?' flag="deleted"':'') + .(($msg -> {deleted})?' invisible="1"':'') + .(($msg -> {archive})?' archive="1"':'') .'>' .'
' .'' @@ -480,8 +485,8 @@ sub save_file ($$) { ########################### sub hr_time ($) { - my @month = qw(Januar Februar M\303\244rz April Mail Juni Juli August September Oktober November Dezember); - # ^^^^^^^^ - UTF8 # + my @month = (qw(Januar Februar), "M\303\244rz", qw(April Mail Juni Juli August September Oktober November Dezember)); + # ^^^^^^^^ - UTF8 # my (undef, $min, $hour, $day, $mon, $year) = localtime ($_[0]); @@ -495,8 +500,8 @@ sub short_hr_time ($) { } sub long_hr_time ($) { - my @month = qw(Januar Februar M\303\244rz April Mail Juni Juli August September Oktober November Dezember); - # ^^^^^^^^ - UTF8 # + my @month = (qw(Januar Februar), "M\303\244rz", qw(April Mail Juni Juli August September Oktober November Dezember)); + # ^^^^^^^^ - UTF8 # my @wday = qw(Sonntag Montag Dienstag Mittwoch Donnerstag Freitag Samstag); my ($sek, $min, $hour, $day, $mon, $year, $wday) = localtime ($_[0]); @@ -513,4 +518,4 @@ sub long_hr_time ($) { # ==================================================== # end of Posting::_lib -# ==================================================== +# ==================================================== \ No newline at end of file