- #
- my $tfile = $tpath . '/' . $tid . '.xml';
- change_posting_value($tfile, $tid, $mid, \$msgdata);
- change_posting_value($forum, $tid, $mid, \$msgdata);
+ # Thread
+ my $tfile = $tpath . '/t' . $tid . '.xml';
+ change_posting_value($tfile, 't'.$tid, 'm'.$mid, \$msgdata);
+ $body && change_posting_body($tfile, 't'.$tid, 'm'.$mid, $body);
+
+ # Forum (does not contain msg bodies)
+ #change_posting_value($forum, 't'.$tid, 'm'.$mid, \$msgdata);
+
+ my ($f, $lthread, $lmsg, $dtd, $zlev) = get_all_threads($forum, 1, 0);
+
+ for (@{$f->{$tid}})
+ {
+ if ($_->{'mid'} == $mid)
+ {
+ $subject && $_->{'subject'} = $subject;
+ $category && $_->{'cat'} = $category;
+ }
+ }
+
+ my %cfxs = (
+ 'dtd' => $dtd,
+ 'lastMessage' => $lmsg,
+ 'lastThread' => $lthread
+ );
+ my $xmlstring = create_forum_xml_string($f, \%cfxs);
+ save_file($forum, $$xmlstring);