Rebuild Members list Sort Order fix Sp1/1.1 1.1 When you use the "Rebuild Members list", your members are sorted alphabetically by username instead of in the order they joined the forum. This mod corrects that. Thanks to Gekko for Bug Testing. BHRA Webmaster http://www.bhra.org.uk ############################################################################### english.lng $txt{'595'} = "Note: this will sort the list and the newest member will be the last entry after sorting."; $txt{'595'} = "Note: this will sort the members into the order they joined the forum with the latest member last."; ############################################################################### Sources/Admin.pl sub RebuildMemList { &is_admin; opendir(DIR, "$memberdir") || die "$txt{'230'} ($memberdir) :: $!"; @contents = readdir(DIR); closedir(DIR); fopen(MEMLIST, ">$memberdir/memberlist.txt", 1); foreach $line (sort @contents){ $line =~ m~(.+)\.(.+)~; if ($2 eq 'dat'){ print MEMLIST "$1\n"; } } fclose(MEMLIST); $yymain .= qq~$txt{'594'}~; $yytitle = "$txt{'593'}"; &template; exit; } sub RebuildMemList { &is_admin; opendir(DIR, "$memberdir") || die "$txt{'230'} ($memberdir) :: $!"; @contents = readdir(DIR); closedir(DIR); my ($dates, $times, $month, $day, $year, $hour, $min, $sec, $number1, $number2, $days_reg); my @tmplist = grep(/\.dat$/,@contents); $memcount = @tmplist; ($dates, $times) = split(/ $txt{'107'} /, $date); ($month, $day, $year) = split(/\//, $dates); ($hour, $min, $sec) = split(/\:/, $times); $number2 = ($year*365) + ($month*30) + $day + ($hour/24) + ($min/1440) + ($sec/86400); for($i=0;$i<$memcount;$i++) { fopen(MEMBERFILE,"$memberdir/$tmplist[$i]"); @member = ; fclose(MEMBERFILE); chomp @member; ($dates, $times) = split(/ $txt{'107'} /, $member[14]); ($month, $day, $year) = split(/\//, $dates); ($hour, $min, $sec) = split(/\:/, $times); $number1=($year*365)+($month*30)+$day+($hour/24)+($min/1440)+($sec/86400); if ($number1 > $number2) { $days_reg = $number2 - $number1 + 36500; } else { $days_reg = $number2 - $number1; } $tmplist[$i] =~ s/\.dat$//ig; $tmplist[$i] = $days_reg."|".$tmplist[$i]; } fopen(MEMLIST, ">$memberdir/memberlist.txt", 1); foreach $line (sort {$b <=> $a} @tmplist ){ ($dummy, $line) = split(/\|/,$line); print MEMLIST "$line\n"; } fclose(MEMLIST); $yymain .= qq~$txt{'594'}~; $yytitle = "$txt{'593'}"; &template; exit; }