-
-
Notifications
You must be signed in to change notification settings - Fork 211
Description
Bug Description
For testing purposes using both versions:
{LEVEL=pic}
{LEVEL=glyph}
First user is always correct: (one star both)

Next user shows 11 stars (because there is no image for 11 star it looks like without rank)

Only default ranks are used.
After trying to find a reason, ranks for next users (except first one) are:
[10] => Array
(
[name] => Level 10
[thresh] => 1500
[lan_pfx] => 0
[image] => lev10.png
[id] => 1326
)
[0] => Array
(
[thresh] =>
)
for third one:
[0] => Array
(
[thresh] =>
)
[11] => Array
(
[name_parsed] =>
)
etc...
so this is not correct:
$lastRank = count($this->ranks['data'])
and stars count for default rank is wrong.
After checking the code I noticed:
-
ranks keys for data subarray should be 1 ... 10 - it is correct
-
but foreach for it is going from 0 - 9
for($i=0; $i < $lastRank; $i++) -
check of default level is
- if($level <= varset($this->ranks['data'][0]['thresh']))
but there shouldn't be this value with key 0
I couldn't find a reason why the ranks array was changed, so maybe there is other reason
How to Reproduce
- check some user with first level without any posts etc.. rank 1
Expected Behavior
displaying default level - one star for both shortcodes