SiteExperts.com Logo Home | Community | Developer's Paradise
User Groups | Site Tools | Site Information | Search
 Main Menu
 Forums
SiteExperts.com Forums
All Discussions

SiteExperts Feedback
The Lounge
Dynamic HTML
Site Design/ Critiques
HTML and CSS
XML Technologies
The Wireless Internet
Internet Explorer
Microsoft .NET
The Server
Technical Support

Sponsored Links

User Groups : Forums : SiteExperts : HTML and CSS :

Previous DiscussionNext Discussion
 How To Load Random Pictures In A Cell As Image Or Background From A Directo

 

Subject : How To Load Random Pictures In A Cell As Image Or Background From A Directory

Hi,

 

  Need some script to change the background picture or image inside a cell (for every 10 seconds & load pictures random) then kindly send me. It will be more helpful

 

Thankyou,

Chock.

Started By itchock on Feb 28, 2006 at 11:58:22 PM

66 Response(s) | Reply

Earlier Replies | Replies 25 to 31 of 66 | Later Replies
Goto Page: 10 9 8 7 6 5 4 3 2 1
bod1467 on Mar 30, 2006 at 11:37:40 PM (# 25)

Here's an example that gets all the files in a folder and stores them in a recordset (NOT a database) ...

<% @ LANGUAGE=VBSCRIPT %>
<%
Option Explicit
Response.Expires = -1000
Const ForReading = 1, ForWriting = 2, ForAppending = 8
Const adVarChar = 200, adOpenDynamic = 2, adFldUpdatable = &H00000004, adInteger = 3, adDate = 7
Dim f, fso, path, fldr, fldrs, thisfldr, fls, rs, count, i, orderby, passwd, showOK

orderby = Request.querystring("OrderBy")
If orderby = "" Then orderby = "FileName"

Set rs = Server.CreateObject("ADODB.Recordset")

rs.Fields.Append "FileName", adVarChar, 100, adFldUpdatable
rs.Fields.Append "FileType", adVarChar, 40, adFldUpdatable
rs.Fields.Append "FileSize", adInteger, 40, adFldUpdatable
rs.Fields.Append "LastMod", adDate, 40, adFldUpdatable
rs.Open , , adOpenDynamic

path = Request.Servervariables("PATH_TRANSLATED")
path = StrReverse(path)
path = Mid(path,InStr(path,"\"),Len(path))
path = StrReverse(path)

Set fso = CreateObject("Scripting.FileSystemObject")
Set fldr = fso.getFolder(path)
Set fldrs = fldr.subFolders

For each thisfldr in fldrs
  rs.AddNew
  rs("FileName") = thisfldr.Name
  rs("FileType") = thisfldr.Type
  rs("FileSize") = thisfldr.Size
  rs("LastMod") = thisfldr.DateLastModified
  rs.Update
Next 'thisfldr

Set fls = fldr.Files
For each f in fls
  rs.AddNew
  rs("FileName") = f.Name
  rs("FileType") = f.Type
  rs("FileSize") = f.Size
  rs("LastMod") = f.DateLastModified
  rs.Update
Next 'f

Select Case orderby
  Case "FileName" rs.Sort = "FileName"
  Case "FileType" rs.Sort = "FileType"
  Case "FileSize" rs.Sort = "FileSize"
  Case "LastMod" rs.Sort = "LastMod"
  Case Else rs.Sort = "FileName"
End Select

rs.MoveFirst
%>

You can then use the recordset how you want. \o/


RobinAnn on Apr 3, 2006 at 8:31:19 PM (# 26)

I must be DUH bcas I tried both and got nil. You can check out www.robin-ann.net/images and www.robin-ann.net/images/go.vbs to see what I did - if you want to.


Winterwolf on Apr 4, 2006 at 1:43:26 PM (# 27)

RobinAnn: I suspect you did not place the code I gave you in an asp file. that would be why I can see the <%= and %> tags in the source. And probably why the code didnt do what you expected.


ChrisRickard on Apr 4, 2006 at 1:48:06 PM (# 28)

And are you running IIS?


RobinAnn on Apr 4, 2006 at 6:36:42 PM (# 29)

Chris - What's IIS? Is that like BachusII? ;-)

Winterwolf - oopsie

 


BachusII on Apr 4, 2006 at 11:42:06 PM (# 30)

Hey now, that's an offensive remark. I don't go around calling you names, do I?


MHenke on Apr 5, 2006 at 1:10:55 AM (# 31)

LOL, that's forsooth an inadequate comparison, I'd bet. Two completely incompatible technologies... 8)


Earlier Replies | Replies 25 to 31 of 66 | Later Replies
Goto Page: 10 9 8 7 6 5 4 3 2 1

To respond to a discussion, you must first logon.

If you are not registered, please register yourself to become a member of the SiteExperts.community.

User Name
Password
Copyright 1997-2004 InsideDHTML.com, LLC. All rights reserved.