Profile photo used as Avatar - why not use it? - Postet den (2757 Views)
Average Member
Panhandler
Innlegg: 783
783
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?
<
   
 Sidestørrelse 
Postet den
Junior Member
balexandre
Innlegg: 418
418
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.

<
Postet den
Average Member
Panhandler
Innlegg: 783
783
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 & _
<
Postet den
Forum Moderator
AnonJr
Innlegg: 5768
5768
All that does is change the display dimensions. A 2.3MB JPEG is still a 2.3MB download.<
Postet den
Support Moderator
Shaggy
Innlegg: 6780
6780
Change:
Code:
getCurrentIcon(trim(Reply_MemberPhoto), ChkString(Reply_MemberName,"display"), " width=""64"" height=""64""")
To:
Code:
getCurrentIcon(trim(Reply_MemberPhoto)&"|64|64", ChkString(Reply_MemberName,"display"), "")
And:
Code:
getCurrentIcon(trim(Member_Photo), ChkString(Reply_MemberName,"display"), " width=""64"" height=""64""")
To:
Code:
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.”
Postet den
Average Member
Panhandler
Innlegg: 783
783
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? <
Postet den
Junior Member
balexandre
Innlegg: 418
418
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.<
Postet den
Junior Member
texanman
Innlegg: 410
410
Works great Shaggy
Thaaaaaaaaaanks<
Postet den
New Member
radiodelicate
Innlegg: 53
53
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
Code:
style="margin-top: 5px,"
to the generated image tag, how would I do this?<
Postet den
New Member
radiodelicate
Innlegg: 53
53
okay, success is to be mine! *lol*
if anyone would like to know how, here it is:

Code:
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)<
Postet den
New Member
radiodelicate
Innlegg: 53
53
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?<
Du må legge inn en melding