Author |
Topic |
BitByter
New Member
Netherlands
53 Posts |
Posted - 13 June 2002 : 17:37:18
|
I have installed the Avatar mod v2.0 and it works GREAT. Is there a way for the user to set a url and have that as an avatar, rather than just using the avatars I have on my server? i hate to put manually all the avatars on the server :(
|
|
dayve
Forum Moderator
USA
5820 Posts |
|
BitByter
New Member
Netherlands
53 Posts |
Posted - 14 June 2002 : 06:38:00
|
where can i find "the original avatar mod" then? i really would periciate it ;)
|
|
|
dayve
Forum Moderator
USA
5820 Posts |
Posted - 15 June 2002 : 01:11:43
|
quote:
where can i find "the original avatar mod" then? i really would periciate it ;)
not to be rude, but did you try the search feature??
http://www.nineinchnailz.com |
|
|
BitByter
New Member
Netherlands
53 Posts |
Posted - 16 June 2002 : 12:20:49
|
yep serveral times
i looked up every thread wich contained the word "avatar" but didn't find what i needed
only the avatar version 2
i thought the mod didn't exist when i looked up all the threads but it exists, i can't find it, sorry if i'm annoying
|
|
|
dayve
Forum Moderator
USA
5820 Posts |
Posted - 16 June 2002 : 13:34:26
|
maybe I'm mistaken, its been so long since I've used the standard avatar mod. did you ever consider using the avatar upload mod? this is by far one of the best mods IMHO. it allows members to upload avatars to your server and keeps the size restricted proportionally.
http://www.nineinchnailz.com |
|
|
BitByter
New Member
Netherlands
53 Posts |
Posted - 17 June 2002 : 05:21:34
|
i have considerd yes, but i only have 50mb webspace... and all forums i visit, they have a similar avatar solution,
it's the handiest way :)
|
|
|
red1
Junior Member
355 Posts |
Posted - 17 June 2002 : 10:40:58
|
I just thought of something for the avatar mod. Maybe instead of setting the img width and height, we can set a maximum width and height instead. If the avatar width or height exceeds the maximum, the img is resized, but if not it is displayed full size. That way there's a little more flexibility to selecting an avatar, but you still prevent your users from selecting extremely large avatars.
I think it can be done in javascript but I don't know how.
|
|
|
dayve
Forum Moderator
USA
5820 Posts |
Posted - 17 June 2002 : 11:02:16
|
red1 I have already done that , it is incorporated with the Avatar Upload Mod that I posted here and the bit of code that does it is here (it restricts the avatar to a viewing of 100X100 and keeps it proportional, even if it is smaller than 100X100):
Sub GetPicFileInfo( i_sFilename, o_PicType, o_nWidth, o_nHeight )
i_sFilename = replace(i_sFilename, "/", "\", 1, -1, 1) o_PicType = "" o_nWidth = 0 o_nHeight = 0
Dim fso, ts Dim GIF_MARKER, JPG_MARKER
GIF_MARKER = "GIF8" JPG_MARKER = Chr(&HFF) & Chr(&HD8) & Chr(&HFF) & Chr(&HE0)
Set fso = CreateObject("Scripting.FileSystemObject")
On Error Resume Next
Set ts = fso.OpenTextFile(Server.MapPath("/snitz33/" & i_sFilename))
If Err.Number <> 0 Then Err.Clear Set ts = fso.OpenTextFile("/snitz33/halo.gif") End if
Select Case ts.Read(4) Case GIF_MARKER o_PicType = "GIF" ts.Skip(2) If Err.Number <> 0 Then Exit Sub End If o_nWidth = Asc(ts.Read(1)) + ( Asc(ts.Read(1))* 256 ) o_nHeight = Asc(ts.Read(1)) + ( Asc(ts.Read(1))* 256 )
Case JPG_MARKER o_PicType = "JPG"
Dim byteVal, bDone bDone = False byteVal = Asc(ts.Read(1)) Do While Not ts.AtEndOfStream And byteVal <> &HD8 And Not bDone 'look for the next marker (xFF) Do While Not ts.AtEndOfStream And byteVal <> &HFF byteVal = Asc(ts.Read(1)) Loop
'Get past any repeated xFF markers Do While Not ts.AtEndOfStream And byteVal = &HFF byteVal = Asc(ts.Read(1)) Loop
'Check out the marker 'if this is the width/height section then read the values If ((byteVal >= &HC0) And (byteVal <= &HC3)) Then ts.Skip(3) If Err.Number <> 0 Then Exit Sub End If If Not ts.EOF Then o_nHeight = (Asc(ts.Read(1)) * 256) + Asc(ts.Read(1)) o_nWidth = (Asc(ts.Read(1)) * 256) + Asc(ts.Read(1)) bDone = True End If Else 'this is a comment or other stuff we are not interested in. 'we must read the size and then skip over this section Dim nSectionLength nSectionLength = (Asc(ts.Read(1)) * 256) + Asc(ts.Read(1))
'NOTE: we subtract two since from the size since we already 'are past the length bytes which are included in the size ts.Skip(nSectionLength - 2) byteVal = Asc(ts.Read(1))
If Err.Number <> 0 Then Exit Sub End If End If Loop End Select
maxwidth = 100 maxheight = 100 if o_nWidth > maxwidth or o_nHeight > maxheight then if o_nWidth > maxwidth then o_nHeight = cInt(o_nHeight * maxwidth/o_nWidth) o_nWidth = maxwidth if (o_nHeight > maxheight) then o_nWidth = cInt(o_nWidth * maxheight/o_nHeight) o_nHeight = maxheight end if elseif o_nHeight > maxheight then o_nWidth = cInt(o_nWidth * maxheight/o_nHeight) o_nHeight = maxheight if (o_nWidth > maxwidth) then o_nHeight = cInt(o_nHeight * maxwidth/o_nWidth) o_nWidth = maxwidth end if end if end if o_nText = " X " response.write " width=""" & o_nWidth & """ height=""" & o_nHeight & """" response.write " title=""" & o_nWidth & o_nText & o_nHeight & """" Set ts = Nothing Set fso = Nothing End Sub
and this is how the image is called:
<img src="<% =rsReplies("M_AVATAR_URL") %>" align="absmiddle" <%Call GetPicFileInfo(rsReplies("M_AVATAR_URL"), 0, 0, 0)%> hspace="0" >
http://www.nineinchnailz.com
Edited by - dayve on 17 June 2002 11:03:24 |
|
|
red1
Junior Member
355 Posts |
Posted - 17 June 2002 : 11:09:02
|
hey great work, thanks a lot!
|
|
|
BitByter
New Member
Netherlands
53 Posts |
Posted - 17 June 2002 : 13:08:58
|
but is there a mod that uses the "url method" ?
i still can't find it,
i have visited many snitz forum's but all forums uses the avatar v2 mod
|
|
|
MDGamezz
Junior Member
USA
100 Posts |
Posted - 17 June 2002 : 20:21:36
|
quote:
yep serveral times
i looked up every thread wich contained the word "avatar" but didn't find what i needed
only the avatar version 2
i thought the mod didn't exist when i looked up all the threads but it exists, i can't find it, sorry if i'm annoying
Avatar version 2 would do what your asking. You did say that you found it correct? Regardless , you could look at nathan's site for snitz mod's. http://ls3k.com/snitz/ He has the avatars mod and the upload avatars mod (I think). I prefer the upload version for avatars.. It just makes things easier for that member that's unable to type a working url.
MDGamezz
Edited by - MDGamezz on 17 June 2002 20:22:29 |
|
|
red1
Junior Member
355 Posts |
Posted - 17 June 2002 : 21:18:25
|
dayve I'm having a little trouble using that proportionizing code... you see I don't have the avatar upload mod (I can't use it on brinkster) so I'm trying to incorporate the code you gave me to the regular avatar mod, but I'm running into some errors. Maybe I can download your complete mod so I can see how it's used?
Edited by - red1 on 17 June 2002 21:23:26 |
|
|
dayve
Forum Moderator
USA
5820 Posts |
Posted - 17 June 2002 : 22:47:32
|
you can not use this script against LINKED images, they must be on your server AND you must have FSO enabled in the directory where you are reading the images.
http://www.nineinchnailz.com |
|
|
MDGamezz
Junior Member
USA
100 Posts |
Posted - 17 June 2002 : 22:49:57
|
Red1 What would the exact problem be? Is the size proportioning not working? The avatars must be hosted on your server for the size proportioning to work.
You could be having the same trouble I ran into. You've installed the mod and now your avatars are gone all together. (This one stumped me for a while.) Then I decided if maybe I look at the code and not just copy and paste I might see what's wrong. There it was. ("/snitz33/ (2 places) You have to point it to your forum directory. So I changed snitz33 to forum and everything worked fine.
I'm just shooting in the dark here since you didn't post what the exact problem was. If it's to technical of a problem I'll just craw back into my corner and let the big guys help.
MDGamezz
Edited by - MDGamezz on 17 June 2002 22:51:15 |
|
|
red1
Junior Member
355 Posts |
Posted - 17 June 2002 : 23:30:54
|
in topic.asp I see two instances of inserting the avatar, do I replace both of them with <img src="<% =rsReplies("M_AVATAR_URL") %>" align="absmiddle" <%Call GetPicFileInfo(rsReplies("M_AVATAR_URL"), 0, 0, 0)%> hspace="0" >
??
|
|
|
Topic |
|