Latest Subject SP1-1.3
2.0
This mod adds the last post subject of the forum in the last post column of the board index.
Now compatible with Polls (version 2 or higher) and MBCO2
To Install:
- Decide if you want to display the details of the FIRST or LAST post and set the value of $last_post accordingly (See Step 1 below)
- apply the mod file and upload the modified files
- go to the admin center and recount the board totals
Based on the "Latest Subject on Main Page" mod by MADD Hatter SP1 By Ken Ault
BHRA Webmaster
http://www.bhra.org.uk
###############################################################################
Sources/BoardIndex.pl
$yymain .= qq~
$new
## LAST SUBJECT MOD ##
# Use the following line to decide if you want the Latest Subject in the Board Index to display the details
# (message icon, subject and link) of the FIRST post or LAST post of the most recently replied to thread
$last_post = 1; # 0 = FIRST post; 1 = LAST post
$subjecthtml = "";
if ($lastthreadid{$curboard}) {
fopen(FILE,"$datadir/$lastthreadid{$curboard}.txt");
@tmp_messages = ;
fclose(FILE);
if ($last_post) {$subjectmain = $tmp_messages[$#tmp_messages];} else {$subjectmain = $tmp_messages[0];}
($subjectmain, $dummy, $dummy, $dummy, $dummy, $subicon, $dummy) = split(/\|/, $subjectmain);
# Censor the subject of the thread.
foreach (@censored) {
($tmpa,$tmpb) = @{$_};
$subjectmain =~ s~\Q$tmpa\E~$tmpb~gi;
}
if (length($subjectmain) > 25) { $subjectmain = substr($subjectmain, 0, 25) . qq~ ...~; }
$subicon = qq~~;
# Detect if this thread is a poll thread
if (-e "$datadir/$lastthreadid{$curboard}.poll") {
fopen (FILE, "$datadir/$lastthreadid{$curboard}.poll");
$poll_question = ;
fclose (FILE);
chomp $poll_question;
($dummy, $poll_locked, $dummy) = split(/\|/, $poll_question, 3);
$subicon = qq~$img{'pollicon'}~;
if ($poll_locked eq "1" || $poll_locked eq "Locked") { $subicon = qq~$img{'polliconclosed'}~; }
}
if ($last_post) {$tmp_start = qq~;start=$#tmp_messages\#$#tmp_messages~;} else {$tmp_start = "";}
$subjecthtml = qq~$subicon $subjectmain ~;
if ($settings[7] ne "Administrator" && $boardpw{$curboard} && $yyCookies{$cookiename} ne $crypass) {$subjecthtml = qq~ $mbco{'14'} ~;}
}
## END LAST SUBJECT MOD ##
sub BoardIndex {
# Load censor list.
fopen(FILE,"$vardir/censor.txt");
while( chomp( $buffer = ) ) {
($tmpa,$tmpb) = split(/=/,$buffer);
push(@censored,[$tmpa,$tmpb]);
}
fclose(FILE);
( $threadcount, $messagecount, $lastposttime, $lastposter ) = &BoardCountGet($curboard);
( $threadcount, $messagecount, $lastposttime, $lastposter, $lastthreadid{$curboard} ) = &BoardCountGet($curboard);