Back to vBulletin 3.6 Template Modifications

Default Avatar in Blog
Mod Version: 1.00, by cheat-master30

This modification is in the archives.
vB Version: 3.6.8 Rating: (1 vote - 5.00 average) Installs: 4
Released: 26 Oct 2007 Last Update: Never Downloads: 21
Not Supported Template Edits Additional Files Re-usable Code Translations  

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>
Replace with:

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>
In blog_home_list_comment find:

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>
Replace with:

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>
In blog_home_list_entry, 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>
Replace with:

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>
Find in blog_list_blogs_blog:
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>
Replace with:

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>
Find in blog_comment:

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>
Replace with:

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>
Whew, that was a heck of a lot of template edits for something so simple it should be default. Still, if someone can make a product file for this... I would be so grateful.

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"
However, they work if you are using my default image. To the pixel.

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

Click image for larger version
Name:	defaultavatarlist.jpg
Views:	132
Size:	56.7 KB
ID:	71566   Click image for larger version
Name:	entrylist.jpg
Views:	139
Size:	68.8 KB
ID:	71567   Click image for larger version
Name:	heightandwidth.PNG
Views:	126
Size:	100.1 KB
ID:	71568  

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

vblts.ru supports vBulletin®, 2022-2024