############################################################################### # BoardIndex.pl # ############################################################################### # YaBB: Yet another Bulletin Board # # Open-Source Community Software for Webmasters # # Version: YaBB 1 Gold - SP 1.1 # # Released: December 2001; Updated March 22, 2002 # # Distributed by: http://www.yabbforum.com # # =========================================================================== # # Copyright (c) 2000-2002 Xnull (www.xnull.com) - All Rights Reserved. # # Software by: The YaBB Development Team # # with assistance from the YaBB community. # ############################################################################### $boardindexplver = "1 Gold - SP 1.1"; sub BoardIndex { #Count Down# require "$sourcedir/countdown.pl"; #Count Down# ##CountDown## open(FILE,"$vardir/countdown.txt"); @cdsettings=; close(FILE); $cdcount=0; foreach $cdsetting (@cdsettings) { $cdcount++; } if ( $cdcount == 0) { $cdname = Event; # Name of event $cdyear = 2002; # Target Year of Countdown $cdmonth = 1; # Target Month of Countdown (in number format) $cdday = 1; # Target Date of Countdown $cdhour = 0; # Target Hour of Countdown (24-hour format) $cdmin = 00; # Target Minute of Countdown $cdsec = 00; # Target Second of Countdown $cdtzone = -0500; } else { $cdname=@cdsettings[0]; $cdyear=@cdsettings[1]; $cdmonth=@cdsettings[2]; $cdday=@cdsettings[3]; $cdhour=@cdsettings[4]; $cdmin=@cdsettings[5]; $cdsec=@cdsettings[6]; $cdtzone=@cdsettings[7]; } ##EndCountDown## # Open the file with all categories fopen(FILE, "$vardir/cat.txt"); @categories = ; fclose(FILE); my($memcount, $latestmember) = &MembershipGet; $totalm = 0; $totalt = 0; foreach $curcat (@categories) { chomp $curcat; fopen(FILE, "$boardsdir/$curcat.cat"); $catname{$curcat} = ; chomp $catname{$curcat}; $cataccess{$curcat} = ; chomp $cataccess{$curcat}; @{$catboards{$curcat}} = ; fclose(FILE); @membergroups = split( /,/, $cataccess{$curcat} ); $openmemgr{$curcat} = 0; 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; ( $threadcount, $messagecount, $lastposttime, $lastposter ) = &BoardCountGet($curboard); $lastposttime{$curboard} = $lastposttime eq 'N/A' || ! $lastposttime ? $txt{'470'} : &timeformat($lastposttime); $lastpostrealtime{$curboard} = $lastposttime eq 'N/A' || ! $lastposttime ? '' : $lastposttime; if( $lastposter =~ m~\AGuest-(.*)~ ) { $lastposter = $1; $lastposterguest{$curboard} = 1; } $lastposter{$curboard} = $lastposter eq 'N/A' || ! $lastposter ? $txt{'470'} : $lastposter; $messagecount{$curboard} = $messagecount || 0; $threadcount{$curboard} = $threadcount || 0; $totalm += $messagecount; $totalt += $threadcount; } } ############################################### #Birthday mod plugin for YaBB 1Gold # # By Max : staff@my.netvigator.com # ############################################### # Only calculate birthdays if display turned on if( $bdayshowtop == '1' || $bdayshowbottom == '1' ) { require "$sourcedir/Subs.pl"; &get_date; &timeformat($date,1); $tocheckm = $mm; $tocheckd = $dd; $yearis = $yy; $whobd = ""; $countbd = 0; ## get the userlist to check fopen(FILE, "$memberdir/memberlist.txt"); @memberlist = ; fclose(FILE); for ($a = 0; $a < @memberlist; $a++) { chomp $memberlist[$a]; if( fopen(FILE2, "$memberdir/$memberlist[$a].dat") ) { # Load users if( !$yyUDLoaded{$memberlist[$a]} && -e("$memberdir/$memberlist[$a].dat") ) { # If user is not in memory, s/he must be loaded. &LoadUser($memberlist[$a]); } @userbd = ; fclose(FILE2); chomp $userbd[16]; ($matchm, $matchd, $useryear) = split(/\//, $userbd[16]); if(($tocheckm == $matchm) && ($tocheckd == $matchd)) { $userbd[6] =~ s/ //g; chomp $userbd[6]; $age = $yearis - $useryear + 2000; $whobg .=qq~$userbd[1] ($age) ~; $countbd++; } }#end if }#end foreach chomp $whobg; if($whobg eq '') { if($mytimeselected == 4) { ($today, $yeartoday, $trash) = split(/,/, $newformat); $today .=qq~,$yeartoday~; } else { ($today, $trash) = split(/ $txt{'107'}/, $newformat); } $whobg = qq~$bday{'07'} $today.~; } } if( $bdayshowtop == '1' && ( $bdayshowguest == '1' || $username ne 'Guest' )) { $yymain .= qq~
$bday{'04'}:  $whobg
~; } ############# /Birthday Mod############# $curforumurl = $curposlinks ? qq~$mbname~ : $mbname; $yymain .= qq~ $curforumurl - Have you filled in your profile?~; if ($showlatestmember) { &LoadUser($latestmember); $yymain .= qq~ ~; } $yymain .= qq~
| Stats | $txt{'488'} $memcount  •  $txt{'489'} $totalm  •  $txt{'490'} $totalt  •  $txt{'201'}: $userprofile{$latestmember}->[1]
~; if ($showlatestmember) { &LoadUser($latestmember); $yymain .= qq~
$txt{'797'}$userprofile{$latestmember}->[1]$txt{'798'}~; } # Begin FTT Corporation language mod &getlngenablenews; if($enable_news2 == 1) { # End FTT Corporation language mod if(!$fadedelay) { $fadedelay = 5000; } $yymain .= qq~
$txt{'102'}
~; } ########showcase poll start # Look for a showcase.poll file. if (-e "$datadir/showcase.poll") { my ($board, $viewnum, $spcomment, $comment1, $comment2, $comment3); fopen (FILE, "$datadir/showcase.poll"); @showdata = ; fclose (FILE); $showcasepoll = $showdata[0]; $showcasepoll =~ s~\n~~g; ($board, $viewnum, $spcomment) = split(/\|/, $showcasepoll); if ($spcomment){ &FromHTML($spcomment); $comment1 = qq~ ~; $comment2 = qq~$scpolltxt{'6'} ~; $comment3 = qq~$spcomment ~; } # Look for a valid poll file. if (-e "$datadir/$viewnum.poll") { $pollthread = 1; unless( &BoardAccessGet($board) ) { $pollthread = 0; } } if ($pollthread) { fopen (FILE, "$datadir/$viewnum.poll"); @polldata = ; fclose (FILE); $pollquestion = $polldata[0]; $pollquestion =~ s~\n~~g; ($question, $lockstatus) = split(/\|/, $pollquestion); $num = 1; $line = 0; my @options; my @votes; foreach $pointer (@polldata) { ($vote, $option) = split(/\|/, $polldata[$num]); $options[$line] = $option; $votes[$line] = $vote; $line++; $num++; } $search = -1; my $found; $usersemail = $settings[2]; $userstatus = $settings[7]; $found = &CheckVoted($viewnum); if ($found) { $userhasvoted = 1; } $viewresults = $INFO{'viewresults'}; if ($lockstatus eq "Locked") { $pollislocked = 1; } my $boardpoll = ''; if ($userstatus eq "Administrator" ) { $boardpoll = qq~$scpolltxt{'2'} ~; $addcmmt = qq~$scpolltxt{'5'} ~; } if ($username ne "Guest" && ($username eq $susername) || ($userstatus eq "Administrator" or $userstatus eq "Global Moderator" or exists $moderators{$username})) { $modifypoll = qq~$img{'modifypoll'} ~; } if (($userstatus eq "Administrator" || $userstatus eq "Global Moderator" || exists $moderators{$username}) && ($pollislocked ne 1)) { $lockpoll = qq~$img{'polliconclosed'} $polltxt{'20'} ~; } if (($userstatus eq "Administrator" || $userstatus eq "Global Moderator" || exists $moderators{$username}) && ($pollislocked eq 1)) { $lockpoll = qq~$img{'polliconclosed'} $polltxt{'21'} ~; } if ($userstatus eq "Administrator"){ $displayvoters = qq~$img{'viewvoters'}~;} $vresults = qq~$polltxt{'19'}~; $vthread = qq~$scpolltxt{'1'}~; if ($pollislocked eq 1) { $endedtext = $polltxt{'22'}; } $poll_icon = qq~$img{'pollicon'}~; if ($pollislocked == 1) { $poll_icon = qq~$img{'polliconclosed'}~; } $yymain.= qq~
 $poll_icon $polltxt{'15'} $endedtext $lockpoll   $displayvoters   $modifypoll
