$txt{'70'}
$txt{'109'}
$txt{'110'}
$txt{'301'}
$txt{'111'}
~;
###Start Sticky Group mod
if($stkynum){
$yymain .= qq~
$stickygrp{'1'}
~;
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~
~;
}
###End Sticky Group mod
# Begin printing the message index for current board.
$counter = $start;
foreach( @threads ) {
($mnum, $msub, $mname, $memail, $mdate, $mreplies, $musername, $micon, $mstate) = split( /\|/, $_ );
# --- Added for Notify Plus 2.2 --- #
# Reset Mark-image
$markimg = "";
# Is mark thread enabled and it's a Member ?
if ($enable_mark_thread == 1 && $username ne 'Guest') {
# Has the member a notification on this thread ?!
if (fopen(FILE, "$datadir/$mnum.mail")) {
# Read all records
fopen(FILE, "$datadir/$mnum.mail");
@mails = ;
fclose(FILE);
foreach $record (@mails) {
chomp($record);
($email, $format) = split(/\|/, $record);
chomp($email);
# Yep, Notification found
if ($email eq $settings[2]) {
$markimg = qq~ ~;
last;
}
# End Foreach
}
# End if Has the member a notification
}
# End if Is mark thread enabled
}
# --- /Added for Notify Plus 2.2 --- #
# 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'; }
}
}
$auctionthread = 0;
if (-e "$datadir/$mnum.auction") { $auctionthread = 1;
fopen (FILE, "$datadir/$mnum.auction");
@auctiondata = ;
fclose (FILE);
$bidduration = $auctiondata[5];
$bidstart = $auctiondata[12];
if (-e "$datadir/$mnum.auctx"){
fopen (FILE, "$datadir/$mnum.auctx");
@extdata = ;
fclose (FILE);
$extnum = 0;
$exttime = 0;
foreach $extention(@extdata){
chomp $extention;
$extnum++;
$exttime = $exttime + $extention;
}
}
$bidtimeleft = 0;
my $todaytime = time;
$dif = (($todaytime - $bidstart)/86400);
if(!$dif) { $dif = 0; }
$bidtimeleft = sprintf("%.1f",$bidduration - $dif + $exttime);
$calcdif = (($bidduration*86400)-($todaytime - $bidstart)+($exttime*86400));
$bidday = int($calcdif/86400);
$calcdif = ($calcdif - ($bidday*86400));
$bidhour = int($calcdif/3600);
$calcdif = ($calcdif - ($bidhour*3600));
$bidminute = int($calcdif/60);
$calcdif = ($calcdif - ($bidminute*60));
$bidsecond = int($calcdif);
if($bidday <= 0){
$duration = "";
} elsif($bidday == 1) {
$duration = "$bidday$aucttxt{'10a'} ";
} else {
$duration = "$bidday$aucttxt{'10a2'} ";
}
if($bidhour <= 0 && $bidday <= 0){
$duration .= "";
} else {
$duration .= "$bidhour$aucttxt{'10c'} ";
}
if($bidminute <= 0 && $bidhour <= 0){
$duration .= "";
} else {
$duration .= "$bidminute$aucttxt{'10d'} ";
}
if($bidsecond < 0){
$duration .= "$aucttxt{'39a'}";
} else {
$duration .= "$bidsecond$aucttxt{'10e'} ";
}
}
$auctlock = 0;
$bidcount = 0;
$hbuser="";
$hbusername="";
if (-e "$datadir/$mnum.bids"){
fopen (BID, "$datadir/$mnum.bids");
@bids = ;
fclose (BID);
}
if (-e "$datadir/$mnum.auctl" || $bidtimeleft <= 0 ) {$auctionimg = qq~$img{'auctioniconclosed'}~;
$auctlock = 1;
foreach $bidline(@bids){
chomp $bidline;
$bidcount++;
@biditem = split(/\|/,$bidline);
$hbuser = $biditem[0];
$hbusername = $biditem[1];
}
} elsif (-e "$datadir/$mnum.bids"){
foreach $bidline(@bids){
chomp $bidline;
$bidcount++;
@biditem = split(/\|/,$bidline);
$hbuser = $biditem[0];
$hbusername = $biditem[1];
if ($hbuser eq $username) {$lastbid = 1;} else {$lastbid = 0;}
}
if ($lastbid == 1 ){$auctionimg = qq~$img{'auctionicon'}~; } else {$auctionimg = qq~$img{'auctionnewicon'}~; }
} else {
if (-e "$datadir/$mnum.bids"){
foreach $bidline(@bids){
chomp $bidline;
$bidcount++;
@biditem = split(/\|/,$bidline);
$hbuser = $biditem[0];
$hbusername = $biditem[1];
}
}
$auctionimg = qq~$img{'auctionnewicon'}~;
}
if ($username eq 'Guest'){$auctionimg = ""; }
# 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 = 'new';
}
else { $new = ''; }
if ($hbuser ne ""){
$lastbidder = qq~$hbusername ~;
} else {
$lastbidder = "$aucttxt{'45'}";
}
if ($bidcount > 0){
$numberbids = qq~$bidcount~;
} else {
$numberbids = "$aucttxt{'45'}";
}
if ($auctlock == 1){
$duration = $aucttxt{'39a'};
}
if ($auctionthread == 0) {$lastbidder = ""; $numberbids = "";}
# 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 = '';
my $gotolastpage = 0;
if( $threadlength > $maxmessagedisplay ) {
$tmpa = 1;
$count = 0;
for( $tmpb = 0; $tmpb < $threadlength && $count < 3; $tmpb += $maxmessagedisplay ) {
$pages .= qq~$tmpa \n~;
++$tmpa;
++$count;
$gotolastpage = $tmpb;
}
$tmpaend = int($threadlength/$maxmessagedisplay+0.99);
$tmpbend = $maxmessagedisplay*$tmpaend-$maxmessagedisplay;
if( $tmpaend > 3) { $pages .= qq~...$tmpaend \n~; }
$pages =~ s/\n\Z//;
$pages = qq~« $txt{'139'} $pages » ~;
$gotolastpage = $tmpbend;
}
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;
###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~
~;
if ($auctionthread eq 1) {
$yymain .= qq~
$auctionimg
~;
} elsif ($auctionthread eq 0) {
$yymain .= qq~
~;
}
$yymain .= qq~
$micon
$new $mpoll $markimg $msub $pages ~;
if($auctionthread == 1){
$yymain .= qq~ $aucttxt{'20a'} » $lastbidder $aucttxt{'20b'} » $numberbids $aucttxt{'10b'} » $duration ~;
}
$yymain .= qq~
$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 .= "$curboardname";
}
}
}
if ($enable_topicrating == 1) {$colspan=8;} else {$colspan=7;}
if (($settings[7] eq 'Administrator' && $adminview == 3) || ($settings[7] eq 'Global Moderator' && $gmodview == 3) || (exists $moderators{$username} && $modview == 3)){
$yymain .= qq~
$txt{'133'}: $boardlist
$txt{'737'}
~;
}
elsif (($settings[7] eq 'Administrator' && $adminview == 2) || ($settings[7] eq 'Global Moderator' && $gmodview == 2) || (exists $moderators{$username} && $modview == 2)){
$yymain .= qq~
$txt{'104'}
$txt{'781'}
$txt{'31'}
$txt{'133'}: $boardlist
$txt{'737'}
~;
}
$yymain .= qq~