PDA

View Full Version : Allow ONLY mods and admins to use custom avatars


Chen
09 Aug 2001, 17:22
My mods have been bugging me for ever that they want custom avatars, just like they have custom user titles.

This hack is really simple, won't take you more than 5 minutes. :)

1. In member.php find
if ($bbuserinfo[userid]==0) {
show_nopermission();
}

$avatarchecked[$bbuserinfo[avatarid]]="checked";
and add this right after:
if (ismoderator()) {
$avatarcustomposts = 0;
}

2. In the same file replace this:
if ($bbuserinfo[userid]==0) {
show_nopermission();
}

$useavatar=iif($avatarid==-1,0,1);
and add this right after:
if (ismoderator()) {
$avatarcustomposts = 0;
}

And that's it! :D

Have fun. :)

Dakota
09 Aug 2001, 18:34
Thanks this is a nice hack. Something I have been wanting and should be included with vB.

spazeman
05 Mar 2002, 06:16
so how does it work? I installed it and all users seem to still have avatars??

M.Smith
05 Mar 2002, 14:11
its made so it still works for people that have the right amount of post counts

Rose
21 Mar 2002, 00:45
Firefly -

Okay, I've made the changes. Now what? Do I have to turn on "upload/www avatars" in the CP? I can't seem to get it to work just so that only mods/admin/heads have av uploading, but NOT the members. :s

Chen
21 Mar 2002, 06:47
Yes turn that on, but make the required post number realllllllllllllllllllly high.

Rose
21 Mar 2002, 13:49
Originally posted by FireFly
Yes turn that on, but make the required post number realllllllllllllllllllly high.



When I tried all that, I got it to show up okay for mods/admin/heads and not for members. So the first step is good. BUT! When I tried to upload an avatar using the upload or link box, it didn't take. It simply changed my av to the first avatar in the gallery list. This was tested by myself (admin) and a moderator, with the same results.

I'll mess with it some more today, since I gave in in frustrations last night. *lol* But do you have any ideas why it won't save?

{edited to say} - When I click upload from my pc, I get a "no valid avatar" error.

Chen
21 Mar 2002, 13:58
Ok I updated the file for 2.2.4, because the hack is VERY old and only works on 2.0.3. So uninstall and install it again.

Rose
21 Mar 2002, 14:14
Originally posted by FireFly
Ok I updated the file for 2.2.4, because the hack is VERY old and only works on 2.0.3. So uninstall and install it again.


:) Thanks for updating it, Chen. But I still get the same errors. For myself, I get an approval for changing my avatar, but it doesn't change if I do upload from pc. If I use a link, it defaults to the first av in the gallery.

My mods get the error "no specified avatar" when using the upload option, and the frist av default when changing the other way.

Chen
21 Mar 2002, 14:20
Damnit so many things have changed. :p
I'll look again... *sigh*

Rose
21 Mar 2002, 14:23
Originally posted by FireFly
Damnit so many things have changed. :p
I'll look again... *sigh*


:: giggles :: You are the bestest! ;)

Chen
21 Mar 2002, 14:25
Ok I totally changed the hack, uninstall it and install the new one. :)

Matt
21 Mar 2002, 14:40
I am gonna try installing again now too!

God you are a pain Rose ;)

Rose
21 Mar 2002, 14:51
:p Shut up, Matt. Who invited you here. ;) :D


It works!!!!!



*big huggles for Chen* Thanks, mate! :D

Matt
21 Mar 2002, 14:53
Yup, it does work! Thank You!!! :D :D

And I thought Roses were sweet...and red ;)

Rose
21 Mar 2002, 15:14
Originally posted by Matt
Yup, it does work! Thank You!!! :D :D

And I thought Roses were sweet...and red ;)


Thanks again, Chen!!! This is something we've been waiting for for a year now! *looks to Matt* ;)


And yes, it should be red. *sigh* *goes to change av, now* ;) But I won't spam, so....



Thanks again!

;) This would be a great feature in v3. *hint*

ptbyjason
21 Mar 2002, 18:40
Is there anyway to allow 1 other custom usergroup besides mods and admins to be able to do this?

Chen
21 Mar 2002, 18:50
Yes, instead of adding the code I give in my first post, add this:
if (ismoderator() or $bbuserinfo['usergroupid']==X) {
$avatarcustomposts = 0;
}
(change X to the ID of that other group)

ptbyjason
21 Mar 2002, 20:03
ahhhh, I knew it had to be something simple like that, thanks Chen!

Rose
22 Mar 2002, 02:46
Edited to say: The admins are happy as is. :D Yay!

WitchyT
28 Jul 2002, 03:15
Great hack :D. One question: Is there any way of letting the mods and admins only change their avs once per week?

Rose
03 Aug 2002, 17:05
Originally posted by WitchyT
Great hack :D. One question: Is there any way of letting the mods and admins only change their avs once per week?


That would be useful, I think. But if members are allowed to change their avatars anytime, why not mods/admin as well?

N9ne
24 Oct 2002, 19:30
Thanks for this hack!

LordZypher
26 Oct 2002, 04:07
Curious... Where do I get the Usergroup ID? From the SQL Tables or the admin panel somewhere...

LordZypher
26 Oct 2002, 04:47
Ok I figured out how to get the id but its not working for me.. Can someone please help me to understand this..

in step 2 you said

2. In the same file replace this:

code:
if ($bbuserinfo[userid]==0) {
show_nopermission();
}

$useavatar=iif($avatarid==-1,0,1);



and add this right after:

code:
if (ismoderator()) {
$avatarcustomposts = 0;
}




Replace it with what?

I am trying this with VB2.2.8 but after I put it on the member.php will not work.. its only blank.. What am I doing wrong?

I am useing this
if $bbuserinfo['usergroupid']==9 {
$avatarcustomposts = 0;
}

I took the moderator thing out as I make the mods avatar when they need them and upload them.. but I want to allow my contributing members to use custom avatar..
Please respond

N9ne
31 Oct 2002, 01:26
This hack does not work with vB 2.2.8, after extensive testing, I have found...

I am shortly going to release a working "Mods and Admins can always use Custom Avatars" hack, I just coded it up myself :)

LordZypher
01 Nov 2002, 01:27
ok kool.. I had tried everyway I could but I am not good with php anyway but as far as the hack goes.. I am needing it to only allow my contributing members to change there avatar.. The user group is 9... That would be great :) Thanks...

N9ne
01 Nov 2002, 01:38
http://www.vbulletin.org/forum/showthread.php?s=&threadid=45246

There is my hack, if you want the code changed, just request it in the thread [so other users will be able to see and it might be useful to them too]

NTLDR
01 Nov 2002, 14:26
Originally posted by N9ne
This hack does not work with vB 2.2.8, after extensive testing, I have found...

This hack works fine with vB 2.2.8.

N9ne
01 Nov 2002, 14:32
Didn't for me :confused:

LordZypher
01 Nov 2002, 17:23
Didn't for me.. Hoping on a good outcome with N9ne's version..

X-Fan
24 Mar 2003, 02:35
Working fine with a hacked 2.3.0 board.

Sacrifice
29 Jul 2003, 10:14
Page Not Found

The requested URL was not found on the server.

Anyone can help me please?

Elemental
09 Aug 2004, 04:55
does not work! members are allowed to do it

WitchyT
07 Oct 2004, 20:07
does not work! members are allowed to do it

Did you go to your avatar options and replace 0 in Minimum custom posts with a higher number such as 1000000?