PDA

View Full Version : Hiding avatars per usergroup


Pharkas
05-13-2013, 10:43 AM
Hi,

I am looking to hide the avatars for a particular usergroup. I've changed the options in the admin panel to prevent users to upload custom avatars but this will not prevent previously uploaded avatars from showing.

I've asked the question at vB.com and it seems the only option would be to delete the existing avatars, which I don't really want to do. This is my vb.com thread (http://www.vbulletin.com/forum/forum/vbulletin-4/vbulletin-4-questions-problems-and-troubleshooting/3965528-hiding-existing-avatars).

I was not able to find an existing mod for this.

My option would be to code a conditionnal is in the template used to show he avatar, which seems to be the postbit template. I spent some time on it but was not able to make it work.

Can anyone help ? Where would I need to put this statement ?

Thanks,

Pharkas

nhawk
05-13-2013, 11:47 AM
In the postbit_legacy and postbit templates locate this code...

<vb:if condition="$show['avatar']">

And change it to...

<vb:if condition="$show['avatar'] && !is_member_of($bbuserinfo,6)">

Change the 6 to the usergroup you don't want the avatars to be shown for.

To add more usergroups just add them with commas ie 6,7,8,9, etc.

Pharkas
05-13-2013, 02:01 PM
Thanks for the help.

I'll try that later and let you know.

Pharkas

Lynne
05-13-2013, 05:30 PM
You could also do a plugin (postbit_display_complete should work) and just set $show['avatar'] to false for the usergroup.

Pharkas
05-14-2013, 12:33 AM
Hi,

I just tried it and it doesn't work as I need... probably didn't explain myself properly.

The above code seems to hide the avatar based on the usergroup of the user visiting the site.

What I want to do is hide the avatar based on the usergroup for each individual post.

So basically, if a post is from a certain usergroup, show the avatar, if a post is from another usergroup, hide it, on a post per post basis.

Thanks again for your help.

Pharkas

--------------- Added 1368495536 at 1368495536 ---------------

Hi,

nhawk sent me in the right direction.

After looking it up changing $bbuserinfo to $post did the trick.

The following code worked perfectly.

<vb:if condition="$show['avatar'] && !is_member_of($post,6)">


Thanks for your help,

Pharkas