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

Sign In or Register to comment.