Calculation fix for SMF 2.0.19

Started by Max22, March 30, 2022, 04:05:14 PM

Previous topic - Next topic

Max22

The following issue can still be reproduced on 2.0.19 and it's related to the error encountered on Profile.template.php when accessing user statistics:
https://www.simplemachines.org/community/index.php?topic=565120.0

You may want to include this fix in a future SMF 2.0.x patch, it's a very small one and it works fine.

Find:

                                <div class="profile_pie" style="background-position: -', ((int) ($activity['percent'] / 5) * 20), 'px 0;" title="', sprintf($txt['statPanel_topBoards_posts'], $activity['posts'], $activity['total_posts'], $activity['posts_percent']), '">
Replace with:

                                <div class="profile_pie" style="background-position: -', ((int) ($activity['posts_percent'] / 5) * 20), 'px 0;" title="', sprintf($txt['statPanel_topBoards_posts'], $activity['posts'], $activity['total_posts'], $activity['posts_percent']), '">
Note: SMF 2.1 has the fix since 2019.

Advertisement: