Currently I am developing the widget to show most active users per time interval (release soon).
For this I would like to show not only numbers (1., 2., 3. place) but also the avatar images of the users.
What code do I need to get the image links of the user avatars? In other words: How to use qa_get_user_avatar_html properly?
The function is: function qa_get_user_avatar_html($flags, $email, $handle, $blobid, $width, $height, $size, $padding=false)
So can I call the function with: $handle = "theusername"; $avatarImage = qa_get_user_avatar_html(NULL, NULL, $handle);
?
This is what works (I have an associative array of usernames and go over them): foreach ($users as $username => $val) { $user = qa_db_select_with_pending( qa_db_user_account_selectspec($username, false) ); $avatarImages[$username] = qa_get_user_avatar_html($user['flags'], $user['email'], $user['handle'], $user['avatarblobid'], $user['avatarwidth'], $user['avatarheight'], qa_opt('avatar_users_size'), true); }
And I output the username besides each image using (in another foreach):
$topusers .= "<li>".$avatarImages[$key]." ".qa_get_one_user_html($key, false) ."</li>";
I guess this is the correct way to do it.
Welcome to the Q&A site for Question2Answer.
If you have a question about Q2A, please ask here, in English.
To report a bug, please create a new issue on Github or ask a question here with the bug tag.
If you just want to try Q2A, please use the demo site.