- {
- # Change flag in thread xml file
- my $tfile = $tpath . '/' . $tid;
-
- my $parser = new XML::DOM::Parser;
- my $xml = $parser->parsefile($tfile);
-
- my $msgs = $xml->getElementsByTagName('Message');
-
- for (my $i = 0; $i < $msgs->getLength; $i++)
- {
- my $msg = $msgs->item($i);
-
- if ($msg->getAttribute('id')->getValue == $pid)
- {
- $msg->setAttribute('invisible', '1');
- last;
- }
- }
-
- # Save thread xml file
- $xml->printToFile($tfile . '.temp');
- rename $tfile . '.temp', $tfile;
- }
-
- {
- # Change flag in forum xml file
- my $parser = new XML::DOM::Parser;
- my $xml = $parser->parseFile($forum);
+ my $tfile = $tpath . '/' . $tid . '.xml';
+ change_posting_visibility($tfile, $tid, $mid, 1);
+ change_posting_visibility($forum, $tid, $mid, 1);
+}