Link to home
Start Free TrialLog in
Avatar of webdork
webdork

asked on

ASP FSO and Javascript Slideshow

Some EE wizard wrote the attached. It renders our the image but does not switch images. I have no thumbs, just 10 jpegs in a folder.

These are images taken of the first hole of our golf course.  I'm using an X10 camera and software to automagically take and upload the pics to our web server.

I need then to somehow manage the uploaded images by periodically deleting all but the 10 most recent. I've heard Powershell is in order for this kind of work, but I'm not familiar with it. I have full control of the web server.  Any help or other ideas welcome.
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Slideshow</title>          
<%
 response.write  "<scri" & "pt language=javascript>"    &  vbcrlf
 response.write  "var delta = 10;"   &  vbcrlf
 response.write  "var picno = 1;"   &  vbcrlf
 response.write "var  pictures  = new Array();"   &  vbcrlf
 response.write "var  titles    = new Array();"   &  vbcrlf

thumbFilePath = "http://www.jennco.com/avgcwebcam/"
imageFilePath = "http://www.jennco.com/avgcwebcam/"
strPhysicalPath="E:\web\users\jennco\avgcwebcam\"

Set fso = CreateObject("Scripting.FileSystemObject")
set mainfolder=fso.GetFolder(strPhysicalPath)
Set filecollection = mainfolder.Files
intTotPics = 0
For Each file In filecollection
      response.write "pictures[" & cstr(intTotPics) & " ] = '" & file.name  & "';"  &  vbcrlf
      response.write "titles[" & cstr(intTotPics) & " ] = '" & fso.getbasename(strPhysicalPath & file.name)  & "';"  &  vbcrlf
      if intTotPics = 0 then
        sFirstPic = file.name
        sFirstTitle = fso.getbasename(strPhysicalPath & file.name)
      End If
  intTotPics = intTotPics + 1
Next
%>                                              

function init()  {
    setInterval("FadeInOut(MyTable);", 10)
}  

function FadeInOut(obj)  {                  
    if ((obj.filters.alpha.opacity + delta > 100)
    ||  (obj.filters.alpha.opacity + delta < 0))  {
         if(obj.filters.alpha.opacity  + delta <= 0) {  
      // faded out, now change it      
    document.images("PicImg").src = "<%=imageFilePath%>" + pictures[picno];
    document.all.item("PicTitle").innerText = titles[picno];
          if (picno == pictures.length - 1) picno = 0;
          else picno++;        
    }    
        delta = - delta;                                            
    }
    obj.filters.alpha.opacity += delta;
}
</script>
</head>

<body onLoad="init()">  
<center>
<%Response.Write Ucase(mainfolder.Name)%>
<span id=MyTable  style="width:100%; filter:alpha(opacity=100); text-align:center;" >
<table border='0' cellpadding='4'>
<tr>
<td align="center">
<img id="PicImg" src='<%=imageFilePath & sFirstPic%>'>
</td>
</tr>
<tr>
 <td align="center">
<div id="PicTitle">
<%response.write sFirstTitle%>
</div>
</td>
</tr>
</table>
</span>
</body>

</html>

Open in new window

Avatar of amit_g
amit_g
Flag of United States of America image

Post the rendered code i.e. run it in the browser and do View Source and post that.
How come that is a solution :) If you resolved it yourself, post the solution here and accept that as an answer.
Avatar of webdork
webdork

ASKER

Didn't know i could.  
Avatar of webdork

ASKER

I was just so grateful that someone finally responded after 6 days.
ASKER CERTIFIED SOLUTION
Avatar of webdork
webdork

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of webdork

ASKER

simplified