############################################################################### # News.pl # ############################################################################### # YaBB: Yet another Bulletin Board # # Open-Source Project started by Zef Hemel (zef@zefnet.com) # # Software Version: YaBB 1 Gold - Release # # =========================================================================== # # Software Distributed by: http://yabb.xnull.com # # Support, News, Updates at: http://yabb.xnull.com/community/ # # =========================================================================== # # Copyright (c) 2000-2001 X-Null - All Rights Reserved # # Software by: The YaBB Development Team # ############################################################################### $recentplver="1 Gold - SP1"; $iscomment="Comment"; ###HbBB $iscomment2="Comments"; ###HbBB $showcomments = "View Comments"; $writecomments = "Write Comment"; $display = 10; $archivlink = qq~
Archive
~; sub ShowNews { $currcat = &BoardCatGet($currentboard); $curboard = $currentboard; unless ( $currcat ) { &fatal_error("Cat not found"); } unless( &BoardAccessGet($currentboard) ) { &fatal_error( $txt{'1'} ); } chomp $curboard; fopen(FILE, "$boardsdir/$curboard.txt"); @threads = ; fclose(FILE); 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; @messages2 = ; fclose(FILE); $message = $messages2[0]; chomp $message; if( $message ) { ($msub, $mname, $memail, $mdate, $musername, $micon, $mattach, $mip, $message, $mns, $lastposttime, $lastposter) = split(/\|/,$message); $mtime = stringtotime($mdate); $data{$mtime} = [$curboard, $tnum, $treplies, $tusername, $tname, $msub, $mname, $memail, $mdate, $musername, $micon, $mattach, $mip, $message, $mns, $treplies]; ###HbBB } } @messages2 = sort {$b <=> $a } keys %data; print "Content-type: text/html\n\n"; $showarchiv = 0; if( @messages2 ) { if( @messages2 > $display && $INFO{'archiv'} ne 1) { $#messages2 = $display - 1; $showarchiv = 1; } $counter = 1; # Load Censor List &LoadCensorList; } else { print qq~
No Entries available
~; } if ($INFO{'archiv'} eq 1) { $tmp = $display; } else { $tmp = 0 } for( $i = $tmp; $i < @messages2; $i++ ) { ($board, $tnum, $c, $tusername, $tname, $msub, $mname, $memail, $mdate, $musername, $micon, $mattach, $mip, $message, $mns, $antworten) = @{ $data{$messages2[$i]} }; ###HbBB foreach (@censored) { ($tmpa,$tmpb) = @{$_}; $message =~ s~\Q$tmpa\E~$tmpb~gi; $msub =~ s~\Q$tmpa\E~$tmpb~gi; } if($enable_ubbc) { require "$sourcedir/YaBBC.pl"; &DoUBBC; } fopen(TEMPLATE,"news_template.html") || die("$txt{'23'}: news_template.html"); @news_template =