Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - Avatar size?
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Avatar size?

 Post Reply Post Reply
Author
bad5star View Drop Down
Groupie
Groupie


Joined: 29 July 2005
Status: Offline
Points: 57
Post Options Post Options   Thanks (0) Thanks(0)   Quote bad5star Quote  Post ReplyReply Direct Link To This Post Topic: Avatar size?
    Posted: 04 May 2006 at 8:00pm
I have searched this forum for the answer and see alot on avatar but I dont see the solution.

Here is my question

How can I have an avatar display of any size and just set a max width and height in the  default_style.css page.

ie. If I have an avatar of 45x50 I dont want it to stretch to my settings of 64x64.

I just want to set a max width and height and let user put any size avatar in their and at the same time not let it get stretched or distorted?

any ideas?

B5

Back to Top
venki View Drop Down
Groupie
Groupie


Joined: 20 April 2003
Status: Offline
Points: 40
Post Options Post Options   Thanks (0) Thanks(0)   Quote venki Quote  Post ReplyReply Direct Link To This Post Posted: 04 May 2006 at 10:15pm
It is very hard to detect picture size whit asp, maybe it could be done by javascript, and I dont think that you can set max width and height whit css...
Back to Top
yuroun View Drop Down
Newbie
Newbie


Joined: 03 May 2006
Location: Netherlands
Status: Offline
Points: 6
Post Options Post Options   Thanks (0) Thanks(0)   Quote yuroun Quote  Post ReplyReply Direct Link To This Post Posted: 05 May 2006 at 10:20pm
I found this javascript somewhere. I think it's from an old mod of MadDog.

Put this in includes/default_javascript.js

function ControlImageSize() {
  if (document.images.length > 0) {        // images?
    var imgHeight;
    var imgWidth;
    for (var i = 0; i < document.images.length; i++) {
      if (document.images.name.substring(0,6) == 'chkImg')     {
        imgWidth = document.images.width;
        imgHeight = document.images.height;
        if (imgWidth > 55) {
          document.images.width = 50;
          // Change the height proportionally
          imgHeight =  imgHeight / (imgWidth/50);
          document.images.height = imgHeight;
        }
      }
    }
  }
}


And at line 848 replace            

If blnAvatar = True AND strAuthorAvatar <> "" Then Response.Write("<img src=""" & strAuthorAvatar & """ alt=""" & strTxtAvatar & """ class=""avatar"" onError=""this.src='avatars/blank_avatar.jpg';""/>")

With


If blnAvatar = True AND strAuthorAvatar <> "" Then Response.Write("<img src=""" & strAuthorAvatar & """ alt=""" & strTxtAvatar & """ class=""avatar"" id=""chkImg1"" name=""chkImg2"" onError=""this.src='avatars/blank_avatar.jpg';""/>")

And play a bit with the ControlImageSize settings. This should work.
Back to Top
tw|kosh View Drop Down
Newbie
Newbie
Avatar

Joined: 02 May 2006
Location: Switzerland
Status: Offline
Points: 16
Post Options Post Options   Thanks (0) Thanks(0)   Quote tw|kosh Quote  Post ReplyReply Direct Link To This Post Posted: 07 May 2006 at 11:47pm
I've found the way below to find out which image has which dimensions. I've not the time to integrate it with WWF, but I think it should work.
 
I've downloaded the test-script and changed it to search the forum/smileys directory. The result: http://board.teraweb.ch/user/imagespecs.asp
 
I think with this script all avater sizes should be "hard-coded" directly in the asp and the CSS height/width arguments should me deleted...
(thats just the first idea I had)
 
Read more:
 
Greets
Chris
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.