Author |
Topic |
|
Panhandler
Average Member
USA
783 Posts |
Posted - 30 November 2007 : 09:39:08
|
There's a thread in the archives: http://forum.snitz.com/forum/topic.asp?ARCHIVE=true&TOPIC_ID=42690
Shaggy got a running start on a mod that uses the profile photo as an avatar. I think Shaggy's idea was good. However, the thread died out and was archived.
I attempted to implement it and got the same error as another poster: Error Type: Microsoft VBScript runtime (0x800A0009) Subscript out of range: '[number: 1]' /forumtest/inc_iconfiles.asp, line 183
...and this is what I read on inc_iconfiles.asp, line 183,
quote: -------------------------------------------------------------------------------- function getCurrentIcon(fIconName,fAltText,fOtherTags) if fIconName = "" then exit function if fOtherTags <> "" then fOtherTags = " " & fOtherTags if Instr(fIconName,"http://") > 0 then strTempImageUrl = "" else strTempImageUrl = strImageUrl tmpicons = split(fIconName,"|") if tmpicons(1) <> "" then fWidth = " width=""" & tmpicons(1) & """" if tmpicons(2) <> "" then fHeight = " height=""" & tmpicons(2) & """" getCurrentIcon = "<img src=""" & strTempImageUrl & tmpicons(0) & """" & fWidth & fHeight & " border=""0"" alt=""" & fAltText & """ title=""" & fAltText & """" & fOtherTags & " />" end function --------------------------------------------------------------------------------
The error appears in the box where the avatar would normally go. And the photo url is clean. . .no unusual marks. Any ideas on how to make this mod work?
< |
|
balexandre
Junior Member
Denmark
418 Posts |
Posted - 30 November 2007 : 14:06:47
|
it will get really, really bad !
imagine that in the profile photo the user have a 1024x768 pixels photo that he/she got from Picasa/FlickR/etc ...
did you ever tried to have a 1024x768 pixel photo into a 96 x 96 pixel box without any manipulation whatsoever?
1. The photo size will be the same, so imagine a 20 posts with photos (some bigger than others) will take ages to load, and always remember, not all know how to handle pictures, so you will get some users set the URL link of their profile photo as a 8MP or 10MP image, and that's almost 4Mb that the user will need to download just to show the avatar 2. Because the resize is not made proportionally you will get a guy really shrink or a girl extremely fat, and no one will know what's in that picture! 3. there is more, but this 2 are the terrifing ones
I started with that for my forum, and was horrible, I had to teach everyone how to crop an image uploaded and set it as new profile ... I had to do something and that's why I made a new MOD so users could upload the picture, crop it and set as an avatar.
< |
Bruno Alexandre (Strøby, DANMARK)
"a Portuguese in Danmark"
|
Edited by - balexandre on 30 November 2007 14:09:42 |
|
|
Panhandler
Average Member
USA
783 Posts |
Posted - 30 November 2007 : 15:19:16
|
As I understand it, the image was supposed to be reduced to fit the space. Here's Shaggy's code snippet. Perhaps that is the problem?
Lines 582 - 585 if strShowRank = 2 or strShowRank = 3 then Response.Write " " & getStar_Level(Reply_MemberLevel, Reply_MemberPosts) & "<br />" & vbNewLine end if if strPicture = 1 and trim(Reply_MemberPhoto) <> "" then Response.Write " " & getCurrentIcon(trim(Reply_MemberPhoto), ChkString(Reply_MemberName,"display"), " width=""64"" height=""64""") & "<br />" & vbNewLine end if Response.Write " </p>" & vbNewLine & _< |
|
|
AnonJr
Moderator
United States
5768 Posts |
Posted - 30 November 2007 : 21:37:37
|
All that does is change the display dimensions. A 2.3MB JPEG is still a 2.3MB download.< |
|
|
Shaggy
Support Moderator
Ireland
6780 Posts |
Posted - 03 December 2007 : 05:33:03
|
Change:getCurrentIcon(trim(Reply_MemberPhoto), ChkString(Reply_MemberName,"display"), " width=""64"" height=""64""") To:getCurrentIcon(trim(Reply_MemberPhoto)&"|64|64", ChkString(Reply_MemberName,"display"), "") And:getCurrentIcon(trim(Member_Photo), ChkString(Reply_MemberName,"display"), " width=""64"" height=""64""") To:getCurrentIcon(trim(Member_Photo)&"|64|64", ChkString(Reply_MemberName,"display"), "")
< |
Search is your friend “I was having a mildly paranoid day, mostly due to the fact that the mad priest lady from over the river had taken to nailing weasels to my front door again.” |
|
|
Panhandler
Average Member
USA
783 Posts |
Posted - 03 December 2007 : 10:02:27
|
quote: Originally posted by AnonJr
All that does is change the display dimensions. A 2.3MB JPEG is still a 2.3MB download.
I was thinking of using Proeder's mod, set to one specific folder and modifying it to restrict image sizes for that specific folder. User's would be permitted to upload avatars to that one folder.
In other words, it would be a common avatar folder and all users would have access to the avatars within it. Sounds like too much trouble? < |
|
|
balexandre
Junior Member
Denmark
418 Posts |
Posted - 04 December 2007 : 06:35:48
|
that's the Avatar MOD ...
did u tried already!?
and I need users to have that to implement my CROP on-the-fly mod
take a few minutes and see my MOD, you will see that you would love it to implement in your Forum and give the ability to users upload an image and crop it ... my users are loving it and now everyone has a nice avatar image of their own ... really nice.< |
Bruno Alexandre (Strøby, DANMARK)
"a Portuguese in Danmark"
|
Edited by - balexandre on 04 December 2007 06:47:56 |
|
|
texanman
Junior Member
United States
410 Posts |
Posted - 03 January 2008 : 16:10:43
|
Works great Shaggy Thaaaaaaaaaanks< |
|
|
radiodelicate
New Member
Sweden
53 Posts |
Posted - 08 July 2008 : 14:43:27
|
I was wondering, is it possible to use CSS on the avatars? I'm trying to figure out how to do it myself, but I've had no success yet I'm afraid.
Let's say I wanna add style="margin-top: 5px," to the generated image tag, how would I do this?< |
Edited by - radiodelicate on 08 July 2008 14:44:26 |
|
|
radiodelicate
New Member
Sweden
53 Posts |
Posted - 08 July 2008 : 15:02:11
|
okay, success is to be mine! *lol* if anyone would like to know how, here it is:
getCurrentIcon(trim(Reply_MemberPhoto)&"|64|64, ""style=""margin-top: 5px;""""", ChkString(Reply_MemberName,"display"), "")
same goes for the instance of "MemberPhoto"
thanks to this, it's easier to control the appearance of the avatar. For instance, you can set a max-height and a max-width, and wipe out the set width/height. That way, your images will resize, but they will keep their proportions, allowing non-square images to show up nicely. You can also assign the image a class or an id, and so gain further customization possibilities (as in you wouldn't have to type out the whole css directly in the tag, but can define it in inc_header.asp instead)< |
Edited by - radiodelicate on 08 July 2008 15:13:57 |
|
|
radiodelicate
New Member
Sweden
53 Posts |
Posted - 08 July 2008 : 18:27:30
|
okay I'm gutted. wiping out the "|64|64" into "||" and replace it with max-height and max-width using css works perfectly when viewing in Firefox, but in IE it will give me nothing at all. Is there any other way of keeping the aspect ratio?< |
Edited by - radiodelicate on 08 July 2008 18:33:44 |
|
|
Shaggy
Support Moderator
Ireland
6780 Posts |
Posted - 09 July 2008 : 04:31:00
|
Just assign the width [bold]or[/bold] the height rather than both, the other dimension will be set relative to the one you define. For example, if the image measures 100*200 and you set the width to 64, the height will be 128.
< |
Search is your friend “I was having a mildly paranoid day, mostly due to the fact that the mad priest lady from over the river had taken to nailing weasels to my front door again.” |
|
|
radiodelicate
New Member
Sweden
53 Posts |
Posted - 09 July 2008 : 05:44:23
|
thanks, but it still doesn't work in IE. argh... I'll keep on tweaking though, I suppose I'll get it right eventually.< |
|
|
radiodelicate
New Member
Sweden
53 Posts |
Posted - 09 July 2008 : 05:59:29
|
okay, I fixed it now. It was my use of both css and and set height/width that messed it up slightly. this is what I've got now anyway, if it would be of use for anybody else:
getCurrentIcon(trim(Reply_MemberPhoto)&"|100|", ChkString(Reply_MemberName,"display"), "class=""avatar""") and then in inc_header.asp (around line 277. Among the rest of the css anyway.):
".avatar {margin-top: 5px; padding: 3px; background-color: #ececec; border: 1px solid #b7b7b7;}" & vbNewLine & _ < |
|
|
Shaggy
Support Moderator
Ireland
6780 Posts |
Posted - 09 July 2008 : 06:22:55
|
Sorry, yes, shoul've pointed out that the height should be specified in the tag rather than the css.
< |
Search is your friend “I was having a mildly paranoid day, mostly due to the fact that the mad priest lady from over the river had taken to nailing weasels to my front door again.” |
|
|
radiodelicate
New Member
Sweden
53 Posts |
Posted - 09 July 2008 : 06:30:38
|
yes, and I kind of messed it up a bit before by putting the "class=""avatar""" in the wrong place, and therefore messing up the dimension proprieties. Hah I'm still really new to all this, but trial and error is my best friend. Been making lots of progress though, I'll post a link in Show-Off Your Forums once I'm happy enough with the whole thing :)< |
|
|
|
Topic |
|