PDA

View Full Version : vBulletin Blog - Default Avatar in Blog


cheat-master30
10-25-2007, 10:00 PM
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:

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

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

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

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

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

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

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

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

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

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

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.

https://vborg.vbsupport.ru/attachment.php?attachmentid=71571&d=1193417641

By the way, this is the Template Modification System modification by Andreas:

https://vborg.vbsupport.ru/showthread.php?t=152931&highlight=Template+Modification+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:

https://vborg.vbsupport.ru/external/2009/09/32.jpg- It's valid XHTML 1.0 Transitional

Screenshots:

yoyoyoyo
10-26-2007, 03:33 PM
cool thanks much

I am attaching a Template Modification System (TMS) XML file to make it easier for people to automagically edit their templates

yoyoyoyo
10-26-2007, 04:00 PM
However, they work if you are using my default image. To the pixel.what image?

cheat-master30
10-26-2007, 05:01 PM
The fourth in the screenshots. But I recommend you download or make one relevant to your forum topic.

cheat-master30
10-26-2007, 08:19 PM
Oh, and thanks for that file. May I add it to post one?

yoyoyoyo
10-26-2007, 08:26 PM
Oh, and thanks for that file. May I add it to post one?of course

cheat-master30
10-26-2007, 08:44 PM
Added with credit and link to required modification.

cheat-master30
10-28-2007, 12:28 PM
Anyone got any requests for templates to add this to?