|
$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.
$micon = qq~ ~;
$mpoll = "";
if (-e "$datadir/$mnum.poll") {
$mpoll = qq~$polltxt{'15'}: ~;
fopen (FILE, "$datadir/$mnum.poll");
$poll_question = ;
fclose (FILE);
chomp $poll_question;
($dummy, $poll_locked, $dummy) = split(/\|/, $poll_question, 3);
$micon = qq~$img{'pollicon'}~;
if ($poll_locked) { $micon = $img{'polliconclosed'}; }
else {
fopen(FILE, "$datadir/$mnum.polled");
$polled = ;
fclose(FILE);
$dlp = &getlog($mnum);
($dummy, $dummy, $dummy, $vote_date, $dummy) = split(/\|/, $polled);
$vote_date = stringtotime($vote_date);
if( $max_log_days_old && $dlp < $vote_date && $username ne 'Guest' && &getlog("$currentboard--mark") < $vote_date ) {$micon = qq~$img{'polliconnew'}~;}
}
}
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;
if((-e "$datadir/$mnum.fav") && ($enable_favorites)) {
fopen(FILE, "$datadir/$mnum.fav");
@favnames = ;
fclose(FILE);
foreach $chfav (@favnames) {
chomp $chfav;
if($username eq $chfav) {$new .= qq~ ~; last;}
}
}
# Print the thread info.
$mydate = &timeformat($mdate);
$yymain .= qq~
 |
$micon |
$new $mpoll$msub $pages |
$mname |
$mreplies |
$views |
$mydate $txt{'525'} $lastpostername |
~;
++$counter;
}
$yymain .= qq~
|