Skip to content

[2.1] Lists ten topic starters in the statistics centre - #9759

Merged
jdarwood007 merged 1 commit into
SimpleMachines:release-2.1from
albertlast:2.1/stats-top-starters-ten
Oct 17, 2026
Merged

jdarwood007 merged 1 commit into
SimpleMachines:release-2.1from
albertlast:2.1/stats-top-starters-ten

Conversation

@albertlast

Copy link
Copy Markdown
Collaborator

Description

Backport of #9725.

The statistics centre counts the twenty members with the most topics, looks up their names, and places each by rank:

$i = array_search($row_members['id_member'], array_keys($members));
// skip all not top 10
if ($i > 10)
	continue;

Two things go wrong:

  • $i > 10 keeps ranks 0 to 10, which is eleven. Every other list on the page has ten.
  • A starter with no member to name leaves an empty rank. Topics credited to member 0 (guests) or to a deleted member are counted, but the name lookup finds nobody, so the list comes out one short.

The two can cancel out: on a forum where one of the top eleven is a guest, the list shows ten. So fixing only the > would leave a gap.

It now takes the members that were found, in rank order, and keeps the first ten.

Testing

Checked on a freshly installed release-2.1 forum, on MySQL 8.4 and PostgreSQL 17, with twelve members holding two topics each:

before after
no guest topics 11 entries 10 entries
guests ranked first 10 entries (the two faults cancel) 10 entries

Nothing in log_errors.

Issues References (Fixes|Related|Closes)

Related: #9753, #9725

🤖 Generated with Claude Code

$i > 10 kept ranks 0 to 10, which is eleven, and a starter with no member
to name (a guest or a deleted member) left its rank empty. The list now
takes the members found, in rank order, and keeps the first ten.

Backport of SimpleMachines#9725.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: albertlast <mathiaspapealbert@hotmail.com>
@live627 live627 added this to the 2.1.9 milestone Oct 8, 2026
@jdarwood007
jdarwood007 merged commit ad5cbea into SimpleMachines:release-2.1 Oct 17, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants