vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 4.x Template Modifications (https://vborg.vbsupport.ru/forumdisplay.php?f=246)
-   -   Mini Mods - Default avatar (https://vborg.vbsupport.ru/showthread.php?t=230203)

Allan 12-13-2009 10:00 PM

Default avatar
 
1 Attachment(s)
This mod add a default avatar, simply ^^
  • In "postbit" template, find:
PHP Code:

<vb:if condition="$show['avatar']">
                    <
class="postuseravatarlink" href="{vb:link member, {vb:raw post}}">
                        <
vb:if condition="$post.avatarurl">
                            <
img src="{vb:raw post.avatarurl}" alt="{vb:rawphrase xs_avatar, {vb:raw post.username}}" />
                        <
vb:else />
                            <
img src="{vb:stylevar imgdir_misc}/unknown.gif" />
                        </
vb:if>
                    </
a>
                </
vb:if> 

  • Replace to:
PHP Code:

<vb:if condition="$show['avatar']">
                    <
class="postuseravatarlink" href="{vb:link member, {vb:raw post}}">
                        <
vb:if condition="$post.avatarurl">
                            <
img src="{vb:raw post.avatarurl}" alt="{vb:rawphrase xs_avatar, {vb:raw post.username}}" />
                        
                        </
vb:if>
                    </
a>
<
vb:else />
                            <
img class="postuseravatarlink" align="left" src="{vb:stylevar imgdir_misc}/avatar.png" alt="{vb:rawphrase xs_avatar, {vb:raw post.username}}" />
                </
vb:if> 

PS: The IB code is no good by default, default avatar is expected but does not

PS2: image (avatar.png) is already included

fourat 12-15-2009 01:34 AM

Thank you Allan

interfx 12-15-2009 08:20 PM

Is there a way to make a default avatar for unregistered users?

Allan 12-15-2009 09:27 PM

Quote:

Originally Posted by interfx (Post 1931363)
Is there a way to make a default avatar for unregistered users?

PS2: image (avatar.png) is already included

http://www.vbulletin.com/forum/images/misc/avatar.png

interfx 12-15-2009 09:38 PM

Sorry, let me more clear... I'm looking for a solution to have unregistered users have a unqiue avatar... The default avatar (PS2) would still be there for registered users, but wanted an unique avatar for unregistered users...

Would your solution work for somehting like that?

taffy056 12-15-2009 10:55 PM

There is a product that does this also, perhaps that could help you interfx

Dr.osamA 12-18-2009 07:41 PM

thanx man !!
________
MONTANA MARIJUANA DISPENSARY

SİMAR 12-21-2009 05:12 PM

thanx

tazattitude 12-24-2009 03:03 PM

Thanks Allan!

GrossKopf 12-28-2009 07:59 PM

How is this different from the option in the Admin CP that lets you set a default avatar?

Brother Malachi 01-01-2010 08:30 AM

Hey Allan, I'm a bit confused.
Doesn't $show[avatar] check to see whether the user has chosen to display or hide avatars through his/her userCP?
Meaning, if I were to go to my userCP and uncheck the "Show Avatars" then your code kicks in showing the default blank one.

Is that the purpose of your code?
Or are you trying to make it so that if a user does not have an avatar, the default one is shown?

Quote:

Originally Posted by interfx (Post 1931391)
Sorry, let me more clear... I'm looking for a solution to have unregistered users have a unqiue avatar... The default avatar (PS2) would still be there for registered users, but wanted an unique avatar for unregistered users...

Would your solution work for somehting like that?

Use this:
Code:

<vb:if condition="$show['guest']"></vb:if>

shahz 11-03-2010 06:25 PM

Thanks for the bit bro, but I would like to fix the code just a little bit more to make it perfect. Currently, the default avatars are not linking to the profile. Use this one instead:

Code:

<vb:if condition="$show['avatar']">
                    <a class="postuseravatarlink" href="{vb:link member, {vb:raw post}}">
                        <vb:if condition="$post.avatarurl">
                            <img src="{vb:raw post.avatarurl}" alt="{vb:rawphrase xs_avatar, {vb:raw post.username}}" />
                       
                        </vb:if>
                    </a>
<vb:else />
                            <img class="postuseravatarlink" align="left" src="{vb:stylevar imgdir_misc}/avatar.png" alt="{vb:rawphrase xs_avatar, {vb:raw post.username}}" />
                </vb:if>


LordMike 11-13-2010 05:11 AM

^^ that's the difference between amateur tweaking and the real pro's.

Thanks for the insight, I've only changed the .gif to .png so I'm not sure, but I think everything will stay the same as it was? Doesn't vB takes care of this ? (I mean to check if the avatars is on/off in usercp)


All times are GMT. The time now is 05:49 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01094 seconds
  • Memory Usage 1,752KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_code_printable
  • (2)bbcode_php_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (13)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete