Go Back   vb.org Archive > vBulletin Article Depository > Read An Article > vBulletin Tips & Tricks
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Full size avatar in user's profile
Lea Verou
Join Date: Jul 2005
Posts: 1,856

 

Greece
Show Printable Version Email this Page Subscription
Lea Verou Lea Verou is offline 05-13-2008, 10:00 PM

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

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!!!
Reply With Quote
  #22  
Old 08-11-2009, 03:18 PM
Mobo Mobo is offline
 
Join Date: Jan 2004
Location: Colorado
Posts: 319
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thank you!
Reply With Quote
  #23  
Old 11-25-2009, 04:03 AM
Tanapangarap's Avatar
Tanapangarap Tanapangarap is offline
 
Join Date: Dec 2007
Location: California
Posts: 80
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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?
Reply With Quote
  #24  
Old 12-15-2009, 07:50 PM
COL NIL SATIS COL NIL SATIS is offline
 
Join Date: Aug 2009
Location: Liverpool UK
Posts: 802
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

what template would i find this in????
Reply With Quote
  #25  
Old 12-15-2009, 08:20 PM
Taragon's Avatar
Taragon Taragon is offline
 
Join Date: Sep 2007
Location: The Netherlands
Posts: 390
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by COL NIL SATIS View Post
what template would i find this in????
none. it's a file edit, not a template edit
Quote:
Originally Posted by Michelle View Post
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); 
Reply With Quote
  #26  
Old 12-16-2009, 04:49 PM
COL NIL SATIS COL NIL SATIS is offline
 
Join Date: Aug 2009
Location: Liverpool UK
Posts: 802
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

sorry but im a noob on this..where would i find said file???
Reply With Quote
  #27  
Old 12-18-2009, 12:27 AM
Tanapangarap's Avatar
Tanapangarap Tanapangarap is offline
 
Join Date: Dec 2007
Location: California
Posts: 80
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.").
Reply With Quote
  #28  
Old 02-06-2010, 02:46 PM
multiplex multiplex is offline
 
Join Date: Jun 2009
Posts: 74
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #29  
Old 04-07-2010, 06:35 PM
Wifey Wifey is offline
 
Join Date: Mar 2004
Posts: 250
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thank you so much for sharing this! Very helpful and looks MUCH better in the profile.
Reply With Quote
  #30  
Old 08-26-2010, 06:29 PM
deisnet deisnet is offline
 
Join Date: Feb 2010
Posts: 3
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

can some one show me how to to the same with friends avatars ??
Reply With Quote
  #31  
Old 02-07-2013, 03:13 AM
mykkal's Avatar
mykkal mykkal is offline
 
Join Date: May 2007
Location: Atlanta, GA
Posts: 485
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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 View Post
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

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!!!
--------------- 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?
Reply With Quote
Reply


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 04:42 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.08675 seconds
  • Memory Usage 2,319KB
  • Queries Executed 25 (?)
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
  • (6)bbcode_code
  • (6)bbcode_php
  • (3)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_article
  • (1)navbar
  • (4)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)pagenav_pagelink
  • (11)post_thanks_box
  • (2)post_thanks_box_bit
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_onlinestatus
  • (11)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_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
  • fetch_musername
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • post_thanks_function_fetch_thanks_bit_start
  • post_thanks_function_show_thanks_date_start
  • post_thanks_function_show_thanks_date_end
  • post_thanks_function_fetch_thanks_bit_end
  • post_thanks_function_fetch_post_thanks_template_start
  • post_thanks_function_fetch_post_thanks_template_end
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete