~; my $curboard = $INFO{'board'}; my $curthread = $INFO{'thread'}; unless (exists $FORM{'oldposts'}) { $FORM{'oldposts'} = $INFO{'oldposts'}; } unless (exists $FORM{'leave'}) { $FORM{'leave'} = $INFO{'leave'}; } if (exists $INFO{'newinfo'}) { $FORM{'newinfo'} = $INFO{'newinfo'}; } my $newcat = $FORM{'newcat'} || $INFO{'newcat'}; my $newboard = $FORM{'newboard'} || $INFO{'newboard'}; unless (exists $FORM{'newthread'}) { $FORM{'newthread'} = $INFO{'newthread'}; } my $newthread = $FORM{'newthread'} || "new"; unless (exists $FORM{'newthread_subject'}) { $FORM{'newthread_subject'} = $INFO{'newthread_subject'}; } unless (exists $FORM{'position'}) { $FORM{'position'} = $INFO{'position'}; } require "$sourcedir/YaBBC.pl"; &LoadCensorList; # Get posts of current thread unless (ref($thread_arrayref{$curthread})) { @{$thread_arrayref{$curthread}} = &read_DBorFILE(1,'',$datadir,$curthread,'txt'); } my @messages = @{$thread_arrayref{$curthread}}; my ($counter,$size1); for ($counter = 0; $counter < @messages; $counter++) { $message = (split(/\|/, $messages[$counter], 10))[8]; ($message, undef) = &Split_Splice_Move($message,1); &DoUBBC; $convertstr = $message; $convertcut = 50; &CountChars; $message = $convertstr; $message .= " ..." if $cliped; &ToChars($message); $message =~ s/<(p|br|div).*?>/ /g; $message =~ s/<.*?>//g; # remove HTML-tags $message = &Censor($message); $messages[$counter] = qq~\n~; } @messages = reverse(@messages) if ($ttsureverse && ${$uid.$username}{'reversetopic'}) || $ttsreverse; my $postlist = ($FORM{'oldposts'} eq "all" ? qq~\n~ : qq~\n~) . join('', @messages); $size1 = @messages + 1; $size1 = $size1 > 10 ? 10 : $size1; # maximum size of multiselect field # List of options of what, if anything, to leave in place of the posts moved my @leaveopts = ($sstxt{'11'}, $sstxt{'12'}, $sstxt{'13'}); for ($counter = 0; $counter < @leaveopts; $counter++) { $leavelist .= qq~\n~; } # Get categories and make the current one the default selection my $catlist = qq~\n~; foreach (@categoryorder) { my ($catname, $catperms) = split(/\|/, $catinfo{$_}, 3); next if !&CatAccess($catperms); $catlist .= qq~\n~; } # Get boards and make the current one the default selection $boardlist = qq~\n~; foreach (split (/,/, $cat{$newcat})) { my ($boardname, $boardperms) = split(/\|/, $board{$_}, 3); my $access = &AccessCheck($_, '', $boardperms); next if !$iamadmin && $access ne "granted" && $boardview != 1; $boardlist .= qq~\n~; } # Get threads and make the current one the default selection my ($threadlist,$threadids,$positionlist); if ($cat{$newcat} =~ /\b$newboard\b/) { my @threads = &read_DBorFILE(1,'',$boardsdir,$newboard,'txt'); $threadlist = qq~\n~; my $threadid; foreach (@threads) { ($threadid, $message, undef) = split(/\|/, $_, 3); next if $curthread eq $threadid; $threadids .= "$threadid,"; ($message, undef) = &Split_Splice_Move($message,$threadid); &DoUBBC; $convertstr = $message; $convertcut = 50; &CountChars; $message = $convertstr; $message .= " ..." if $cliped; &ToChars($message); $message =~ s/<(p|br|div).*?>/ /g; $message =~ s/<.*?>//g; # remove HTML-tags $message = &Censor($message); $threadlist .= qq~\n~; } # Get new thread posts to select splice site if ($FORM{'newthread'} ne "new") { unless (ref($thread_arrayref{$newthread})) { @{$thread_arrayref{$newthread}} = &read_DBorFILE(1,'',$datadir,$newthread,'txt'); } @messages = @{$thread_arrayref{$newthread}}; for ($counter = 0; $counter < @messages; $counter++) { $message = (split(/[\|]/, $messages[$counter], 10))[8]; ($message, undef) = &Split_Splice_Move($message,1); &DoUBBC; $convertstr = $message; $convertcut = 50; &CountChars; $message = $convertstr; $message .= " ..." if $cliped; &ToChars($message); $message =~ s/<(p|br|div).*?>/ /g; $message =~ s/<.*?>//g; # remove HTML-tags $message = &Censor($message); $messages[$counter] = qq~\n~; } @messages = reverse(@messages) if ($ttsureverse && ${$uid.$username}{'reversetopic'}) || $ttsreverse; $positionlist = qq~\n~; $positionlist .= qq~\n~ . join('', @messages); if ($FORM{'position'} && $newthread == $FORM{'old_position_thread'}) { $positionlist =~ s/(value="$FORM{'position'}")/$1 selected="selected"/; } } } $output .= qq~