Back to vBulletin 3.8 Add-ons

Default avatar for users with no selected avatar
Mod Version: 1.00, by macc

vB Version: 3.8.1 Rating: (9 votes - 4.11 average) Installs: 79
Released: 06 Mar 2009 Last Update: Never Downloads: 17
Not Supported Template Edits Code Changes Re-usable Code  

Just some help if you want to set the default avatar to users who did not select any avatar. It is for postbit, postbit_legacy and member list template.

In your postbit template find -
PHP Code:
<if condition="$show['avatar']"><td class="alt2"><a href="member.php?$session[sessionurl]u=$post[userid]"><img src="$post[avatarurl]$post[avwidth$post[avheightalt="<phrase 1="$post[username]">$vbphrase[xs_avatar]</phrase>" border="0" /></a></td></if> 
and put this below code before </if> -
PHP Code:
<else />
<if 
condition="$bbuserinfo[showavatars]">
 <
td class="alt2"><a href="member.php?$session[sessionurl]u=$post[userid]"><img src="$stylevar[imgdir_misc]/noavatar.gif" $post[avwidth$post[avheightalt="<phrase 1="$post[username]">$vbphrase[xs_avatar]</phrase>" border="0" /></a><br /><a href="profile.php?$session[sessionurl]do=editavatar"><b>Set Avatar</b></a></td>
</if> 
upload(copy) image noavatar.gif in "your template" /images/misc folder.




In your templete memberlist_resultbits find this:

PHP Code:
<if condition="$show['avatar']"><img src="$avatarurlborder="0" $avwidth $avheight alt="<phrase 1="$userinfo[username]">$vbphrase[xs_avatar]</phrase>" hspace="4" vspace="4" /><else />&nbsp;</if></td></if> 
and &nbsp; replace with this
PHP Code:
<img src="$stylevar[imgdir_misc]/noavatar.gif" border="0" $avwidth $avheight alt="<phrase 1="$userinfo[username]">$vbphrase[xs_avatar]</phrase>" hspace="4" vspace="4" /> 

For postbit_legacy find

PHP Code:
<if condition="$show['avatar']">
    <
div class="smallfont">
     &
nbsp;<br /><a href="member.php?$session[sessionurl]u=$post[userid]"><img src="$post[avatarurl]$post[avwidth$post[avheightalt="<phrase 1="$post[username]">$vbphrase[xs_avatar]</phrase>" border="0" /></a>
    </
div>
   </if> 
and after </div> add this

PHP Code:
<else />
    <if 
condition="$bbuserinfo[showavatars]">
     <
div class="smallfont">
      &
nbsp;<br /><a href="member.php?$session[sessionurl]u=$post[userid]"><img src="your url link/noavatar.gif" $post[avwidth$post[avheightalt="<phrase 1="$post[username]">$vbphrase[xs_avatar]</phrase>" border="0" /></a>
     </
div>
</if> 

Change "your url link" to your link to picture (avatar)!

You can make your own pictures (avatar) for users who did not select any avatar!


Hope this will help someone!

Want to see this in action? - http://libar-libar.com


Regards,

macc

Download

No files for download.

Screenshots

Click image for larger version
Name:	set_avatar.jpg
Views:	665
Size:	52.5 KB
ID:	96025  

Similar Mods

[Release -Gamma / RC1 / RC2]Default Avatar for users with no avatar :) vBulletin 3.0 Template Modifications
[Release -Gamma / RC1 / RC2]Default Avatar for users with no avatar :) vBulletin 3.0 Template Modifications

vblts.ru supports vBulletin®, 2022-2024