~; # Censor the question. foreach (@censored) { ($tmpa,$tmpb) = @{$_}; $question =~ s~\Q$tmpa\E~$tmpb~gi; } if (($userhasvoted) || $viewresults eq 'yes' || $pollislocked eq 1 ) { $yymain.= qq~ $comment1$comment1$comment2 $comment1$comment1$comment3
$polltxt{'16'}: $question
~; $nums = 0; my $Key; my $Total; $maxvote = 0; foreach $Key (@votes) { $Total += $Key; if ($Key >= $maxvote) { $maxvote = $Key;} } $totalvotes = $Total; pop (@options); foreach (@options) { # Censor the options. foreach (@censored) { ($tmpa,$tmpb) = @{$_}; $options[$nums] =~ s~\Q$tmpa\E~$tmpb~gi; } $message = $options[$nums]; # put the message back into the proper variable to do ubbc on it if(!$yyYaBBCloaded) { require "$sourcedir/YaBBC.pl"; } &MakeSmileys; $options[$nums] = $message; $options[$nums] =~ s~\n~~g; $options[$nums] =~ s~
~~g; $yymain .= qq~ ~; $nums++; } $yymain .= qq~
$options[$nums] ~; # Now lets calculate how many devisions by the total number of votes are needed to make the bar graphs stay nicely sized in the browser window: $pollpercent = 0; $pollbar = 0; if ($totalvotes ne 0 && $maxvote ne 0) { $pollpercent = int(1000 * $votes[$nums] / $totalvotes); $pollpercent = $pollpercent / 10; $pollbar = int( 150 * $votes[$nums] / $maxvote); } $yymain .= qq~   $votes[$nums] ($pollpercent%)

