admin rating badge
Review Request #85 - Created May 16, 2009 and submitted
Information | |
---|---|
Savin Tiberiu | |
infoarena | |
Reviewers | |
hackers | |
Admin rating badges are kind of orange irelevant of their rating.
This looks ok since user_get_by_username is cached.
Can you run the benchmark script before and after this change? It seems to me fetching the user from cache/database again every time you render his rating is a little redundant and on pages such as rankings it's going to slow things down. This should be done be passing an extra is_admin parameter to format_user_{link,tiny,normal} just like with $rating. The information about the user is already being fetched every time before calling these 3 functions, we should just reuse that information. It also seems to me these three functions should have just received a $user object with all the information returned by user_get_by_username so that when any of the format_user_* functions are changed we don't have to search for all their appearances in the code and change what parameters are being passed. If I'm correct all this information is being fetched every time before calling format_user_* anyway.