MyBB Codes
Group Avatar - Printable Version

+- MyBB Codes (http://www.mybbcodes.com)
+-- Forum: Mods Database (/forumdisplay.php?fid=4)
+--- Forum: Premium Mods (/forumdisplay.php?fid=8)
+---- Forum: Babjusi Plug ins (/forumdisplay.php?fid=48)
+----- Forum: Requests (/forumdisplay.php?fid=49)
+----- Thread: Group Avatar (/showthread.php?tid=1130)


Group Avatar - skiilz - 12-07-2009 01:06 PM

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.


RE: Group Avatar - babjusi - 12-07-2009 01:16 PM

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.


RE: Group Avatar - skiilz - 12-07-2009 01:20 PM

Thank you.
Mhmm.. Just curious, what plugin are you doing?


RE: Group Avatar - babjusi - 12-07-2009 01:54 PM

(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.


RE: Group Avatar - skiilz - 12-07-2009 05:45 PM

Can I put the avatar into another folder?
E.G: images/image.gif


RE: Group Avatar - babjusi - 12-07-2009 05:46 PM

(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.


RE: Group Avatar - skiilz - 12-07-2009 05:55 PM

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?


RE: Group Avatar - babjusi - 12-07-2009 06:00 PM

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.


RE: Group Avatar - roger - 12-08-2009 08:26 PM

I needed this too. I got it to work with the query but a plugin would be swell.


RE: Group Avatar - skiilz - 12-08-2009 09:19 PM

Yes. Would be much better!
But this code work so great too.


RE: Group Avatar - babjusi - 12-09-2009 06:09 AM

Because you guys have been very active I will put this at the top of my to-do list. The only thing is that you will have to come up with the images as when it comes to creating images I am really bad.


RE: Group Avatar - skiilz - 12-09-2009 07:49 AM

What images... I can try but I'm not that good with images too!
But I can try just ask.


RE: Group Avatar - babjusi - 12-09-2009 07:58 AM

I would need the images that will apear as default avatars for the groups.


RE: Group Avatar - skiilz - 12-09-2009 08:59 AM

The user won't be able to add their own?


RE: Group Avatar - babjusi - 12-09-2009 09:00 AM

Yes, they will, but I thought that you wanted an avatar to appear as default for a group?


RE: Group Avatar - skiilz - 12-09-2009 09:10 AM

Yes thats the idea but the user will set the avatar that he want to set as default for a group.


RE: Group Avatar - babjusi - 12-09-2009 09:14 AM

The user can''t do that. I mean he/she can change the avatar but it will affect only his/her and not all the group. Only the admins can change it for the whole group.


RE: Group Avatar - skiilz - 12-09-2009 09:18 AM

The admin will set the avatar for each group so the admin will search and find one that he want to add.


RE: Group Avatar - babjusi - 12-09-2009 09:26 AM

Yes, that is how it is.


RE: Group Avatar - skiilz - 12-09-2009 09:39 AM

So... There is no need to add our image.


RE: Group Avatar - babjusi - 12-09-2009 11:25 AM

I am not sure that I understand. What the default avatar for the groups would be that it will allow you (the admin) to set an image that he wants the membergroups to have as their avatars. Now, if a member will upload his/her own image, then it will reflect only him/her and not the rest of the group. And if members won''t be uploading their custom avatars, the default one will appear. At least that is how I see it.


RE: Group Avatar - skiilz - 12-09-2009 11:28 AM

Yes EXACTLY!


RE: Group Avatar - babjusi - 12-09-2009 11:29 AM

Ah ok then. Because I thought I was misunderstanding you.


RE: Group Avatar - skiilz - 12-09-2009 11:51 AM

You got the right thought!
This plugin will be amazing!


RE: Group Avatar - babjusi - 12-09-2009 01:30 PM

I agree, it will be an handy plugin. I was asking cos I wanted to make sure that I got it right.


RE: Group Avatar - skiilz - 12-09-2009 02:40 PM

No problem. It will be for 1.6 too right?


RE: Group Avatar - babjusi - 12-09-2009 02:52 PM

I think so. I won''t be creating any more plugins until mybb 1.6. stable version is released.


RE: Group Avatar - skiilz - 12-09-2009 05:21 PM

Ok.
Add this one into your to do list!


RE: Group Avatar - roger - 12-09-2009 05:41 PM

This looks like something I could also use. When will MyBB 1.6. be released, do you know?