$polltxt{'17'}: $totalvotes
$addcmmt $vthread $boardpoll
~; } else { $yymain.= qq~
$comment1$comment1$comment2 $comment1$comment1$comment3 $comment1$comment1$comment1$comment1
$polltxt{'16'}: $question
~; $nums = 0; pop (@options); foreach (@options) { # Censor the options. foreach (@censored) { ($tmpa,$tmpb) = @{$_}; $options[$nums] =~ s~\Q$tmpa\E~$tmpb~gi; } $options[$nums] =~ s~\n~~g; $options[$nums] =~ s~
~~g; $message = $options[$nums]; # put the message back into the proper variable to do ubbc on it if(!$yyYaBBCloaded) { require "$sourcedir/YaBBC.pl"; } &MakeSmileys; $options[$nums] = $message; $yymain .= qq~ ~; $nums++; } $yymain .= qq~
  $options[$nums]

$vresults \~ $vthread
$addcmmt $boardpoll
~; } $yymain .= qq~
~; } } #########showcase poll end $yymain .= qq~
~; foreach $curcat (@categories) { unless( $openmemgr{$curcat} ) { next; } #### if ($catpic{$curcat} =~ /\//i) {$catpic{$curcat} = qq~ ~;} elsif ($catpic{$curcat}) {$catpic{$curcat} = qq~ ~;} #### $yymain .= qq~~; foreach $curboard (@{$catboards{$curcat}}) { chomp $curboard; # --- Added for Notify Plus 2.2 --- # # Reset Mark-image $markimg = ""; # Is mark board enabled and it's a Member ? if ($enable_mark_board == 1 && $username ne 'Guest') { # Has the member a notification on this board ?! if (fopen(FILE, "$boardsdir/$curboard.mail")) { # Read all records fopen(FILE, "$boardsdir/$curboard.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 board enabled } # --- /Added for Notify Plus 2.2 --- # my $access = &AccessCheck($curboard, ''); if ($settings[7] ne "Administrator" && $access ne "granted" && $showprivboards{$curboard} ne "1") {next;} fopen(FILE, "$boardsdir/$curboard.dat"); $curboardname = ; chomp $curboardname; $curboarddescr = ; chomp $curboarddescr; $curboardmods = ; chomp $curboardmods; fclose(FILE); # Begin FTT Corporation language mod &getlngboard; # End FTT Corporation language mod %moderators = (); foreach $curuser (split(/\|/, $curboardmods)) { &LoadUser($curuser); $moderators{$curuser} = $userprofile{$curuser}->[1]; } $showmods = ''; if(scalar keys %moderators == 1) { $showmods = qq~$txt{'298'}: ~; } elsif(scalar keys %moderators != 0) { $showmods = qq~$txt{'299'}: ~; } while($tmpa = each(%moderators)) { &FormatUserName($tmpa); $showmods .= qq~$moderators{$tmpa}, ~; } $showmods =~ s/, \Z//; if($showmods eq "") { $showmods = qq~$txt{'298'}: $txt{'470'}~; } $dlp = &getlog($curboard); if( $max_log_days_old && $lastposttime{$curboard} ne $txt{'470'} && $username ne 'Guest' && $dlp < stringtotime( $lastpostrealtime{$curboard} ) ) { $new = qq~$txt{'333'}~; } else { $new = qq~$txt{'334'}~; } $lastposter = $lastposter{$curboard}; unless( $lastposterguest{$curboard} || $lastposter{$curboard} eq $txt{'470'} ) { $lastposterid = $lastposter; &LoadUser($lastposterid); if($userprofile{$lastposter}->[1]) { $lastposter = qq~$userprofile{$lastposter}->[1]~; } } $lastposter ||= $txt{'470'}; $lastposttime ||= $txt{'470'}; ####################Active Users#################### #Edit of StarSabers "Active users in this forum" # #Thanks to Hiryuu for testing # #################################################### # Start Active users in this forum mod $hidecount{$curboard} = 0; $membercount{$curboard} = 0; fopen(FILE, "$vardir/log.txt"); @entries = ; fclose(FILE); foreach $curentry (@entries) { chomp $curentry; ($name, $logdate, $boardnow, $hide) = split(/\|/, $curentry); if ($name) { &LoadUser($name); if( exists $userprofile{$name} ) { if ( $boardnow eq $curboard && $hide eq 0) { ++$membercount{$curboard}; } elsif( $boardnow eq $curboard && $hide eq 1) { ++$hidecount{$curboard}; } else { ++$guests; } } } } # Mod Finished Active users in this forum mod ###################/Active Users################### #Edit of StarSabers "Active users in this forum" # #Thanks to Hiryuu for testing # ################################################### #### $boardpic = ""; if (-e "$boardsdir/$curboard.mbo" ) { require "$boardsdir/$curboard.mbo"; } if ($boardpic{$curboard} =~ /\//i) {$boardpic{$curboard} = qq~ ~;} elsif ($boardpic{$curboard}) {$boardpic{$curboard} = qq~ ~;} my $cookiename = "$cookiepassword$curboard"; my $crypass = crypt($boardpw{$curboard},$pwseed); my $boardpwpic = ""; if ($settings[7] ne "Administrator" && $boardpw{$curboard} && $yyCookies{$cookiename} ne $crypass) {$boardpwpic = qq~~;} elsif ($boardpw{$curboard}) {$boardpwpic = qq~~;} #### $yymain .= qq~~; } } my $checkadded = 0; $guests = 0; $users = ''; $numusers = 0; fopen(FILE, "$vardir/log.txt"); @entries = ; fclose(FILE); foreach $curentry (@entries) { chomp $curentry; ($name, $value) = split(/\|/, $curentry); if($name) { if(!$yyUDLoaded{$musername}) { &LoadUser($name); } if(exists $userprofile{$name}) { $numusers++; $users .= qq~ $userprofile{$name}->[1], \n~; } else { $guests++; } } } $users =~ s~, \n\Z~~; if($username ne 'Guest') { $ims = @immessages; ### LIMITED IM MOD ### if($userimcfg[5] eq "on") { $yymain .= qq~~; } else { $yymain .= qq~~; } if ($minnum > $numibox && $numibox ne "" && $enable_imlimit == 1) { $yymain .= qq~~; &Del_Max_IM; } if ($moutnum > $numobox && $numobox ne "" && $enable_imlimit == 1) { $yymain .= qq~~; &Del_Max_IMOUT; } if ($storenum > $numstore && $numstore ne "" && $enable_imlimit == 1) { $yymain .= qq~~; &Del_Max_STORE; } $ims = qq~
$txt{'796'} $ims $imtxt{'24'}: $imnewcount~; ### END LIMITED IM ### $yymain .= qq~
~; } $yymain .= qq~
$txt{'20'} $txt{'330'} $txt{'21'} $txt{'22'}
$catpic{$curcat}$catname{$curcat}
$new $markimg $boardpic{$curboard}$curboardname $boardpwpic
$curboarddescr
$showmods
• Active: $users
$threadcount{$curboard} $messagecount{$curboard} $lastposttime{$curboard}
$txt{'525'} $lastposter
$txt{'333'} $txt{'333'}   $txt{'334'} $txt{'334'}   ~; if($showmarkread) { $yymain .= qq~$img{'markallread'}~; } $yymain .= qq~


