Board Thread:General Coding Help/@comment-10696822-20161027171802/@comment-4018164-20161028065849

I think he's talking about the line containing

You should really use Wikia's API to get avatars, rather than loading the userpage of every user for the sake of one line with the avatar URL. Static Whisper has recently made a script to do that- User Avatar Finder- so you can import it to your wiki- all you have to do is adapt your template to it. Now, it wouldn't work with your  switch, but it shouldn't be a problem to use the code and make some changes to make it support it.

If you want the full instructions of how to import avatars, here's how to do that: By the way, by the look of the code's functionality, you should probably create a local object for users like so: And pass to it before getting the avatars the list of  elements that use that user. This way, if you're in step 4, you can check which elements of the wanted users need to be updated, immediately replace them with the corresponding avatar, and remove updated elements from that list.
 * 1) Load MediaWiki's users api with the list of users, separated by a pipe sign (|) and then encoded using  (example)
 * 2) Go through  (an array), and for each item, save the   property somewhere- that's the ID of a given user in the list, and you'll need it for the next step
 * 3) *Make sure to ignore users without the - these users either do not exist or have been disabled and had their account terminated
 * Now, use Wikia's user API to get the avatars of the wanted users. Pass to it the list of user ids, comma-separated, as well as the desired avatar size (default is 100px, but since you're using the userpage avatars, you might wanna set it to 150) (example)
 * 1) Go through  (an array), and for each item, use the   property. The user object also contains stuff like the username, user page URL and user id, if for some reason you want to use them.

So with the above code, if you have- say- 50 users, you don't have to load 50 userpages, but make one request to MediaWiki's API (to get the user ids) and a second request to Wikia's API (to get the avatars, based on the user ids).