corsasport.co.uk
 

Corsa Sport » Message Board » General Chat » ASP Junkies, I need your help!


New Topic

New Poll
  Subscribe | Add to Favourites

You are not logged in and may not post or reply to messages. Please log in or create a new account or mail us about fixing an existing one - register@corsasport.co.uk

There are also many more features available when you are logged in such as private messages, buddy list, location services, post search and more.


Author ASP Junkies, I need your help!
PaulW
Member

Registered: 26th Jan 03
Location: Atherton, Greater Manchester
User status: Offline
27th Jan 04 at 22:24   View User's Profile U2U Member Reply With Quote

Never liked VB... Never liked ASP... Never used it until now!!

Okkkkk

I'm trying to make a gallery system for out schools website, I've got the underlying code (rather messy) which does the job to an extent, I need to do more to it and its taking a while!

But I need to do a thumbnail list so it displays say 4 across by 3 down (similiar to how the CS Gallery lists thumbnails), with an option to view all images in one page.

Code I got which currently lists the thumbnails is...

code:
Set thumbdir = FSO.GetFolder(root & path & "thumbs") 'needed to call the thumbs!
Set dirfiles = thumbdir.Files
For each dirfile in dirfiles
For ext = 0 to ubound(ValidExt)-1
If instr(right(lcase(dirfile), 4), ValidExt(ext)) > 0 then
result = result & " <tr>" & vbcrlf
result = result & " <td align=""center""><a href=""" & webpath & "?p=" & replace(path, "\", "/") & "lo-res/" & dirfile.name & """><img src=""" & webpath & replace(path, "\", "/") & "thumbs/" & dirfile.name & """></a></td>" & vbcrlf & " <td nowrap><a href=""" & webpath & "?p=" & replace(path, "\", "/") & "lo-res/" & dirfile.name & """>" & dirfile.name & "</a></td>" & vbcrlf
result = result & " </tr>" & vbcrlf
End if
Next
Next



this just lists a 2 column spread, 1 with image, other with filename (just for reference atm)

But I'm trying to step the for each statement, but cant do inc, & unsure how arrays properly work in VB/ASP...

ahhhhh boooolocks!

[Edited on 27-01-2004 by PaulW]
PaulW
Member

Registered: 26th Jan 03
Location: Atherton, Greater Manchester
User status: Offline
28th Jan 04 at 00:03   View User's Profile U2U Member Reply With Quote

Ian
Site Administrator

Avatar

Registered: 28th Aug 99
Location: Liverpool
User status: Offline
28th Jan 04 at 19:49   View Garage View User's Profile U2U Member Reply With Quote

The CS one counts down as well, and uses that figure to pad the cells on the last row so everything stays in line and predictable. Just print a td with colspan of this number.

Also what the hell is this - ubound(ValidExt)-1

I'd also be checking for a valid file extension before it loops. You don't want to skip a file while you're drawing table cells, the row may end up containing less images that you want across there.

 
New Topic

New Poll

Corsa Sport » Message Board » General Chat » ASP Junkies, I need your help! 24 database queries in 0.0101430 seconds