View Full Version : Disable avatars for a specific user(s)
EricR
09-13-2004, 05:16 PM
I have avatars enabled but as always there are the problem few who choose inappropriate avatars. Is there any way (short of messing with usergroups) to disable avatars for a specific user(s)? Specifically I would like a "user may not use an avatar" checkbox in their user settings so I can disable their avatars. Searched on here, vbulletin.com, and vbulletin.org, found nothing :(
Proposed solutions so far:
1) Create another usergroup that has avatars disabled
Problem = I have a paid subscription option as well, so this means I would have to create TWO new usergroups... one for while their subscription is active and one for when it runs out. No way to address simply resubscribing and getting back their avatars.
2) Punish everyone and moderate all avatars
Problem = Ugh, way too labor intensive. I want to address a few "bad apples", not punish the entire bushel.
There HAS to be a way to disable avatars for a specific user without screwing with subscriptions or usergroups. Even a crude conditional in the postbit (display avatar so long as userid is equal to user1 or user2 or user3 or ...) would be better than the current system.
Any thoughts?
EricR
09-13-2004, 06:56 PM
Got it figured out :D Took some digging and learned a few new variables along the way, but here's how to do it:
In phpinclude_start add (modify userid's as required):
$banned_avatarids = array(100, 200, 300);
In postbit_legacy (what I use anyway):
Find
<if condition="$show['avatar']">
<div class="smallfont">
<a href="member.php?$session[sessionurl]u=$post"><img src="$avatarurl" alt="<phrase 1="$post[username]">$vbphrase[xs_avatar]</phrase>" border="0" /></a>
</div>
</if>
Add before
<if condition="in_array($post[userid], $GLOBALS[banned_avatarids])">
<div class="smallfont">
Insert your text or designated avatar image here, for an image copy the href code above and modify the image source location accordingly
</div>
<else />
Add after
</if>
If you use postbit instead of postbit_legacy you'll have to compare and modify accordingly.
[U]Addendum
Next is modifying the MEMBERINFO template so their avatar doesn't show in their public profile either:
Find
<if condition="$show['avatar']">
<td><img src="$userinfo[avatarurl]" alt="<phrase 1="$userinfo[username]">$vbphrase[xs_avatar]</phrase>" border="0" style="border:1px solid $stylevar[tborder_bgcolor]; border-top:none" /></td>
<else />
<td> </td>
</if>
Add Before
<if condition="in_array($post[userid], $GLOBALS[banned_avatarids])">
<td>
Insert your text or designated avatar image here, for an image copy the img code above and modify the image source location accordingly
</td>
<else />
Add after
</if>
You could always make a new usergroup with restrictive perrmissions and put any user in that group who breaks your avatar rules.
EricR
09-13-2004, 09:27 PM
You could always make a new usergroup with restrictive perrmissions and put any user in that group who breaks your avatar rules.
See item #1 in my initial post. The usergroup approach becomes a royal p.i.t.a. when you start talking about paid subscriptions. Avatar permissions are inherited, therefore the only way to turn them off for an individual is if ALL of the usergroups that they belong to have them disabled. You would need to create a new base usergroup with no avatars and then create a new (and disabled) paid subscription usergroup with avatars disable, then move the user from the standard base usergroup and subscription group to the modified base group and subscription group (including subscription expiration date). This way when the subscription expired they would revert to the modified base group without avatars instead of the standard base group (which has avatars). And after all of that the user gets their avatars back when they renew their subscription and are automatically added to the subscriptions-with-avatars group. What a mess. With the conditionals above I simply edit the phpinclude_start template and add/remove userids with no concern at all regarding usergroups and subscriptions.
Next on my list is loading my banned avatar image in the phpinclude_start template as well, that way everything is configured from that single template. :)
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.