| |
$txt{'70'} |
$txt{'109'} |
$txt{'110'} |
$txt{'301'} |
$txt{'111'} |
~;
# Begin printing the message index for current board.
$counter = $start;
foreach( @threads ) {
($mnum, $msub, $mname, $memail, $mdate, $mreplies, $musername, $micon, $mstate) = split( /\|/, $_ );
# Set thread class depending on locked status and number of replies.
$threadclass = 'thread';
if( $mstate == 1 ) { $threadclass = 'locked'; }
elsif( $mreplies > 24 ) { $threadclass = 'veryhotthread'; }
elsif( $mreplies > 14 ) { $threadclass = 'hotthread'; }
elsif( $mstate == 0 ) { $threadclass = 'thread'; }
foreach $curnum (@stickys) {
if ($mnum == $curnum) {
if($threadclass eq 'locked') { $threadclass = 'stickylock'; }
else { $threadclass = 'sticky'; }
}
}
# Decide if thread should have the "NEW" indicator next to it.
# Do this by reading the user's log for last read time on thread,
# and compare to the last post time on the thread.
$dlp = &getlog($mnum);
$threaddate = stringtotime($mdate);
if( $max_log_days_old && $dlp != $threaddate && $username ne 'Guest' && &getlog("$currentboard--mark") < $threaddate ) {
$new = qq~ ~;
}
else { $new = ''; }
# Load the current nickname of the account name of the thread starter.
if( $musername ne 'Guest' && -e "$memberdir/$musername.dat" ) {
&LoadUser($musername);
$mname = $userprofile{$musername}->[1] || $mname || $txt{'470'};
$mname = qq~$mname~;
}
else {
$mname ||= $txt{'470'};
}
# Censor the subject of the thread.
foreach (@censored) {
($tmpa,$tmpb) = @{$_};
$msub =~ s~\Q$tmpa\E~$tmpb~gi;
}
# Decide how many pages the thread should have.
$threadlength = $mreplies + 1;
$pages = '';
if( $threadlength > $maxmessagedisplay ) {
$tmpa = 1;
for( $tmpb = 0; $tmpb < $threadlength; $tmpb += $maxmessagedisplay ) {
$pages .= qq~$tmpa\n~;
++$tmpa;
}
$pages =~ s/\n\Z//;
$pages = qq~ « $txt{'139'} $pages »~;
}
if( fopen(FILE, "$datadir/$mnum.data") ) {
$tmpa = ;
fclose(FILE);
}
elsif( -e "$datadir/$mnum.data" ) {
&fatal_error("301 $txt{'106'}: $txt{'23'} $mnum.data");
}
else {
$tmpa = '0';
}
($views, $lastposter) = split(/\|/, $tmpa);
if( $lastposter =~ m~\AGuest-(.*)~ ) {
$lastposter = $1;
}
else {
unless( $lastposter eq $txt{'470'} ) {
$lastposterid = $lastposter;
&LoadUser($lastposterid);
if($userprofile{$lastposter}->[1]) { $lastposter = qq~$userprofile{$lastposter}->[1]~; }
}
&LoadUser($lastposter);
}
$lastpostername = $lastposter || $txt{'470'};
$views = $views ? $views - 1 : 0;
# Print the thread info.
$mydate = &timeformat($mdate);
$yymain .= qq~
 |
 |
$new $msub $pages |
$mname |
$mreplies |
$views |
$mydate $txt{'525'} $lastpostername |
~;
++$counter;
}
$yymain .= qq~
|