Bug fix for the incorrect Best Poster:
Find:
PHP Code:
$j=1;
while ($j<$i) {
if ($counts[$j]>$counts[$j-1]) {
$mposteur=$nom[$j];
$liste[postuserid]=$userid[$j];
}
$j=$j+1;
}
Replace With:
PHP Code:
$j=1;
$max = 0;
while ($j<$i) {
if ($counts[$j]>$max) {
$max = $counts[$j];
$mposteur=$nom[$j];
$liste[postuserid]=$userid[$j];
}
$j=$j+1;
}
The original code put all the posters in an array. Then, it said if poster x had more posts than poster x-1, it was the best poster. This was wrong. A max value had to be set and held. So, The max started out at 0. If poster x had more posts than max, poster x became the best poster and max became the number of posts X had made. It seems to work fine on my forums.
Amy