Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - Dynamic Avatar Mod show all files in folder
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Dynamic Avatar Mod show all files in folder

 Post Reply Post Reply
Author
BrownGhost View Drop Down
Groupie
Groupie


Joined: 26 November 2002
Status: Offline
Points: 193
Post Options Post Options   Thanks (0) Thanks(0)   Quote BrownGhost Quote  Post ReplyReply Direct Link To This Post Topic: Dynamic Avatar Mod show all files in folder
    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
Back to Top
cfilut View Drop Down
Newbie
Newbie


Joined: 24 February 2005
Location: United States
Status: Offline
Points: 11
Post Options Post Options   Thanks (0) Thanks(0)   Quote cfilut Quote  Post ReplyReply Direct Link To This Post 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?
Back to Top
coolguy View Drop Down
Newbie
Newbie
Avatar

Joined: 14 November 2006
Location: United States
Status: Offline
Points: 37
Post Options Post Options   Thanks (0) Thanks(0)   Quote coolguy Quote  Post ReplyReply Direct Link To This Post Posted: 02 December 2006 at 5:23pm
you have fso defined twice, find the other Dim fso and delete it.
Back to Top
cfilut View Drop Down
Newbie
Newbie


Joined: 24 February 2005
Location: United States
Status: Offline
Points: 11
Post Options Post Options   Thanks (0) Thanks(0)   Quote cfilut Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.