Top Threads Mod 1.0 This mod adds a new column with the Top Threads (most active threads) for today, the month and ever CoolMan25 http://www.just-above.de/ Sources/BoardIndex.pl if($Show_RecentBar) { require "$sourcedir/Recent.pl"; &LastPost; } &topthreads; $guests $txt{'141'}, $numusers $txt{'142'}
$users ~;
$guests $txt{'141'}, $numusers $txt{'142'}
$users $tttxt{'01'}
$tttxt{'04'} $linktoday
$tttxt{'03'} $linkmonth
$tttxt{'02'} $linkever
~;
1; 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'}~;} #### } english.lng $txt{'796'} = "Your Instant Messages:"; $tttxt{'01'} = "Top Threads"; $tttxt{'02'} = "ever:"; $tttxt{'03'} = "month:"; $tttxt{'04'} = "today:"; $tttxt{'05'} = "no entrys / no permission"; $tttxt{'06'} = "no entry this month / no permission"; $tttxt{'07'} = "no entry today / no permission";