473,569 Members | 2,604 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Skript problem / display in 3 rows

Hi,
if a problem wiht the folowing script. i would like to diplay the results in tree rows, and i have no idea where to do this in the script. I would be very glad if someone can help me....

_______________ _______________ ______________
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<%
Dim strThisPage
strThisPage = Request.ServerV ariables("SCRIP T_NAME")
strThisPage = Right(strThisPa ge, Len(strThisPage ) - 1)

''Path To Folder That holds Files To Download Here
''Default is the current Folder
FILE_FOLDER = StripFileName(R equest.ServerVa riables("PATH_T RANSLATED"))

file_path ="72dpi/aussen/"
file_path300 ="300dpi/aussen/"

FILE_FOLDER = FILE_FOLDER & file_path


''Constants
Const adVarChar = 200
Const adInteger = 3
Const adDate = 7
Const adFileTime = 64
Const adNumeric = 131

%>
<HTML>
<HEAD>
<TITLE>Pressefo tos</TITLE>
</HEAD>

<BODY >
<TABLE BORDER=1 ID=tblFileData >

<%
strSortHeader = Request.QuerySt ring("sort")

IF strSortHeader = "" Then
Call GetAllFiles("")
Else
Call GetAllFiles(str SortHeader)
End IF
%>
</TABLE>
</BODY>
</HTML>
<%

Sub GetAllFiles(str SortBy)
Dim oFS, oFolder, oFile
Set oFS = Server.CreateOb ject("Scripting .FileSystemObje ct")

''Set Folder Object To Proper File Directory
Set oFolder = oFS.getFolder(F ILE_FOLDER)

Dim intCounter

intCounter = 0

IF strSortBy = "" Then ''UnSorted (default)
Dim FileArray()
ReDim Preserve FileArray(oFold er.Files.Count, 5)

