PDA

View Full Version : disable avatars for a specific user(s)


EricR
09-13-2004, 03:15 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 and vbulletin.com, found nothing :(

EricR
09-13-2004, 06:53 PM
Got it :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>&nbsp;</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>