MyBB Community Forums

Full Version: Replacing user avatar with other data.
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Instead of having the user's avatar on profiles, in posts, and so on, I need a way to place other data, based on the user's User ID. I know how I plan to generate the data. I just need to know how to go about actually implementing this.

Example #1
Profile
User ID 2480
Instead of loading their avatar, open a file that contains a list of which avatars which users are using (ordered background, character). Go to line 2480 (the User ID). Fetch which background and character to use. Draw the images accordingly. This, I can do. I just need to know how to get the User ID and place this custom data in place of the avatar.

Example #2
Forum Post
User ID 2480
The same is done here, but based on the User ID of the post instead of the User ID of the profile.

How would I go about doing this? Thank you!
$memprofile['uid'] is used for accessing the uid on profile, and $post['uid'] for posts.
Thank you for the variables I need. (Reputation + 1.) How do I modify these so they use custom data in the profile and posts, though?
You can use the MyBB plugins system; are you familiar with it?
Not at all. Do you have a link to this system, or is it built into the forum software and can be modified from the Administrator Panel?

Sorry for the double post, but this is a worthy update.

function pluginname_activate()
{
global $db;
require MYBB_ROOT.'/inc/adminfunctions_templates.php';
find_replace_templatesets(
"index",
'#'.preg_quote('{$boardstats}').'#',
'{$boardstats}{$randomvar}'
);
}

On this page: http://docs.mybb.com/Changing_Templates.html

This may be what I need. How would I modify this code so it replaces all occurrences of the $memprofile['avatar'] and $post['avatar'] variables with my print_avatar_code($x, $y); function?