Print Page | Close Window

Dynamic Avatar Mod show all files in folder

Printed From: Web Wiz Forums
Category: Web Wiz Web App Support Forums
Forum Name: Web Wiz Forums Modifications
Forum Description: Mod's and Add-on's for Web Wiz Forums.
URL: https://forums.webwiz.net/forum_posts.asp?TID=20414
Printed Date: 29 March 2026 at 10:57pm
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: Dynamic Avatar Mod show all files in folder
Posted By: BrownGhost
Subject: Dynamic Avatar Mod show all files in folder
Date Posted: 24 June 2006 at 6:07pm
here is the thing, it works great, i use it back in V7 and now in V8 also :)
No problems.

Find file: forum/includes/select_avatar.asp
Just replase all inside thet file whit the code below :)

It will show all files you have in your avatar folder.
So you can just upload all the default avatar files you like :)

it shows files names, so if you upload a file thet has a name like this:
1213244324.jpg  then the user will see thet in the list.
try making your avarar files look nice for the user the selest from.

Cool_Man.jpg will look better than: 1213244324.jpg

<%
'#########################################################################
'##
'## Select Avatar WebWizForums v7.x
'## Works in version 8.x also testst by www.QCode.dk
'##
'## If you have any problems with this visit www.maddogs-asp.com
'## and post on the forums with the problem you are having and
'## if you have any error please post the full error so we can
'## help you easyer.
'##
'## Just change the database connection in the strMembersModCon
'## variable.
'##
'## Then make sure the strMembersModForumPath is the right path
'## to your forum.
'##
'## Writen by Drew Gauderman (aka MadDog)
'## Email: drew@madasp.com
'## Website: www.maddogs-asp.com
'##
'#########################################################################

Dim fso
Dim rootFolder
Dim files
Dim file

Set fso = Server.CreateObject("Scripting.FileSystemObject")
Set rootFolder = fso.GetFolder(Server.MapPath("avatars/"))
Set files = rootFolder.Files


For Each file in files
    If file.Type = "GIF Image" OR file.Type = "JPG Image" OR file.Type = "JPEG Image" Then
        Response.Write("          <option value=""avatars/" & file.Name & """>" & file.Name & "</option>")
    End If
Next

Set rootFolder = Nothing
Set fso = Nothing
Set files = Nothing
%>



Thats all. hope some of you can use this, i use it, and love it :)



-------------
Thanks
BrownGhost

http://www.pitbull.dk" rel="nofollow - http://www.pitbull.dk



Replies:
Posted By: cfilut
Date Posted: 02 December 2006 at 4:33pm
when trying to edit profile, I get this message after installing this code, 

Microsoft VBScript compilation error '800a0411'

Name redefined

/forum/includes/select_avatar.asp, line 24

Dim fso
----^
 
Any suggestions?


-------------
You are what you eat, So stay away from the jerk chicken.


Posted By: coolguy
Date Posted: 02 December 2006 at 5:23pm
you have fso defined twice, find the other Dim fso and delete it.


Posted By: cfilut
Date Posted: 04 December 2006 at 4:54pm
thanks cool guy I took the code from the top of select_avatar.asp which looked like this
 
Dim fso
Dim rootFolder
Dim files
Dim file
 
and deleted so it looks like this
Dim rootFolder
Dim file
 
And it seems to work.   Thanks.Smile


-------------
You are what you eat, So stay away from the jerk chicken.



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net