For Each oFile in oFolder.Files
strFileName = oFile.Name
strFileType = oFile.Type
strFileSize = oFile.Size
strFilePath = oFile.Path
strFileDtMod = oFile.DateLastM odified
Image_Path = Server.URLEncod e(Server.MapPat h(file_path) &"\" & strfilename )

FileArray(intCo unter, 0) = strFileName
FileArray(intCo unter, 1) = "<a href=" & FILE_path & strfilename & " target=new > <img src=sendbinary. asp?image_path= " & image_path & _
"> </A>" & "<br><cente r>" _
& "<A HREF=''Download 2.asp?pathtest= " & file_path & "&filetest= " & strfilename &"'' ><img src=download72d pi_w.gif>" _
& "<A HREF=''Download 2.asp?pathtest= " & file_path300 & "&filetest= " & strfilename &"'' ><img src=download300 dpi_w.gif></center>"

intCounter = (intCounter +1)

Next

intRows = uBound(FileArra y, 1)
intCols = uBound(FileArra y, 2)

For x = 0 To intRows -1
Echo("<Tr>")
For z = 0 To intCols

If z > 0 Then
BuildTableCol(F ileArray(x, z))
End IF

Next
Echo("</Tr>")
Next

Else
''Sorted List

Set oRS = Server.CreateOb ject("ADODB.Rec ordset")
oRS.Fields.Appe nd "Name", adVarChar, 500
oRS.Fields.Appe nd "Type", adVarChar, 500
oRS.Fields.Appe nd "Size", adInteger
oRS.Fields.Appe nd "Path", adVarChar, 500
oRS.Fields.Appe nd "Date", adFileTime
oRS.Open

For Each oFile in oFolder.Files
strFileName = oFile.Name
strFileType = oFile.Type
strFileSize = oFile.Size
strFilePath = oFile.Path
strFileDtMod = oFile.DateLastM odified

oRS.AddNew
oRS.Fields("Nam e").Value = "<img src=" & strFilePath & strFileName & ">""<A HREF=" & Chr(34) & "startDownload. asp?File=" _
& Server.urlEncod e(strFilePath) & "&Name=" & Server.urlEncod e(strFileName) & "&Size=" & strFileSize & Chr(34) _
& " onMouseOver=" & Chr(34) & "self.status='' " & strFileName & "''; return true;" & Chr(34) _
& " onMouseOut=" & Chr(34) & "self.status='' ''; return true;" & Chr(34) & ">" & strFileName & "</A>"
oRS.Fields("Typ e").Value = strFileType
oRS.Fields("Siz e").Value = strFileSize
oRS.Fields("Pat h").Value = strFilePath
oRS.Fields("Dat e").Value = strFileDtMod
Next

oRS.Sort = strSortBy & " ASC"

Do While Not oRS.EOF
Echo("<TR>")
BuildTableCol(o RS("Name"))
BuildTableCol(o RS("Type"))
BuildTableCol(o RS("Size"))
BuildTableCol(o RS("Path"))
BuildTableCol(o RS("Date"))
Echo("</TR>")
oRS.MoveNext
Loop

oRS.Close
Set oRS = Nothing
End IF

EchoB("<B>" & oFolder.Files.C ount & " Files Available</B>")

Cleanup oFile
Cleanup oFolder
Cleanup oFS
End Sub

Function Echo(str)
Echo = Response.Write( str & vbCrLf)
End Function

Function EchoB(str)
EchoB = Response.Write( str & "<BR>" & vbCrLf)
End Function

Sub Cleanup(obj)
IF isObject(obj) Then
Set obj = Nothing
End IF
End Sub

Function StripFileName(s trFile)
StripFileName = Left(strFile, inStrRev(strFil e, "\"))
End Function

Sub BuildTableCol(s trData)
Echo("<TD CLASS=DataCol>" & strData & "</TD>")

End Sub

''Not implemented
Sub BuildTableRow(a rrData)
Dim intCols
intCols = uBound(arrData)
For y = 0 To intCols
Echo("<TD CLASS=DataCol>" & arrData(y) & "</TD>")
Next
End Sub

%>
_______________ _______________ ____

thaks for helping .... :-)

-----------------------------
This message is posted by http://Asp.ForumsZone.com

Jul 19 '05 #1
2 2455
use tables.
Simply add a counter and when you get to (n) start a new row

--
----------------------------------------------------------
Curt Christianson (Software_AT_Da rkfalz.Com)
Owner/Lead Designer, DF-Software
http://www.Darkfalz.com
---------------------------------------------------------
...Offering free scripts & code snippits for everyone...
---------------------------------------------------------

<in**@kvc-online.de> wrote in message
news:48******** *****@Asp.Forum sZone.com...
Hi,
if a problem wiht the folowing script. i would like to diplay the results in tree rows, and i have no idea where to do this in the script. I would be
very glad if someone can help me....
_______________ _______________ ______________
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<%
Dim strThisPage
strThisPage = Request.ServerV ariables("SCRIP T_NAME")
strThisPage = Right(strThisPa ge, Len(strThisPage ) - 1)

''Path To Folder That holds Files To Download Here
''Default is the current Folder
FILE_FOLDER = StripFileName(R equest.ServerVa riables("PATH_T RANSLATED"))

file_path ="72dpi/aussen/"
file_path300 ="300dpi/aussen/"

FILE_FOLDER = FILE_FOLDER & file_path


''Constants
Const adVarChar = 200
Const adInteger = 3
Const adDate = 7
Const adFileTime = 64
Const adNumeric = 131

%>
<HTML>
<HEAD>
<TITLE>Pressefo tos</TITLE>
</HEAD>

<BODY >
<TABLE BORDER=1 ID=tblFileData >

<%
strSortHeader = Request.QuerySt ring("sort")

IF strSortHeader = "" Then
Call GetAllFiles("")
Else
Call GetAllFiles(str SortHeader)
End IF
%>
</TABLE>
</BODY>
</HTML>
<%

Sub GetAllFiles(str SortBy)
Dim oFS, oFolder, oFile
Set oFS = Server.CreateOb ject("Scripting .FileSystemObje ct")

''Set Folder Object To Proper File Directory
Set oFolder = oFS.getFolder(F ILE_FOLDER)

Dim intCounter

intCounter = 0

IF strSortBy = "" Then ''UnSorted (default)
Dim FileArray()
ReDim Preserve FileArray(oFold er.Files.Count, 5)

For Each oFile in oFolder.Files
strFileName = oFile.Name
strFileType = oFile.Type
strFileSize = oFile.Size
strFilePath = oFile.Path
strFileDtMod = oFile.DateLastM odified
Image_Path = Server.URLEncod e(Server.MapPat h(file_path) &"\" & strfilename )
FileArray(intCo unter, 0) = strFileName
FileArray(intCo unter, 1) = "<a href=" & FILE_path & strfilename & " target=new > <img src=sendbinary. asp?image_path= " & image_path & _ "> </A>" & "<br><cente r>" _
& "<A HREF=''Download 2.asp?pathtest= " & file_path & "&filetest= " & strfilename &"'' ><img src=download72d pi_w.gif>" _ & "<A HREF=''Download 2.asp?pathtest= " & file_path300 & "&filetest= " & strfilename &"'' ><img src=download300 dpi_w.gif></center>"
intCounter = (intCounter +1)

Next

intRows = uBound(FileArra y, 1)
intCols = uBound(FileArra y, 2)

For x = 0 To intRows -1
Echo("<Tr>")
For z = 0 To intCols

If z > 0 Then
BuildTableCol(F ileArray(x, z))
End IF

Next
Echo("</Tr>")
Next

Else
''Sorted List

Set oRS = Server.CreateOb ject("ADODB.Rec ordset")
oRS.Fields.Appe nd "Name", adVarChar, 500
oRS.Fields.Appe nd "Type", adVarChar, 500
oRS.Fields.Appe nd "Size", adInteger
oRS.Fields.Appe nd "Path", adVarChar, 500
oRS.Fields.Appe nd "Date", adFileTime
oRS.Open

For Each oFile in oFolder.Files
strFileName = oFile.Name
strFileType = oFile.Type
strFileSize = oFile.Size
strFilePath = oFile.Path
strFileDtMod = oFile.DateLastM odified

oRS.AddNew
oRS.Fields("Nam e").Value = "<img src=" & strFilePath & strFileName & ">""<A HREF=" & Chr(34) & "startDownload. asp?File=" _ & Server.urlEncod e(strFilePath) & "&Name=" & Server.urlEncod e(strFileName) & "&Size=" & strFileSize & Chr(34) _ & " onMouseOver=" & Chr(34) & "self.status='' " & strFileName & "''; return true;" & Chr(34) _ & " onMouseOut=" & Chr(34) & "self.status='' ''; return true;" & Chr(34) & ">" & strFileName & "</A>" oRS.Fields("Typ e").Value = strFileType
oRS.Fields("Siz e").Value = strFileSize
oRS.Fields("Pat h").Value = strFilePath
oRS.Fields("Dat e").Value = strFileDtMod
Next

oRS.Sort = strSortBy & " ASC"

Do While Not oRS.EOF
Echo("<TR>")
BuildTableCol(o RS("Name"))
BuildTableCol(o RS("Type"))
BuildTableCol(o RS("Size"))
BuildTableCol(o RS("Path"))
BuildTableCol(o RS("Date"))
Echo("</TR>")
oRS.MoveNext
Loop

oRS.Close
Set oRS = Nothing
End IF

EchoB("<B>" & oFolder.Files.C ount & " Files Available</B>")

Cleanup oFile
Cleanup oFolder
Cleanup oFS
End Sub

Function Echo(str)
Echo = Response.Write( str & vbCrLf)
End Function

Function EchoB(str)
EchoB = Response.Write( str & "<BR>" & vbCrLf)
End Function

Sub Cleanup(obj)
IF isObject(obj) Then
Set obj = Nothing
End IF
End Sub

Function StripFileName(s trFile)
StripFileName = Left(strFile, inStrRev(strFil e, "\"))
End Function

Sub BuildTableCol(s trData)
Echo("<TD CLASS=DataCol>" & strData & "</TD>")

End Sub

''Not implemented
Sub BuildTableRow(a rrData)
Dim intCols
intCols = uBound(arrData)
For y = 0 To intCols
Echo("<TD CLASS=DataCol>" & arrData(y) & "</TD>")
Next
End Sub

%>
_______________ _______________ ____

thaks for helping .... :-)

-----------------------------
This message is posted by http://Asp.ForumsZone.com

Jul 19 '05 #2
Perhaps end and start a new row when I MOD 3 is 0 or something
similar...

Best regards,
J. Paul Schmidt, Freelance ASP Web Developer
http://www.Bullschmidt.com
ASP Design Tips, ASP Web Database Demo, Free ASP Bar Chart Tool...
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
2164
by: schwerdy | last post by:
Greetings to all Python fans :-) Is it possible to create a skript, that can read from a unix pipe (eg.: "find -type f -name "*.ogg" | myscript.py"), _AND_ interact with the user by waiting for keypress (eg.: getkey() funktion of a curses screen)? My tests failed: When I divert data via pipe to my skript and do sys.stdin.read(),...
32
4130
by: Rich | last post by:
I'm sure it sounds kinda nutty to display 200 columns and 500,000 rows of data. But I have been pulling data from a Lotus Notes database into Sql Server for a while now, but Lotus Notes is starting to crack, columns getting corrupted. Can't handle the volume of data and number of columns. Sql Server has no problem. But displaying the...
9
1966
by: Wally | last post by:
I am trying to display images from an Access 2000 database and I get an error "Invalid Parameter Used" when I execute the code line "picBLOB.Image = Image.FromStream(stmBLOBData)" in my Visual Basic .Net application. I have researched MSDN for help and found the example article 321900 (see below) and set up a test and everything works fine...
3
10238
by: shreddie | last post by:
Could anyone assist with the following problem? I'm using JavaScript to hide/show table rows depending on the option selected in radio buttons. The script works fine in IE but in Firefox the hidden rows take up page space even though their content is not visible. I have extracted the necessary code as shown below: ...
1
3697
by: Laurel | last post by:
Hi, Do you know some browsers that would misbehave with these three lines of CSS code: table.liste tr {display:none;} table.liste tr.headers {display: block;} table.liste tr.headers {display: table-row;}
18
3329
by: Alpha | last post by:
Hi, I'm working on a Windows applicaton with VS 2003 on windows 2000. I have a listbox that I have binded to a dataset table, "source" which has 3 columns. I would like to display 2 of those columns, "scode" and "sname", as 1 column (if not possible then 2 columns will be fine) in the listbox. Can the listbox display 2 columns information...
0
5805
by: M. David Johnson | last post by:
I cannot get my OleDbDataAdapter to update my database table from my local dataset table. The Knowledge Base doesn't seem to help - see item 10 below. I have a Microsoft Access 2000 database which indexes computer magazine articles for personal reference. I am developing a Visual Basic.NET program whose sole purpose is to enter new...
2
7039
by: assgar | last post by:
Hi Developemnt on win2003 server. Final server will be linux Apache,Mysql and PHP is being used. I use 2 scripts(form and process). The form displays multiple dynamic rows with chechboxs, input box for units of service, description of the service and each row has its own dropdown list of unit fees that apply. Each dynamically created...
1
4935
by: Bob | last post by:
Hi, Hope you can help me with this one. I'm at my wits end. I'm trying to create an intelligent edit-box like the excellent "Customer" one at the URL: http://munich.schwarz-interactive.de/autocomplete.aspx
0
7614
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8125
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7676
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7974
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5513
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5219
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3653
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
1221
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
938
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.