Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.6 > vBulletin 3.6 Template Modifications
Default Avatar in Blog Details »»
Default Avatar in Blog
Version: 1.00, by cheat-master30 cheat-master30 is offline
Developer Last Online: Apr 2010 Show Printable Version Email this Page

Category: vBulletin Blog - Version: 3.6.8 Rating:
Released: 10-25-2007 Last Update: Never Installs: 4
Template Edits
Re-useable Code Additional Files Translations  
No support by the author.

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.

https://vborg.vbsupport.ru/attachmen...1&d=1193417641

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

https://vborg.vbsupport.ru/showthrea...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:

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #2  
Old 10-26-2007, 03:33 PM
yoyoyoyo's Avatar
yoyoyoyo yoyoyoyo is offline
 
Join Date: Dec 2004
Location: USA
Posts: 1,612
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

cool thanks much

I am attaching a Template Modification System (TMS) XML file to make it easier for people to automagically edit their templates
Reply With Quote
  #3  
Old 10-26-2007, 04:00 PM
yoyoyoyo's Avatar
yoyoyoyo yoyoyoyo is offline
 
Join Date: Dec 2004
Location: USA
Posts: 1,612
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
However, they work if you are using my default image. To the pixel.
what image?
Reply With Quote
  #4  
Old 10-26-2007, 05:01 PM
cheat-master30's Avatar
cheat-master30 cheat-master30 is offline
 
Join Date: Mar 2007
Location: Information Classified
Posts: 1,715
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

The fourth in the screenshots. But I recommend you download or make one relevant to your forum topic.
Reply With Quote
  #5  
Old 10-26-2007, 08:19 PM
cheat-master30's Avatar
cheat-master30 cheat-master30 is offline
 
Join Date: Mar 2007
Location: Information Classified
Posts: 1,715
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Oh, and thanks for that file. May I add it to post one?
Reply With Quote
  #6  
Old 10-26-2007, 08:26 PM
yoyoyoyo's Avatar
yoyoyoyo yoyoyoyo is offline
 
Join Date: Dec 2004
Location: USA
Posts: 1,612
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by cheat-master30 View Post
Oh, and thanks for that file. May I add it to post one?
of course
Reply With Quote
  #7  
Old 10-26-2007, 08:44 PM
cheat-master30's Avatar
cheat-master30 cheat-master30 is offline
 
Join Date: Mar 2007
Location: Information Classified
Posts: 1,715
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Added with credit and link to required modification.
Reply With Quote
  #8  
Old 10-28-2007, 12:28 PM
cheat-master30's Avatar
cheat-master30 cheat-master30 is offline
 
Join Date: Mar 2007
Location: Information Classified
Posts: 1,715
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Anyone got any requests for templates to add this to?
Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 02:55 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04422 seconds
  • Memory Usage 2,288KB
  • Queries Executed 23 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (11)bbcode_code
  • (2)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (8)post_thanks_box
  • (8)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (8)post_thanks_postbit_info
  • (7)postbit
  • (8)postbit_onlinestatus
  • (8)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete