[solved] Sort CB AUP Medals - newest at last position

More
6 years 7 months ago - 6 years 7 months ago #39238 by Mx150
Hi Support,

can anyone tell me of to sort the output of medals in cb plugin.
The output now is like this:

[newest medal] - [older medal] - [oldest medal]

but i want a output of medal images like this...

[oldest medal]- [older medal] - [newest medal]

So i want that the newest medal always displays at the end. The sort must be from old to new for my community.

Hope for your support.
Best Regards
Last edit: 6 years 7 months ago by nordmograph.

Please Log in or Create an account to join the conversation.

More
6 years 7 months ago #39242 by nordmograph
Hello

Right before
foreach ( $medalslistuser as $medal )
try adding this:
rsort($medalslistuser);

Hope it helps. Let me know.

- Need help? Post the URL of the related page (eventualy as confidential info), it will help solve your issue faster.
- An error, notice or warning? report the exact message including the line number
- If you get a white page , enable error reporting and / or check your server error logs.
The following user(s) said Thank You: Mx150

Please Log in or Create an account to join the conversation.

More
6 years 7 months ago #39260 by Mx150
Hi Adrien,

thanks for the fast reply.

I added the code in plugin around line 157 before foreach ( $medalslistuser as $medal )

The output changes but the first medal is still the last item in the list.
Maybe we can sort it by Points... so lowest medal points get first item.

Thanks for your help.

Please Log in or Create an account to join the conversation.

More
6 years 7 months ago #39286 by Mx150
Any News here?

The Code does not help for me... :-(

Greetings

Please Log in or Create an account to join the conversation.

More
6 years 7 months ago #39287 by nordmograph
Then you can try
$medalslistuser = array_reverse($medalslistuser);

Hope it helps

- Need help? Post the URL of the related page (eventualy as confidential info), it will help solve your issue faster.
- An error, notice or warning? report the exact message including the line number
- If you get a white page , enable error reporting and / or check your server error logs.
The following user(s) said Thank You: Mx150

Please Log in or Create an account to join the conversation.

More
6 years 7 months ago #39288 by Mx150
Exactly :-) This works.

Thanks for the marvelous support as always...

Please Log in or Create an account to join the conversation.

Time to create page: 0.346 seconds
Powered by Kunena Forum
Disclaimer: Nordmograph is not affiliated with or endorsed by The Joomla! Project™. Any products and services provided through this site are not supported or warrantied by The Joomla! Project or Open Source Matters, Inc. Use of the Joomla!® name, symbol, logo and related trademarks is permitted under a limited license granted by Open Source Matters, Inc.