HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

Avatar First Letter plugin - Does it work with Vanilla 3.x?

This discussion is related to the Avatar First Letter addon.
mikerdsmikerds New
edited February 2020 in Vanilla 3.x Help

I tried to install this plugin, which is exactly what I need but it still showing a default profile picture.

Does it work with Vanilla 3.x?

Is there any way to fix it?



  • Can somebody install it with Vanilla 3.x. and let me know if it works for you? Just to see if it is only my problem or a common problem

    here is the link: https://open.vanillaforums.com/addon/1561/avatar-first-letter

    Thanks a lot!

  • R_JR_J Ex-Fanboy Munich Admin

    Two things...

    The plugin has a line class AvatarFirstLetter extends Gdn_Plugin which needs to be changed to class AvatarFirstLetterPlugin extends Gdn_Plugin. You also need to find the line $rgb = AvatarFirstLetter::stringToColor($name); and change it to $rgb = AvatarFirstLetterPlugin::stringToColor($name); Afterwards it might be needed to delete /cache/addon.php

    Then there is a CSS problem. When you are already editing that plugin, you can also edit the css in the design subfolder. Add something like the below to see some effect

    .DataList .PhotoWrap img,
    .MessageList .PhotoWrap img {
    width:6em !important;

    This is not very clever or elegant or whatever: it was just something that worked when I hacked it into the browser. I guess there is a better style to apply than that....

  • Thank you RJ! I followed your steps and it worked for me! I really appreciate your help.

    This plugin is very good if you want your forum to look more formal. Maybe you should even include it as a part of the standard installation. I think vanilicon icons are too childish for any serious forum (IMHO).

  • RJ, One thing is that it didn't work correctly with this style. I had to change 6em to 20px like this

    .DataList .PhotoWrap img,
    .MessageList .PhotoWrap img {
    width:20px !important;

    in case if somebody wants to use it in the future

  • R_JR_J Ex-Fanboy Munich Admin

    I had thought about rewriting that plugin in the past, because I wanted to try some things. I really do not like those letter avatars, but if they are used, they could be more flexible, I'd say. So I have written my own version of such plugins:

    As you can see, you can

    • use your own SVG for the images if you like
    • use only one or two letters
    • define some palette colors or use random colors

    What i found important has been the letter options. "John Doe" will be "JD" and "John" will either be "J" or "Jo" depending on the settings.

  • It is definitely good to have more options to customize the look. Your plugin is cool! Did you make it available to everyone?

  • R_JR_J Ex-Fanboy Munich Admin

    I have to upload it here to the addon catalogue, but it is already available under the GitHub link above

  • SouthpawKBSouthpawKB Wake County, NC New

    Hi @R_J,

    Are you still supporting your rj-letter-avatar plugin? I installed it, (and prefer it a million times more than the default avatars) but it's causing an error. It very well may be something I've done wrong.

    When a user who does not have an uploaded avatar posts or edits, or when an Admin tries to take bulk actions (like delete) that include a post by a user who does not have an uploaded avatar, this error message appears:

    The action completes (save comment, edit, delete) but nothing on the user's screen changes, so he doesn't think the message saved. He keeps saving and saving and saving and ends up posting about a gazillion times. Any advice?

    And thank you!

  • R_JR_J Ex-Fanboy Munich Admin

    Sorry, I will not fix this. I do not see an obvious error in the plugin which could cause that error. I would have to dig into the source code of Vanilla, maybe even do some debugging to understand again what is going on. That's far more effort than Vanilla is worth for me nowadays, sorry.

    But being asked for advice: either build up some php skills or switch to a end-admin-user-friendly forum. If you try to fix things on your own, search Vanillas source code for "photourl" and watch out for e.g. NULL values where a function might expect an empty string.

    Search the source code for userPhotoDefaultUrl and see what's being passed to that function

Sign In or Register to comment.