Hello everyone

I have a photogallery site, where thumbnails are linked to counters.
the photos are numbered: 01.jpg, 02.jpg...and so on. The count is
stored in txt files with corresponding numbers: 01.txt, 02.txt...and
so on.

I am trying to compose a script that will read the counts from all of
the txt files, and then organize the way the thumbnaiils apper, in
order from highest hits to lowerst. here is the code so far, and the
url of the test page. any help getting this working would be
appreciated. there are 10 images in the directory.


so far, the order is off, and not all of the images display.

The test page is located at
http://www.robarspages.ca/devroot/p.../tempg/test.asp

(based on the current counts, if code is working correctly, images
sound display in this order):

01.jpg
07.jpg
02.jpg
03.jpg
10.jpg
04.jpg
05.jpg
09.jpg
08.jpg
06.jpg





<%
Dim numArray(10)
Dim counter, imgindex, hitcount, FS, RS, filename, imgcounter, maximages
Set FS = Server.CreateObject("Scripting.FileSystemObject")
 
For counter = 1 to UBound(numArray)
filename = counter & ".txt"
If counter < 10 Then filename = "0" & filename
Set RS =
FS.OpenTextFile(Server.MapPath("/devroot/photosite/tempg/counts") &
"\" & filename,1)
numarray(counter)=RS.Readline
Next
 
maximages = 10
 
For imgcounter = 1 to maximages
hitcount = -1
For counter = 1 to UBound(numArray)
        If numArray(counter) > hitcount Then
         hitcount = numArray(counter)
         imgindex = counter
         'reset this so you don't count it again
         numArray(counter) = -1
        End If 
Next
If imgindex < 10 Then imgindex = "0" & imgindex
 
Response.Write "<img
src=""http://www.robarspages.ca/devroot/p...mpg/thumbnails/"; &
imgindex & ".jpg""><br><br>"
 
Next
%>








 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/AspClassicAnyQuestionIsOk/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



Reply via email to