|
~;
# Look for reverse order this tboard
if ( -e "$boardsdir/$currentboard.reverse" ) {
$revboard=1;
if( $settings[7] eq 'Administrator' || (exists $moderators{$username}) ) {
$yymain .= qq~
$txt{'70'} |
~;
}
else {
$yymain .= qq~$txt{'70'} | ~;
}
}
else {
$revboard=0;
if( $settings[7] eq 'Administrator' || (exists $moderators{$username}) ) {
$yymain .= qq~
$txt{'70'} |
~;
}
else {
$yymain .= qq~$txt{'70'} | ~;
}
}
$yymain .= qq~
$txt{'109'} |
$txt{'110'} |
$txt{'301'} |
$txt{'111'} |
~;
###Start Sticky Group mod
if($stkynum){
$yymain .= qq~
$stickygrp{'1'} |
~;
}
###End Sticky Group mod
~;
if (($settings[7] eq 'Administrator' && $adminview == 3) || ($settings[7] eq 'Global Moderator' && $gmodview == 3) || (exists $moderators{$username} && $modview == 3)){
$yymain .= qq~
 |
~;
}
elsif (($settings[7] eq 'Administrator' && $adminview != 0) || ($settings[7] eq 'Global Moderator' && $gmodview != 0) || (exists $moderators{$username} && $modview != 0)){
$yymain .= qq~
$txt{'2'} |
~;
}
$yymain .= qq~
# 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 = ''; }
if ( $settings[7] eq 'Administrator' || (exists $moderators{$username}) ) {
if ( $revboard == 1 ) {
if (-e "$datadir/$mnum.reverse") {$new = qq~$new ~;}
else {$new = qq~$new ~;}
}
else {
if (-e "$datadir/$mnum.reverse") {$new = qq~$new ~;}
else {$new = qq~$new ~;}
}
}
else {
if ( $revboard == 1 ) {
if (-e "$datadir/$mnum.reverse") {;}
else {$new = qq~$new ~;}
}
else {
if (-e "$datadir/$mnum.reverse") {$new = qq~$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;
# Look for reverse order this thread.
if (-e "$datadir/$mnum.reverse") { $revthread = 1; } else { $revthread = 0; }
$has_reverse=0 ;
if ( $revboard && !$revthread ) { $has_reverse=1; }
else { if ( !$revboard && $revthread ) {$has_reverse=1; } }
if ( $has_reverse ) {
for( $tmpb = $threadlength-1; $tmpb > -1 ; $tmpb -= $maxmessagedisplay ) {
$pages .= qq~$tmpa\n~;
++$tmpa;
}
}
else{
for( $tmpb = 0; $tmpb < $threadlength; $tmpb += $maxmessagedisplay ) {
$pages .= qq~$tmpa\n~;
++$tmpa;
}
}
$pages =~ s/\n\Z//;
$pages = qq~ « $txt{'139'} $txt_sb{'1001'} $pages »~;
}
if(fopen(FILE, "$datadir/$mnum.data")) {
$tmpa = ;
@other_stuff = ;
fclose(FILE);
chomp $tmpa;
}
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;
###Start Sticky Group mod
if(($stkynum && ($counter >= $stkynum)) && ($stkyshowed < 1)){
$yymain .= qq~
$stickygrp{'2'} |
~;
$stkyshowed = 1;
}
###End Sticky Group mod
# Print the thread info.
$mydate = &timeformat($mdate);
$yymain .= qq~
 |
$micon |
$new $mpoll$msub $pages |
$mname |
$mreplies |
$views |
$mydate $txt{'525'} $lastpostername |
~;
if (($settings[7] eq 'Administrator' && $adminview == 3) || ($settings[7] eq 'Global Moderator' && $gmodview == 3) || (exists $moderators{$username} && $modview == 3)){
$yymain .= qq~
|
~;
}
elsif (($settings[7] eq 'Administrator' && $adminview == 2) || ($settings[7] eq 'Global Moderator' && $gmodview == 2) || (exists $moderators{$username} && $modview == 2)){
$yymain .= qq~
|
~;
}
elsif (($settings[7] eq 'Administrator' && $adminview == 1) || ($settings[7] eq 'Global Moderator' && $gmodview == 1) || (exists $moderators{$username} && $modview == 1)){
$yymain .= qq~
|
~;
}
$yymain .= qq~
~;
++$counter;
$mcount++;
}
fopen(FILE, "$vardir/cat.txt");
@categories = ;
fclose(FILE);
$boardlist="";
foreach $curcat (@categories) {
$curcat =~ s/[\n\r]//g;
fopen(CAT, "$boardsdir/$curcat.cat");
@catinfo = ;
fclose(CAT);
$catinfo[1] =~ s/[\n\r]//g;
$curcatname="$catinfo[0]";
boardcheck: foreach $curboard (@catinfo) {
$curboard =~ s/[\n\r]//g;
fopen(BOARD, "$boardsdir/$curboard.dat");
@boardinfo = ;
fclose(BOARD);
chomp @boardinfo;
$curboardname = $boardinfo[0];
if($curboard ne "$catinfo[0]" && $curboard ne "$catinfo[1]" && $currentboard ne $curboard) {
$curboard =~ s/[\n\r]//g;
$boardlist .= "
|