improve get_user_ranks in display_functions.php

Explanation in http://area51.phpbb.com/phpBB/viewtopic.php?f=108&t=46051

Not able to login for ticket
If you change the signature of the method, please create a new one (or ask @Nicofuma to help you) with a `phpbb_` prefix.
We should try to keep this old function working for now.