X-Git-Url: https://git.p6c8.net/selfforum.git/blobdiff_plain/050483c4525eb50f57ef5c5c3a33345a5846b4a4..50ab72c5b8dbaca93b2bf52e4543861d878d60fb:/selfforum-cgi/shared/Posting/_lib.pm diff --git a/selfforum-cgi/shared/Posting/_lib.pm b/selfforum-cgi/shared/Posting/_lib.pm index 82240d5..886d957 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-13 # +# Frank Schoenmann , 2001-06-04 # # # # Description: Message access interface, time format routines # # # @@ -40,6 +40,8 @@ use base qw(Exporter); hr_time short_hr_time long_hr_time + very_short_hr_time + month get_all_threads create_forum_xml_string @@ -295,7 +297,7 @@ sub parse_xml_file ($) { my $xml = eval { local $SIG{__DIE__}; # CGI::Carp works unreliable ;-( - new XML::DOM::Parser (KeepCDATA => 1) -> parsefile ($file); + new XML::DOM::Parser(KeepCDATA => 1)->parsefile ($file); }; return if ($@); @@ -491,9 +493,9 @@ sub get_all_threads ($$;$) my ($last_thread, $last_message, $dtd, @unids, %threads); local (*FILE, $/); - open FILE, $file or return undef; + open FILE,"< $file" or return; my $xml = join '', ; - close(FILE) or return undef; + close(FILE) or return; if (wantarray) { @@ -704,7 +706,7 @@ sub save_file ($$) ########################### sub hr_time ($) { - my @month = (qw(Januar Februar), "M\303\244rz", qw(April Mail Juni Juli August September Oktober November Dezember)); + my @month = (qw(Januar Februar), "M\303\244rz", qw(April Mai Juni Juli August September Oktober November Dezember)); # ^^^^^^^^ - UTF8 # my (undef, $min, $hour, $day, $mon, $year) = localtime ($_[0]); @@ -719,7 +721,7 @@ sub short_hr_time ($) { } sub long_hr_time ($) { - my @month = (qw(Januar Februar), "M\303\244rz", qw(April Mail Juni Juli August September Oktober November Dezember)); + my @month = (qw(Januar Februar), "M\303\244rz", qw(April Mai Juni Juli August September Oktober November Dezember)); # ^^^^^^^^ - UTF8 # my @wday = qw(Sonntag Montag Dienstag Mittwoch Donnerstag Freitag Samstag); @@ -728,9 +730,22 @@ sub long_hr_time ($) { sprintf ('%s, %02d. %s %04d, %02d:%02d:%02d Uhr', $wday[$wday], $day, $month[$mon], $year+1900, $hour, $min, $sek); } +sub very_short_hr_time($) { + my (undef, $min, $hour, $day, $mon, $year) = localtime ($_[0]); + + sprintf ('%02d. %02d. %04d', $day, $mon+1, $year+1900); +} + +sub month($) { + my @month = (qw(Januar Februar), "M\303\244rz", qw(April Mai Juni Juli August September Oktober November Dezember)); + # ^^^^^^^^ - UTF8 # + + return $month[$_[0]-1]; +} + # ==================================================== # Modulinitialisierung # ==================================================== # making require happy -1; \ No newline at end of file +1;