Getting user avatars is now easier than ever

Getting user avatars is now easier than ever

Say goodbye to those annoying work-arounds.

Recent changes by Wikidot to the way user avatars are stored means that we can now get a user's avatar without having to resort to exotic server-side or javascript based solutions. Avatars are available at the following url:

// Full size version
http://www.wikidot.com/avatar.php?userid=YOUR-ID

// 16 x 16px version
http://www.wikidot.com/avatar.php?userid=YOUR-ID&size=small

So to use that in an image tag on a live template, all you need to do is:
[[image http://www.wikidot.com/avatar.php?userid=%%created_by_id%% width="40px" height="40px"]]

Thank you Wikidot.

Enjoy the article? Tweet it!

tags — avatar images

Discussion - 4 comments

tsangk avatar

Anonymoustsangk 04 Oct 2011 08:22

Agreed! The changes have caused my work around scrips to fail…
I have still updated my grabber script for backward-compatibility.
In the (now rare) case where only the user's username is provided, my scripts are still useful :)

Edit

Timothy Foster avatar

AnonymousTimothy Foster 05 Oct 2011 01:41

Excellent. This will be quite useful!

Edit

tsangk avatar

Anonymoustsangk 06 Oct 2011 01:07

Bryce, on your home page - it says that this post has 1 comment instead of 2 (now 3)

Edit

bcammo avatar

Anonymousbcammo 06 Oct 2011 07:19

It's a Wikidot bug. %%children%% is sometimes *very* slow to update when used in ListPages.

Edit

Add a new comment

Site design © BMC WebDesign, 2011. All rights reserved. All tutorials on this site are free for commerical use, subject to conditions outlined in the disclaimer.