Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 General Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 02-22-2002, 12:26 PM
Jawelin Jawelin is offline
 
Join Date: Nov 2001
Posts: 557
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hi. I installed most of avatar-related hacks and uploaded many many avatars (categorized) to my board.
Most of them are animated gif, very nice.
Well, now I would make them displayed uniformly, i.e. some are larger than others.
I saw the 50 pixel affects only the uploaded avatar dimension, but I would resize all the images larger than 50px to that limit, without deforming them

Is there any hack or other way to limit everywhere the size of those avatars ?

Thanks a lot.
Bye
Reply With Quote
  #2  
Old 02-26-2002, 12:01 PM
Jawelin Jawelin is offline
 
Join Date: Nov 2001
Posts: 557
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I though to modify the avatar-related templates calculating in the calling phps the scaled dimensions to my limits.
Does anybody have a trick or at least could tell me if it's a comprehensive method ?
Thnx
Reply With Quote
  #3  
Old 02-26-2002, 12:03 PM
Admin's Avatar
Admin Admin is offline
Coder
 
Join Date: Oct 2023
Location: Server
Posts: 1
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Use getimagesize():
http://www.php.net/manual/en/function.getimagesize.php
Reply With Quote
  #4  
Old 02-26-2002, 02:46 PM
Jawelin Jawelin is offline
 
Join Date: Nov 2001
Posts: 557
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Yes, thanks. Of course.
As the dim check is done everywhere in vb code
PHP Code:
        if ($imginfo=@getimagesize($filename)) {
          if (
$imginfo[0]>$avatarmaxdimension or $imginfo[1]>$avatarmaxdimension) {
... 
etc.... (using the first two array elements as and Y dims
I would know if I should make the rescale everywhere in code (I found about 14 templates and many phps) or - in a cleaner way - create a function for the whole "< img src = .... width= height= >" string and put that variable into templates and admin php code (which doesn't use templates...) ?

Or, at least, resize by hand all my avatars with PhotoShop or similar, as the uploaded custom avatars have the dimension size limit at code level ???
:stupid:


P.S.: do you know why uploaded avatars aren't deleted in my server's temp dir ? (Linux, safe mode)

Thanks
Reply With Quote
  #5  
Old 02-26-2002, 03:35 PM
Admin's Avatar
Admin Admin is offline
Coder
 
Join Date: Oct 2023
Location: Server
Posts: 1
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Add a check in getpostbit() that checks, if the user is using an avatar from your stock, the site of the image, then $imageinfo[3] in the <img> tag.

Because I'm nice (read: bored ), find this in functions.php:
Code:
		if ($post[avatarid]!=0) {
			$avatarurl=$post[avatarpath];
		} else {
and replace that with this:
Code:
		if ($post[avatarid]!=0) {
			$avatarurl=$post[avatarpath];
			$imginfo = getimagesize('/path/to/your/images/folder/' . $avatarurl);
			if ($imginfo[0]>50) {
				$moreimgtag = 'width="50"';
			}
			if ($imginfo[1]>50) {
				$moreimgtag .= 'height="50"';
			}
		} else {
			$moreimgtag = '';
and now add $moreimgtag to your postbit_avatar template.
Reply With Quote
  #6  
Old 02-26-2002, 04:23 PM
Jawelin Jawelin is offline
 
Join Date: Nov 2001
Posts: 557
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally posted by FireFly
[...]
Because I'm nice (read: bored ), [...]
You're absolutely right ! .... Nice
(couldn't say 'bored', my side...)

Thanks

P.S. 1: of course, you wouldn't get upset if I'd rescale proportionally sizes and post here my solution ?

P.S. 2: I should make the same-kind replacement also in announcement, private and elsewhere used avatars...

Thanks again.
Bye
Reply With Quote
  #7  
Old 02-26-2002, 04:41 PM
Admin's Avatar
Admin Admin is offline
Coder
 
Join Date: Oct 2023
Location: Server
Posts: 1
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

P.S. 1, no I don't mind, and I'd love if you could post this.

P.S. 2, that's correct.

BTW did you even test my code? I don't think it'll work right away anyway...
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 10:45 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.06201 seconds
  • Memory Usage 2,221KB
  • Queries Executed 13 (?)
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
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (2)bbcode_code
  • (1)bbcode_php
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (7)post_thanks_box
  • (7)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (7)post_thanks_postbit_info
  • (7)postbit
  • (7)postbit_onlinestatus
  • (7)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