Default Avatar in Blog
This modification is in the archives.
This mod was simply created because the front page of the vBulletin blog looked hideous when there were massive gaps where the avatars should be in the latest entry/comment lists. It's a very minor set of template edits that replaces the transparent image with a default one.
Note: I know you can replace the GIF BUT this would not be feasible if you wanted to use a PNG or JPEG image, the last which would become a blurry mass of pixels. Yes, this replaces EVERY SINGLE circumstance of a space where an avatar should be with a default you specify. That's why there are so many edits. The edits: Go into blog_home_list_blog and Find: Code:
<if condition="$show['avatar']"> <a href="blog.php?$session[sessionurl]u=$updated[userid]"><img class="inlineimg blog_home_list_image" src="$updated[avatarurl]" border="0" width="30" alt="<phrase 1="$updated[username]">$vbphrase[xs_avatar]</phrase>" /></a> <else /> <img src="$vboptions[cleargifurl]" width="30" height="30" alt="" /> </if> Code:
<if condition="$show['avatar']"> <a href="blog.php?$session[sessionurl]u=$updated[userid]"><img class="inlineimg blog_home_list_image" src="$updated[avatarurl]" border="0" width="30" alt="<phrase 1="$updated[username]">$vbphrase[xs_avatar]</phrase>" /></a> <else /> <img src="images/misc/blog/noavatarpic.PNG" width="31" height="27" alt="" /> </if> Code:
<if condition="$show['avatar']"> <a href="member.php?$session[sessionurl]u=$updated[userid]"><img class="inlineimg blog_home_list_image" src="$updated[avatarurl]" border="0" width="30" alt="<phrase 1="$updated[username]">$vbphrase[xs_avatar]</phrase>" /></a> <else /> <img src="$vboptions[cleargifurl]" width="30" height="30" alt="" /> </if> Code:
<if condition="$show['avatar']"> <a href="member.php?$session[sessionurl]u=$updated[userid]"><img class="inlineimg blog_home_list_image" src="$updated[avatarurl]" border="0" width="30" alt="<phrase 1="$updated[username]">$vbphrase[xs_avatar]</phrase>" /></a> <else /> <img src="images/misc/blog/noavatarpic.PNG" width="31" height="27" alt="" /> </if> Code:
<if condition="$show['avatar']"> <a href="blog.php?$session[sessionurl]u=$updated[userid]"><img class="inlineimg blog_home_list_image" src="$updated[avatarurl]" border="0" width="30" alt="<phrase 1="$updated[username]">$vbphrase[xs_avatar]</phrase>" /></a> <else /> <img src="$vboptions[cleargifurl]" width="30" height="30" alt="" /> </if> Code:
<if condition="$show['avatar']"> <a href="blog.php?$session[sessionurl]u=$updated[userid]"><img class="inlineimg blog_home_list_image" src="$updated[avatarurl]" border="0" width="30" alt="<phrase 1="$updated[username]">$vbphrase[xs_avatar]</phrase>" /></a> <else /> <img src="images/misc/blog/noavatarpic.PNG" width="31" height="27" alt="" /> </if> Code:
<if condition="$show['avatar']"> <div style="margin-bottom:$stylevar[cellpadding]px"> <a href="blog.php?$session[sessionurl]u=$blog[userid]"><img src="$blog[avatarurl]" $blog[avwidth] $blog[avheight] alt="<phrase 1="$blog[username]">$vbphrase[xs_avatar]</phrase>" border="0" /></a> </div> </if> Code:
<if condition="$show['avatar']"> <div style="margin-bottom:$stylevar[cellpadding]px"> <a href="blog.php?$session[sessionurl]u=$blog[userid]"><img src="$blog[avatarurl]" $blog[avwidth] $blog[avheight] alt="<phrase 1="$blog[username]">$vbphrase[xs_avatar]</phrase>" border="0" /></a> </div> <else /> <div style="margin-bottom:$stylevar[cellpadding]px"> <a href="blog.php?$session[sessionurl]u=$blog[userid]"><img src="images/misc/blog/noavatarpic.PNG" height="27" width="31" alt="<phrase 1="$blog[username]">$vbphrase[xs_avatar]</phrase>" border="0" /></a> </div> </if> Code:
<if condition="$show['avatar']"> <div class="tborder" style="border-style:dotted; float:$stylevar[right]; margin-$stylevar[left]:$stylevar[cellpadding]px"> <div class="alt2" style="padding:$stylevar[cellpadding]px"> <a href="blog.php?$session[sessionurl]u=$response[userid]"><img src="$response[avatarurl]" $response[avwidth] $response[avheight] alt="<phrase 1="$response[username]">$vbphrase[xs_avatar]</phrase>" border="0" /></a> </div> </div> </if> Code:
<if condition="$show['avatar']"> <div class="tborder" style="border-style:dotted; float:$stylevar[right]; margin-$stylevar[left]:$stylevar[cellpadding]px"> <div class="alt2" style="padding:$stylevar[cellpadding]px"> <a href="blog.php?$session[sessionurl]u=$response[userid]"><img src="$response[avatarurl]" $response[avwidth] $response[avheight] alt="<phrase 1="$response[username]">$vbphrase[xs_avatar]</phrase>" border="0" /></a> </div> </div> <else /> <div class="tborder" style="border-style:dotted; float:$stylevar[right]; margin-$stylevar[left]:$stylevar[cellpadding]px"> <div class="alt2" style="padding:$stylevar[cellpadding]px"> <a href="blog.php?$session[sessionurl]u=$response[userid]"><img src="images/misc/blog/noavatarpic.PNG" width="31" height="27" alt="" /></a> </div> </div> </if> Customising This When you have done the above, now comes the annoying part. You must make or download your own image for the default, in whatever program you wish, then edit the height and width so they match EXACTLY. You can find this in Windows here: Note: Your image should be about 30 pixels by 30 pixels in size. Approx. Now find these values in the code and replace with the right ones: Code:
width="31" height="27" Plugin for Template Modification System by yoyoyoyo If you use the Template Modification System, just import this product and it will automatically make the template edits required for this modification for you. Thanks to yoyoyoyo for this awesome addition. &d=1193417641 By the way, this is the Template Modification System modification by Andreas: http://www.vbulletin.org/forum/showt...ication+System Troubleshooting Page isn't valid (blog.php) Remove the code from the featured entry template. Goes back to normal, but now should valid. Weirdly, this only happens for the validator and when tested as a guest in Internet Explorer. Displays an X Upload the image to the images/misc/blog directory. Also make sure the capitalisation in the file name is correct. Notes: - It's valid XHTML 1.0 Transitional Screenshots: Download No files for download. Screenshots |
Similar Mods
vBulletin Blog Blog Portal Link in vBulletin Blog 2.0 Blog Links Menu | vBulletin 3.7 Template Modifications |
[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 |