vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin Tips & Tricks (https://vborg.vbsupport.ru/forumdisplay.php?f=239)
-   -   Full size avatar in user's profile (https://vborg.vbsupport.ru/showthread.php?t=179172)

Lea Verou 05-13-2008 10:00 PM

Full size avatar in user's profile
 
It seems that Jelsoft expects everyone to have profile pictures enabled. This is the only explanation I can think for the fact that in the user's profile, his/her own avatar, is a thumbnail, whereas in other places such as the postbit or the memberinfo, its full size :eek:

Personally, I have disabled profile pictures, as I feel they are completely superfluous and I wanted the user's avatar to display at the place that the vB devs have intended the profile pic to do so.

The template edit to put it there was easy. However, how the hell would I make it full size? I even tried using the code from my 3.6.x memberinfo template. It didn't help.

No template edit I thought helped.

So, as a last resort, I looked at the code. After some reading, I found out what I had to change:

file: includes/class_userprofile.php
line: 197
find:
PHP Code:

fetch_avatar_from_userinfo($this->userinfotruefalse); 

change to:
PHP Code:

fetch_avatar_from_userinfo($this->userinfofalsefalse); 

Basically, you change the 2nd parameter from true to false.

And there isn't even a hook somewhere nearby, to save the file edit.

I hope it helps someone save the time that I spent looking for it.

And if any vB dev is reading, I want to say that its disgraceful to have to make a file edit for that!!! :mad:

KURTZ 05-14-2008 11:06 AM

Quote:

Originally Posted by Michelle
And if any vB dev is reading, I want to say that its disgraceful to have to make a file edit for that!!!

agreed :p

cafenetland 05-14-2008 12:22 PM

thx man.

it looks much much better


https://vborg.vbsupport.ru/external/2008/05/52.jpg

elmati 05-14-2008 12:57 PM

I'm not a fan of file edits, but nice hack m8 :)

slowphantom 05-14-2008 12:59 PM

thx great work keep it up

Lea Verou 05-14-2008 01:05 PM

Quote:

Originally Posted by elmati (Post 1519315)
I'm not a fan of file edits, but nice hack m8 :)

I hate file edits too, I got so mad when I found out that this needs a file edit...

Defkalion 05-14-2008 07:58 PM

Nice find Lia, I needed this too :)

MSheraz86 05-14-2008 08:34 PM

Thanks for this :) very helpful indeed!

Zaiaku 05-14-2008 10:54 PM

One of the few times where a file edit can be really useful. Thx!

avsunforum 05-15-2008 11:39 AM

Thank You very Much

FleaBag 05-15-2008 04:27 PM

Great! Nominated for MOTM. :)

Thelonius Beck 05-18-2008 04:52 PM

I only made the size change, as my members prefer the locations 'as is', but great job on the file edit.
*Installed*

DaninMS 05-22-2008 09:41 PM

Nice. Hated that thumbnail they used. thx.

Saskia 06-23-2008 06:47 PM

Great modification. I can't believe it's not a standard vB option to choose either thumbnail or normal size avatar for memberinfo.

Thanks!

Vegetrunks 07-08-2008 08:30 PM

Thanks for this hack. :)

Konstantinos 08-03-2008 02:25 PM

thats cool. how do we make the same for avatars in visitor messages and buddylists and everywhere else its is needed to wipe out this avatar small size all over the forum

trulylowcarb 08-03-2008 06:50 PM

THANK YOU! They need to incorporate this change in the next release. May I say, I would NEVER have found this on my own.

Bill from Cleve 09-28-2008 11:55 PM

Works great. By any chance, do you know how to move a members user name above the avatar in the forums? I'm ultra new to Vbulletin.

Seiyaboy 10-05-2008 01:38 AM

Thank you so much. I was so angry when vbulletin resized down the avatar in profiles. I mean it's reasonable for the friendslist to be resize, but a member's avatar? Oh please. Thanks to this edit our customized member profiles look so much better now. <3

The-Ensemble 05-11-2009 02:23 AM

Thank you very much. :)

Mobo 08-11-2009 03:18 PM

Thank you!

Tanapangarap 11-25-2009 04:03 AM

Does anyone here happen to know if an avatar can be made to only be full size if it's under a certain amount of dimensions? For example, if an avatar is over 100x100, it will only display a thumbnail?

COL NIL SATIS 12-15-2009 07:50 PM

what template would i find this in????

Taragon 12-15-2009 08:20 PM

Quote:

Originally Posted by COL NIL SATIS (Post 1931349)
what template would i find this in????

none. it's a file edit, not a template edit
Quote:

Originally Posted by Michelle (Post 1519226)
file: includes/class_userprofile.php
line: 197
find:
PHP Code:

fetch_avatar_from_userinfo($this->userinfotruefalse); 

change to:
PHP Code:

fetch_avatar_from_userinfo($this->userinfofalsefalse); 



COL NIL SATIS 12-16-2009 04:49 PM

sorry but im a noob on this..where would i find said file???

Tanapangarap 12-18-2009 12:27 AM

Col,

You have to use an FTP program like Filezilla or CuteFTP to edit the file "class_userprofile.php", which is located in the directory "/includes/", with the first "/" representing your "root" directory, or your first/top directory (you should see it after logging into your website).

I assume whoever is hosting your forum has allowed you database access. If you're not sure, you should ask your host; from the host, too, you can get the user name, password, and FTP address you'll need to login (the latter is usually ftp:// followed by your site URL after "www.").

multiplex 02-06-2010 02:46 PM

i have a board with variable size avatars from 125x125 up to 200x200. this trick works but the 200x200 avatars are too big for the profile page box in sits in. so i figured out a way to set the dimensions by trial and error but there is one draw back. i set my dimensions at 125x125 but any avatar that a members adds that is less then 125x125 will be stretched and lose resolution. here is what i did:

Code:

fetch_avatar_from_userinfo($this->userinfo, true, false);
changed to

Code:

fetch_avatar_from_userinfo($this->userinfo, false, false);


Code:

($this->userinfo['avatarwidth'] ? ' width="'
changed to

Code:

($this->userinfo['avatarwidth'] ? ' width="125px'


Code:

($this->userinfo['avatarheight'] ? ' height="'
changed to

Code:

($this->userinfo['avatarheight'] ? ' height="125px'
with these dimensions an avatar can easily fit in the box. one other downside is if a member has a rectangular avatar, the shorter dimension will be stretched

can anyone provide any help on how to work around this? like rather then defining a set dimension, defining a maximum allowable dimension

Wifey 04-07-2010 06:35 PM

Thank you so much for sharing this! Very helpful and looks MUCH better in the profile.

deisnet 08-26-2010 06:29 PM

can some one show me how to to the same with friends avatars ??

mykkal 02-07-2013 03:13 AM

THanks for this. I'm going to try it with VB 3.8.7. It would be nice if vBulletin included this as an adjustable feature. By that I mean the display size of the avatar image on the profile page.

Quote:

Originally Posted by Lea Verou (Post 1519226)
It seems that Jelsoft expects everyone to have profile pictures enabled. This is the only explanation I can think for the fact that in the user's profile, his/her own avatar, is a thumbnail, whereas in other places such as the postbit or the memberinfo, its full size :eek:

Personally, I have disabled profile pictures, as I feel they are completely superfluous and I wanted the user's avatar to display at the place that the vB devs have intended the profile pic to do so.

The template edit to put it there was easy. However, how the hell would I make it full size? I even tried using the code from my 3.6.x memberinfo template. It didn't help.

No template edit I thought helped.

So, as a last resort, I looked at the code. After some reading, I found out what I had to change:

file: includes/class_userprofile.php
line: 197
find:
PHP Code:

fetch_avatar_from_userinfo($this->userinfotruefalse); 

change to:
PHP Code:

fetch_avatar_from_userinfo($this->userinfofalsefalse); 

Basically, you change the 2nd parameter from true to false.

And there isn't even a hook somewhere nearby, to save the file edit.

I hope it helps someone save the time that I spent looking for it.

And if any vB dev is reading, I want to say that its disgraceful to have to make a file edit for that!!! :mad:

--------------- Added [DATE]1360212285[/DATE] at [TIME]1360212285[/TIME] ---------------

Is there any way to keep the aspect ratio of the image? So I can just set width restrictions?

tommythejoat 07-31-2013 12:54 AM

You just use max-width instead of width. Generally you would want to declare a bounding box with both max-width and max-height.

Once you have fetched the fulll size image, you should be able to use the additional css style to control the size in various locations.

All our styles are children of a parent style and we only make changes to the parent additional css.


All times are GMT. The time now is 06:25 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.01483 seconds
  • Memory Usage 1,803KB
  • 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
  • (6)bbcode_code_printable
  • (6)bbcode_php_printable
  • (5)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (31)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