Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Snitz Forums 2000 MOD-Group
 MOD Add-On Forum (W/O Code)
 Avatar Mod Question
 New Topic  Topic Locked
 Printer Friendly
Next Page
Author Previous Topic Topic Next Topic
Page: of 2

BitByter
New Member

Netherlands
53 Posts

Posted - 13 June 2002 :  17:37:18  Show Profile  Visit BitByter's Homepage
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

Posted - 14 June 2002 :  00:00:45  Show Profile  Visit dayve's Homepage
I thought the original avatar mod worked exactly that way (using urls)


http://www.nineinchnailz.com
Go to Top of Page

BitByter
New Member

Netherlands
53 Posts

Posted - 14 June 2002 :  06:38:00  Show Profile  Visit BitByter's Homepage
where can i find "the original avatar mod" then?
i really would periciate it ;)

Go to Top of Page

dayve
Forum Moderator

USA
5820 Posts

Posted - 15 June 2002 :  01:11:43  Show Profile  Visit dayve's Homepage
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
Go to Top of Page

BitByter
New Member

Netherlands
53 Posts

Posted - 16 June 2002 :  12:20:49  Show Profile  Visit BitByter's Homepage
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

Go to Top of Page

dayve
Forum Moderator

USA
5820 Posts

Posted - 16 June 2002 :  13:34:26  Show Profile  Visit dayve's Homepage
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
Go to Top of Page

BitByter
New Member

Netherlands
53 Posts

Posted - 17 June 2002 :  05:21:34  Show Profile  Visit BitByter's Homepage
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 :)

Go to Top of Page

red1
Junior Member

355 Posts

Posted - 17 June 2002 :  10:40:58  Show Profile
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.

Go to Top of Page

dayve
Forum Moderator

USA
5820 Posts

Posted - 17 June 2002 :  11:02:16  Show Profile  Visit dayve's Homepage
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
Go to Top of Page

red1
Junior Member

355 Posts

Posted - 17 June 2002 :  11:09:02  Show Profile
hey great work, thanks a lot!

Go to Top of Page

BitByter
New Member

Netherlands
53 Posts

Posted - 17 June 2002 :  13:08:58  Show Profile  Visit BitByter's Homepage
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

Go to Top of Page

MDGamezz
Junior Member

USA
100 Posts

Posted - 17 June 2002 :  20:21:36  Show Profile  Send MDGamezz an AOL message  Send MDGamezz an ICQ Message
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
Go to Top of Page

red1
Junior Member

355 Posts

Posted - 17 June 2002 :  21:18:25  Show Profile
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
Go to Top of Page

dayve
Forum Moderator

USA
5820 Posts

Posted - 17 June 2002 :  22:47:32  Show Profile  Visit dayve's Homepage
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
Go to Top of Page

MDGamezz
Junior Member

USA
100 Posts

Posted - 17 June 2002 :  22:49:57  Show Profile  Send MDGamezz an AOL message  Send MDGamezz an ICQ Message
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
Go to Top of Page

red1
Junior Member

355 Posts

Posted - 17 June 2002 :  23:30:54  Show Profile
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" >

??

Go to Top of Page
Page: of 2 Previous Topic Topic Next Topic  
Next Page
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.31 seconds. Powered By: Snitz Forums 2000 Version 3.4.07