my $file = shift(@{ $tempfileR->{data} }) or last;
my ($tn, $pn) = split(/\D/, $file);
next if $tn == 0;
if ($topic != 0 && $topic != $tn) {
unshift(@{ $tempfileR->{data} }, $file);
last;
}
if ($topic == 0) {
open (TREETMP, ">> $DCONF->{admin_dir}/msg_index/$tn-tree.TMP") || error_message("File Write Error", "Could not create temporary tree index file in 'msg_index' directory!");
open (SRCHTMP, ">> $DCONF->{admin_dir}/msg_index/$tn-search.TMP") || error_message("File Write Error", "Could not create temporary tree index file in 'msg_index' directory!");