From: fox_two <> Date: Thu, 8 Mar 2001 20:28:13 +0000 (+0000) Subject: hide_posting(), recover_posting(): use _lib::get_all_threads() and _lib::create_forum... X-Git-Url: https://git.p6c8.net/selfforum.git/commitdiff_plain/d8a1fb31ed6883aef6a7ba78a117269218966a10?hp=dfcbd8410fb1ca41209f915ef49f3cb79aa02d5c hide_posting(), recover_posting(): use _lib::get_all_threads() and _lib::create_forum_xml_string() to change main forum xml. --- diff --git a/selfforum-cgi/shared/Posting/Handle.pm b/selfforum-cgi/shared/Posting/Handle.pm index 5ca6556..9d2a94a 100644 --- a/selfforum-cgi/shared/Posting/Handle.pm +++ b/selfforum-cgi/shared/Posting/Handle.pm @@ -43,18 +43,24 @@ sub hide_posting($$$) change_posting_visibility($tfile, 't'.$tid, 'm'.$mid, 1); # Forum - change_posting_visibility($forum, 't'.$tid, 'm'.$mid, 1); - - #my $f = get_all_threads($forum, 1, 0); - #for (@{f->{$tid}}) - #{ - # if ($_->{'mid'} == $mid) - # { - # $_->{'deleted'} = 1; - # } - #} - # - #create_forum_xml_string($f, ); + #change_posting_visibility($forum, 't'.$tid, 'm'.$mid, 1); # OBSOLETE + + my ($f, $lthread, $lmsg, $dtd, $zlev) = get_all_threads($forum, 1, 0); + + for (@{$f->{$tid}}) + { + if ($_->{'mid'} == $mid) + { + $_->{'deleted'} = 1; + } + } + + my %cfxs = ( + 'dtd' => $dtd, + 'lastMessage' => $lmsg, + 'lastThread' => $lthread + ); + create_forum_xml_string($f, \%cfxs); } ### recover_posting() ########################################################## @@ -78,18 +84,24 @@ sub recover_posting($$$) change_posting_visibility($tfile, 't'.$tid, 'm'.$mid, 0); # Forum - change_posting_visibility($forum, 't'.$tid, 'm'.$mid, 0); - - #my $f = get_all_threads($forum, 1, 0); - #for (@{f->{$tid}}) - #{ - # if ($_->{'mid'} == $mid) - # { - # $_->{'deleted'} = 0; - # } - #} - # - #create_forum_xml_string($f, ); + #change_posting_visibility($forum, 't'.$tid, 'm'.$mid, 0); # OBSOLETE + + my ($f, $lthread, $lmsg, $dtd, $zlev) = get_all_threads($forum, 1, 0); + + for (@{$f->{$tid}}) + { + if ($_->{'mid'} == $mid) + { + $_->{'deleted'} = 0; + } + } + + my %cfxs = ( + 'dtd' => $dtd, + 'lastMessage' => $lmsg, + 'lastThread' => $lthread + ); + create_forum_xml_string($f, \%cfxs); } ### change_posting_visibility () ###############################################