MyBB Codes

Full Version: Group Avatar
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3
Can anyone make a plugin that allow you to set for each group the default avatar?
Like when the member is placed in the group he will get the avatar for the group that he is inside.

Thank you.
Yes, it can be done. Atm I am in process in finishing a new plugin. Later on I will have a look at this and let you know.
Thank you.
Mhmm.. Just curious, what plugin are you doing?
(12-07-2009 01:20 PM)Light33 Wrote: [ -> ]Thank you.
Mhmm.. Just curious, what plugin are you doing?

The one that I just submitted about not bumping up old threads.

To your request, as I said it can be done as a plugin but that would require some time and atm my free time is very limited. But I will tell you another way which is easy and handier.

Here is what you should do.

Go to the phpmyadmin at the cp of your host and then at the db where your forum resides on. Make a backup copy of your mybb_users table and then run the following query at the SQL tab.

PHP Code:[Highlight]
UPDATE mybb_users SET avatar 'images/avatars/image.gif',  avatartype 'gallery'avatardimensions '100|100' WHERE usergroup '4'

Don''t forget to replace the image.gif with the actual name of your avatar image and to upload it at the ''avatars'' folder in the /images/ directory.

This will set a default avatar for all the members in the admin group. To do it for other groups, you can add more of Set avatar..... Where usergroups.... statements separated by commas, or run the query individualy by replacing the usergroup = '4' with the other group id''s that you want to hook them with up a default avatar.

Let me know how it will go.
Can I put the avatar into another folder?
E.G: images/image.gif
(12-07-2009 05:45 PM)Light33 Wrote: [ -> ]Can I put the avatar into another folder?
E.G: images/image.gif

Sure, you can put the avatar where ever you want, but you must specify the correct path at the query.
This was the code I used and worked like a charm.

UPDATE mybb_users SET avatar = 'images/banned.png',  avatartype = 'gallery' WHERE usergroup = '7';

So... You won't make the plugin for this?
Glad to hear that it worked.

No, cos my free time atm is very limited. I don''t have as much free time as I would have liked. But I don''t see why you would need a plugin for this when you can achive what you want very easily with just a few queries.
I needed this too. I got it to work with the query but a plugin would be swell.
Yes. Would be much better!
But this code work so great too.
Pages: 1 2 3
Reference URL's