Creating and Using Avatar Captions

This tutorial explains how to allow your users to create their own unique avatar caption.


This tutorial will walk you through the process of allowing your users to create their own avatar captions on your forum.

To start with, you need to create a new profile field from your MyBB Admin Control Panel.

ACP -> Profile Fields -> Add

Create the new field using this information...

Name: Avatar Caption
Field Type: Textbox
Editable by User?: Yes

All the fields not specified above can be set to whatever you like.

When you have added the profile field, you will be returned to the profile fields section of the ACP. At this point, take note of the the ID number associated with your new \"Avatar Caption\" field. If you have never created a new profile field before, this value will most likely be \'4\', so I will assume that is the case for the rest of this example. If the value is not 4, use that value in place of 4 in the steps below.

If you now take a look at your profile page in the user control panel, you will see a new section for an avatar caption. Set yourself a caption to test that it works.

Now you and your users can specify an avatar caption successfully, but it still doesn\'t show underneath your avatar. To fix that, you need to edit the \"postbit_author_user\" template from the admin control panel.

ACP -> Templates -> Modify / Delete -> *Template Set Name* -> Expand -> Post Bit Templates -> postbit_author_user

Look through that template for the following code.

Code:
{$post[\'useravatar\']}<br />


Once you have found the above line, add this line below it, and save the template. Note that you will have to do this for each template set you use.

Code:
{$post[\'fid4\']}


Obviously, as mentioned before, if the ID of your \"Avatar Caption\" field is anything but \'4\', use that value in place of 4 in the line above.

When you now look at your posts, you should see your cool new avatar caption beneath your avatar.