~; $yymain .= qq~~; ########chat insertion########### require "$vardir/ChatSettings.txt"; chomp $chatgroup; @chatgrouplist = split(",",$chatgroup); $chatgroupflag = 0; foreach $chatgroupitem (@chatgrouplist) { if ($settings[7] eq $chatgroupitem) { $chatgroupflag = 1; } } if ($chatopen == 1 || $settings[7] eq 'Administrator' || $chatgroupflag == 1 ) { $yymain .=qq~ ~; } ########chat ended############ if( $bdayshowbottom == '1' && ( $bdayshowguest == '0' || $username ne 'Guest' )) { $yymain .= qq~ ~; } ########### Newcalendar mod start ####################### if ($newcalopen == 1 || $settings[7] eq 'Administrator' || $settings[7] eq $newcalgroup ) { if ($newcalmoon2 == 1) { require "$sourcedir/MoonPhase.pl"; #This is the moon phase calculator ( $MoonPhase, $MoonIllum, $MoonAge, $MoonDist, $MoonAng, $SunDist, $SunAng ) = phase(); my ($newphaselow) = 0.016666667; my ($newphasehigh) = 0.983333333; my ($phaseincrement) = 0.033333333; if ( ($MoonPhase < $newphaselow) || ($MoonPhase > $newphasehigh) ){ $moonpict = qq~~; } else { $gifnumber = 1; for ($phasescan = $newphaselow; $phasescan < $newphasehigh; $phasescan += $phaseincrement) { if ( ($MoonPhase > $phasescan) && ( $MoonPhase <= ($phasescan + $phaseincrement)) ){ if ($gifnumber < 10) { $moonpict = qq~~; } else { $moonpict = qq~~; } } $gifnumber++; } } } else { $moonpict = qq~~; } $yymain .=qq~ ~; } ########### Newcalendar mod end ####################### if($username eq 'Guest') { require "$sourcedir/LogInOut.pl"; $sharedLogin_title="$txt{'34'} ($txt{'315'})"; &sharedLogin; } #Count Down# &cdboard; $yymain .= qq~
$txt{'685'}
$txt{'200'}
~; &getlangmenu; $yymain .= qq~ $langdd
$txt{'490'} $totalt   -   $txt{'489'} $totalm ~; if($Show_RecentBar) { require "$sourcedir/Recent.pl"; &LastPost; } &topthreads; require "$sourcedir/Todays.pl"; &TotalToday; $yymain .= qq~
Errors Today: $numfound
$txt{'488'} $memcount ~; if ($showlatestmember) { &LoadUser($latestmember); $yymain .= qq~
$txt{'201'}: $userprofile{$latestmember}->[1]~; } open(FILE,"$vardir/usertoday.txt"); @utoday=; close(FILE); $usertodaycount = @utoday; $usertoday = ''; for($a=1;$a < $usertodaycount;$a++) { $utoday[$a] =~ s/\n//gi; $name = $utoday[$a]; if($useraccount{$name} eq ''){&LoadUser($name);} $usertoday .= qq~$userprofile{$name}->[1], ~; if($name eq $username){$Inserted = 'true';} } $usertodaycount = $usertodaycount-1; if($utoday[0] != $mday) { open(FILE,">$vardir/usertoday.txt"); print FILE "$mday\n"; if($username ne 'Guest') { print FILE "$username\n"; } fclose(FILE); } elsif($username ne 'Guest' && $Inserted ne 'true') { open(FILE,">>$vardir/usertoday.txt"); print FILE "$username\n"; fclose(FILE); } $yymain .= qq~ $ims
$txt{'158'}
$guests $txt{'141'}, $numusers $txt{'142'}
$users
$uttxt{'1'} $usertodaycount $uttxt{'2'} $usertoday $uonline
$tttxt{'01'}
$tttxt{'04'} $linktoday
$tttxt{'03'} $linkmonth
$tttxt{'02'} $linkever
$chadmtxt{'7'}
~; $cguests = 0; $cusers = ''; open(OF,"$vardir/online.txt") or dienice ("Can't open file: $!"); @ary = ; close(OF); foreach $line (@ary) { chomp($line); ($of,$name,$ip,$displayname,$level,$time,$non7,$non8,$non9,$non10,$non11) = split(/°¸/,$line); if( $name ) { if( exists $userprofile{$name} ) { $cusers .= qq~ \n$displayname,\n~; } else { ++$cguests; } } } $yymain .=qq~ $cusers
~; $windowname=$mbname; $windowname=~ s/ //g; $windowname=~ s/\W//g; if ($password eq ""){ if ($enable_guestposting == 0){ $yymain .=qq~$chadmtxt{'8'}~; } else { $yymain .=qq~$chadmtxt{'9'}$cguests
\n
$chadmtxt{'10'}~; } } elsif ($password ne "") { if ($enable_guestposting == 1){ $yymain .=qq~$chadmtxt{'9'}$cguests
~; } $yymain .=qq~
$chadmtxt{'10'}~; } $yymain .=qq~
» $bday{'04'}:
$bday{'08'}  $whobg
$ecaltxt{'55'}
$moonpict
~; require "$sourcedir/Newcalendar.pl"; &IndexCal; $yymain .=qq~
~; &member_of_the_day; if($imnewcount > 0 && $enable_mailpopup == 1) { if($imnewcount > 1) { $en = "s"; $en2 = "$imtxt{'47'}"; } else { $en = ""; $en2 = "$imtxt{'48'}"; } open(FILE, "$memberdir/$username.imconfig"); @imuserdata = ; close(FILE); chomp($imuserdata[3]); chomp($imuserdata[5]); if($imuserdata[3] eq "on") { if($imuserdata[5] eq "on") { $yymain .= qq~ ~; } else { $yymain .= qq~ ~; } $yymain .= qq~ ~; } } $yytitle = "$txt{'18'}"; &template; exit; } sub MarkAllRead { fopen(FILE, "$vardir/cat.txt"); my @categories = ; fclose(FILE); my( $curcat, $curcatname, $curcataccess, @catboards, @membergroups, $openmemgr, $curboard ); foreach $curcat (@categories) { chomp $curcat; fopen(FILE, "$boardsdir/$curcat.cat"); $curcatname = ; $curcataccess = ; chomp $curcatname; chomp $curcataccess; @catboards = ; fclose(FILE); @membergroups = split( /,/, $curcataccess ); $openmemgr = 0; foreach (@membergroups) { if( $_ eq $settings[7]) { $openmemgr = 1; last; } } if(!$curcataccess || $settings[7] eq 'Administrator') { $openmemgr = 1; } unless( $openmemgr ) { next; } foreach $curboard (@catboards) { chomp $curboard; &modlog("$curboard--mark"); &modlog($curboard); } } &dumplog; &BoardIndex; } sub topthreads { ### topthread ever opendir (DIR,"$datadir"); @dirdata2 = readdir(DIR); closedir (DIR); @datei = grep(/\.txt/,@dirdata2); foreach $test (@datei){ open(FILE,"$datadir/$test") or die "Fehler $!"; @test = ; close(FILE); $laenge = @test; $doit{$test} = $laenge; } #### top thread month and day foreach $spezi (@datei){ open(FILE,"$datadir/$spezi") or die "Fehler $!"; @test3 = ; close(FILE); foreach $supi2 (@test3){ ($x, $y, $z, $time, $u, $v, $w, $r, $s, $t) = split(/\|/,$supi2); ($date4,$time4) = split(/ /,$time); ($monthit, $dayit, $yearit) = split(/\//,$date4); $spezi =~ s/\.txt//gi; push @monthsgo, "$monthit|$yearit"; push @time2, $date4; push @threadit2, $spezi; push @threadit4, $spezi; } } for (0..$#time2){if (exists $makeit{$time2[$_]}){push @{$makeit{$time2[$_]}},$threadit2[$_];}else{@{$makeit{$time2[$_]}}=$threadit2[$_]}} for (0..$#monthsgo){if (exists $makedown{$monthsgo[$_]}){push @{$makedown{$monthsgo[$_]}},$threadit4[$_];}else{@{$makedown{$monthsgo[$_]}}=$threadit4[$_]}} &get_date; ($date3, $f) = split(/ /, $date); ($monthgo, $daygo, $yeargo) = split(/\//, $date3); chomp @{$makeit{"$date3"}}; chomp @{$makedown{"$monthgo|$yeargo"}}; @daten = sort {$a <=> $b} @{$makeit{"$date3"}}; @monthdat = sort {$a <=> $b} @{$makedown{"$monthgo|$yeargo"}}; foreach (@daten){ $anzahl{$_}++; } foreach (sort {$anzahl{$b} <=> $anzahl{$a}} keys %anzahl) { push @sort_data, $_ } foreach (@monthdat){ $anzahl2{$_}++; } foreach (sort {$anzahl2{$b} <=> $anzahl2{$a}} keys %anzahl2) { push @monthsdat, $_ } ##### #boardprüfung - threadzuordnung opendir (DIR,"$boardsdir"); @dirdata = readdir(DIR); closedir (DIR); @datei2 = grep(/\.txt/,@dirdata); foreach $mega (@datei2){ open(FILE,"$boardsdir/$mega") or die "Fehler $!"; @mega = ; close(FILE); foreach $supi (@mega){ ($num, $a, $b, $c, $d, $e, $f, $g, $h) = split(/\|/,$supi); $mega =~ s/\.txt//gi; push @board2, $mega; push @num2, $num; } } $hasit{$num2[$_]}=$board2[$_] for (0..$#num2); ###### wer mit wem prüfung ;) ### fopen(FILE, "$vardir/cat.txt"); @categories = ; fclose(FILE); chomp @categories; foreach $catit (@categories){ open (FILE,"$boardsdir/$catit.cat") or die "haha!"; @all = ; close (FILE); $hehe2{$catit} = $all[1]; @all2 = @all; @weg2 = splice(@all2,0,2); for (0..$#all2) {$goit{$all2[$_]} = $catit } } foreach (sort {$doit{$b} <=> $doit{$a}} keys %doit){ $tra = $_; $tra =~ s/\.txt//gi; $boarddayt = $hasit{$tra}; $boarddayu = $goit{$boarddayt}; chomp $hehe2{$boarddayu}; if ($hehe2{$boarddayu} eq "") {$most = $_; last;} if ($settings[7] eq $hehe2{$boarddayu}){$most = $_; last; } if ($settings[7] eq "Administrator"){$most = $_; last;} } foreach $todayt (@sort_data){ $board3t = $hasit{$todayt}; $board3u = $goit{$board3t}; chomp $hehe2{$board3u}; if ($hehe2{$board3u} eq "") {$todaysactive = $todayt; last;} if ($settings[7] eq $hehe2{$board3u}){$todaysactive = $todayt; last;} if ($settings[7] eq "Administrator"){$todaysactive = $todayt; last;} } foreach $monthtop (@monthsdat){ $board3m = $hasit{$monthtop}; $board3n = $goit{$board3m}; chomp $hehe2{$board3n}; if ($hehe2{$board3n} eq "") {$monthsactive = $monthtop; last;} if ($settings[7] eq $hehe2{$board3n}){$monthsactive = $monthtop; last;} if ($settings[7] eq "Administrator"){$monthsactive = $monthtop; last;} } $linkit = $most; $linkit =~ s/.txt//gi; $board3 = $hasit{$linkit}; $boardday = $hasit{$todaysactive}; $boardmon = $hasit{$monthsactive}; #### get threads if ($most ne ""){ open(FILE,"$datadir/$most") or die "Fehler $!"; $test4 = ; close(FILE); ($show) = split(/\|/, $test4); $linkever = qq~$show~; } else{ $linkever = qq~$tttxt{'05'}~;} if ($todaysactive ne ""){ open(FILE,"$datadir/$todaysactive.txt") or die "Fehler $!"; $test5 = ; close(FILE); ($show2) = split(/\|/, $test5); $linktoday = qq~$show2~; } else{$linktoday = qq~$tttxt{'07'}~;} if ($monthsactive ne ""){ open(FILE,"$datadir/$monthsactive.txt") or die "Fehler $!"; $test6 = ; close(FILE); ($show3) = split(/\|/, $test6); $linkmonth = qq~$show3~; } else{$linkmonth = qq~$tttxt{'06'}~;} #### } 1;