Shows latest Topics on every html page 1.1 Shows the latest topics on every html page using SSI-Call. To add the latest topics on a html page, just add during an error message attempt alternatively this call Change this variable by the number of Topics to be will displayed my $display = 7; version 1.1: installation bug fixed S.M.art.Y http://www.mac68k.de Sources/Recent.pl 1; ############################# START SHOW TOPIC MOD ################################# sub LastTopics { my $display = 7; my( @memset, @categories, %data, %cat, $numfound, $oldestfound, $curcat, %catname, %cataccess, %catboards, $openmemgr, @membergroups, %openmemgr, $curboard, @threads, @boardinfo, $i, $c, @messages, $tnum, $tsub, $tname, $temail, $tdate, $treplies, $tusername, $ticon, $tstate, $mname, $memail, $mdate, $musername, $micon, $mattach, $mip, $mns, $mtime, $counter, $board, $notify ); @categories = (); fopen(FILE, "$vardir/cat.txt"); @categories = ; fclose(FILE); $oldestfound = stringtotime("01/10/37 $txt{'107'} 00:00:00"); foreach $curcat (@categories) { chomp $curcat; fopen(FILE, "$boardsdir/$curcat.cat"); $catname{$curcat} = ; chomp $catname{$curcat}; $cataccess{$curcat} = ; chomp $cataccess{$curcat}; @{$catboards{$curcat}} = ; fclose(FILE); $openmemgr{$curcat} = 0; @membergroups = split( /,/, $cataccess{$curcat} ); foreach $tmpa (@membergroups) { if( $tmpa eq $settings[7]) { $openmemgr{$curcat} = 1; last; } } if( ! $cataccess{$curcat} || $settings[7] eq 'Administrator' ) { $openmemgr{$curcat} = 1; } unless( $openmemgr{$curcat} ) { next; } foreach $curboard (@{$catboards{$curcat}}) { chomp $curboard; fopen(FILE, "$boardsdir/$curboard.txt"); @threads = ; fclose(FILE); fopen(FILE, "$boardsdir/$curboard.dat"); @boardinfo = ; fclose(FILE); foreach (@boardinfo) { chomp; } @{$boardinfo{$curboard}} = @boardinfo; $cat{$curboard} = $curcat; for ($i = 0; $i < @threads; $i++) { chomp $threads[$i]; ($tnum, $tsub, $tname, $temail, $tdate, $treplies, $tusername, $ticon, $tstate) = split( /\|/, $threads[$i] ); fopen(FILE, "$datadir/$tnum.txt") || next; while( ) { $message = $_; } # get only the last post for this thread. fclose(FILE); chomp $message; if( $message ) { ($msub, $mname, $memail, $mdate, $musername, $micon, $mattach, $mip, $message, $mns) = split(/\|/,$message); $mtime = stringtotime($mdate); if( $numfound >= $display && $mtime <= $oldestfound ) { next; } else { $data{$mtime} = [$curboard, $tnum, $treplies, $tusername, $tname, $msub, $mname, $memail, $mdate, $musername, $micon, $mattach, $mip, $message, $mns]; if( $mtime < $oldestfound ) { $oldestfound = $mtime; } ++$numfound; } } } } } $yytitle = $txt{'214'}; print "Content-type: text/html\n\n"; @messages = sort {$b <=> $a } keys %data; if( @messages ) { if( @messages > $display ) { $#messages = $display - 1; } $counter = 1; # Load Censor List &LoadCensorList; } else { print qq~
$txt{'170'}
~; } for( $i = 0; $i < @messages; $i++ ) { ($board, $tnum, $c, $tusername, $tname, $msub, $mname, $memail, $mdate, $musername, $micon, $mattach, $mip, $message, $mns) = @{ $data{$messages[$i]} }; if( $tusername ne 'Guest' ) { &LoadUser($tusername); $tname = exists $userprofile{$tusername} ? $userprofile{$tusername}->[1] : $tname; $tname ||= $txt{'470'}; $tname = qq~$tname~; } if( $musername ne 'Guest' ) { &LoadUser($musername); $mname = exists $userprofile{$musername} ? $userprofile{$musername}->[1] : $mname; $mname ||= $txt{'470'}; $mname = qq~$mname~; } foreach (@censored) { ($tmpa,$tmpb) = @{$_}; $message =~ s~\Q$tmpa\E~$tmpb~gi; $msub =~ s~\Q$tmpa\E~$tmpb~gi; } if($enable_ubbc) { $ns = $mns; &DoUBBC; } if($enable_notification) { $notify = qq~$menusep$img{'notify'}~; } print <<"EOT";
$counter. $boardinfo{$board}->[0] / $msub
EOT ++$counter; } exit; } ############################## END SHOW TOPIC MOD ##################################
YaBB.pl elsif ($action eq 'recent') { require "$sourcedir/Recent.pl"; &RecentPosts; } ######################### START SHOW TOPIC MOD ############################# elsif ($action eq 'recent1') { require "$sourcedir/Recent.pl"; &LastTopics; } ########################## END SHOW TOPIC MOD ##############################