Jump to content

ember

Members
  • Posts

    35
  • Joined

  • Last visited

About ember

  • Birthday 01/18/1984

Profile Information

  • Location
    Portugal

ember's Achievements

Newbie

Newbie (1/7)

0

Reputation

  1. thanks, it's working perfectly!
  2. thanks, it's working great!just another thing: how can i change the text in the toggle map area so that what the map is closed it says "open" and when the map is open it says close?thanks again for the help!
  3. well, here are some examples of what i need:here is the section before opening the image:and here it is after opening it:any ideas? best regards, ember
  4. hello everyone, i need a little help on creating something on a webpage, that inside a table, there is some text, and on the side of it there is a button where you can click to display a little picture that can assist you at understanding the text better. something like the viamichelin.com page, where you can create a travel route, and near the driving directions, there is a button where you can click to display the map of the indicated area. the problem is that i don't know how this can be done. and in this case, the data is static, not like in viamichelin, where it is influenced by the route you create.can anyone help me on this?best regards, ember
  5. well, i was already expecting a hard task about that... do you know any documentation where i can get some ideas and learn how to accomplish this?thanks,ember
  6. i see what you mean, but in that case the user, when loading the page, will get the results already filtered, is that correct? because what i need is that the users are allowed to filter the results after they're displayed.
  7. I don't know what happened, but a part of the code was eaten over there!i'll try to post it again: <%' In this demo, at least, we don't allow user to change directories...' Change the DIRECTORY to point to any virtual directory of your choice.CONST DIRECTORY = "/" ' relative path in virtual directories 'These consts are only valid for default file-folders 'virtual folders may have their own ids! Const FILE_NAME = 0 CONST FILE_SIZE = 1 CONST FILE_TYPE = 2 CONST FILE_MODIFIED = 3 Const FILE_CREATED = 4 Const FILE_ACCESSED = 5 Const FILE_OWN = 8 Const FILE_AUT = 10 ' get requested sort order, if not first time here...' (forward by name is default)req = Request("sortBy")If Len(req) < 1 Then sortBy = 0 Else sortBy = CInt(req)req = Request("priorSort")If Len(req) < 1 Then priorSort = -1 Else priorSort = CInt(req)'' did user ask for same sort? to reverse the order?' but if so, then zap priorSort so clicking again will do forward!If sortBy = priorSort Then reverse = true priorSort = -1Else reverse = false priorSort = sortByEnd If' now start the *real* code...'Dim path Dim sh Dim oShellFolder Dim theFiles Dim info path = Server.MapPath( DIRECTORY ) Set sh = CreateObject("Shell.Application") Set oShellFolder = sh.Namespace( path ) theFiles = getItemsInfo(oShellFolder) For Each info in theFiles Next Function getItemsInfo (oShF) Dim ######em Dim currentSlot Dim p Dim fname Dim fext Dim ftype Dim fcreate Dim fmod Dim faccess Dim fsize Dim fauthor Dim fowner ReDim theFiles(oShF.Items.Count-1) currentSlot = -1 For Each ######em in oShF.Items fname = ######em.Name p = instrrev(fname,".") If (p> 0) Then fext = Mid(fname, p+1,len(fname)) Else fext = fname ftype = oShF.GetDetailsOf(######em, FILE_TYPE) fsize = oShF.GetDetailsOf(######em, FILE_SIZE) fmod = oShF.GetDetailsOf(######em, FILE_MODIFIED) fcreate = oShF.GetDetailsOf(######em, FILE_CREATED) faccess = oShF.GetDetailsOf(######em, FILE_ACCESSED) fauthor = oShF.GetDetailsOf(######em, FILE_AUT) fowner = oShF.GetDetailsOf(######em, FILE_OWN) currentSlot = currentSlot + 1 theFiles(currentSlot) = Array(fname, fext, ftype, fsize, fmod, fauthor, fowner) Next getItemsInfo = theFiles '' files are now in the array...'' As noted, it is actually an ARRAY *OF* ARRAYS. Which makes' picking the column we will sort on easier!'' ...size and sort it...fileCount = currentSlot ' actually, count is 1 more, since we start at 0ReDim Preserve theFiles( currentSlot ) ' really not necessary...just neater!' First, determine which "kind" of sort we are doing.' (VarType=8 means "string")'If VarType( theFiles( 0 )( sortBy ) ) = 8 Then If reverse Then kind = 1 Else kind = 2 ' sorting strings...Else If reverse Then kind = 3 Else kind = 4 ' non-strings (numbers, dates)End If'' A simple bubble sort for now...easier to follow the code...'For i = fileCount TO 0 Step -1 minmax = theFiles( 0 )( sortBy ) minmaxSlot = 0 For j = 1 To i Select Case kind ' which kind of sort are we doing? ' after the "is bigger/smaller" test (as appropriate), ' mark will be true if we need to "remember" this slot... Case 1 ' string, reverse...we do case INsensitive! mark = (strComp( theFiles(j)(sortBy), minmax, vbTextCompare ) < 0) Case 2 ' string, forward...we do case INsensitive! mark = (strComp( theFiles(j)(sortBy), minmax, vbTextCompare ) > 0) Case 3 ' non-string, reverse ... mark = (theFiles( j )( sortBy ) < minmax) Case 4 ' non-string, forward ... mark = (theFiles( j )( sortBy ) > minmax) End Select ' so is the current slot bigger/smaller than the remembered one? If mark Then ' yep, so remember this one instead! minmax = theFiles( j )( sortBy ) minmaxSlot = j End If Next ' is the last slot the min (or max), as it should be? If minmaxSlot <> i Then ' nope...so do the needed swap... temp = theFiles( minmaxSlot ) theFiles( minmaxSlot ) = theFiles( i ) theFiles( i ) = temp End IfNext' Ta-da! The array is sorted!'%> i don't know why, but a part of the code was munched when i pasted it!so here comes the first part, and in the next reply will be the second.here comes the second part: <FORM Name="doSort" Method="Get"><INPUT Type=Hidden Name=priorSort Value="<% = priorSort %>"><INPUT Type=Hidden Name=sortBy Value="-1"></FORM><script Language="JavaScript">function reSort( which ){ document.doSort.sortBy.value = which; document.doSort.submit( );}</SCRIPT><CENTER><b></b><FONT class=normal bgColor=#cecfce width="100%"><font face="Arial" size="4"></b></FONT></font><p> </p><p><FONT class=normal bgColor=#cecfce width="100%"><font face="Arial" size="4"> Showing <% = (fileCount+1) %> files from directory <% = path %></FONT></p><P></P><P></P><p> </p><p> </p><TABLE Border=0 CellPadding=3><TR> <TH bgcolor=#CECFCE class=normal align=center><A HREF="java script:reSort(0);">File name</A></TH> <TH bgcolor=#CECFCE class=normal align=center><A HREF="java script:reSort(1);">Extension</A></TH> <TH bgcolor=#CECFCE class=normal align=center><A HREF="java script:reSort(2);">Type</A></TH> <TH bgcolor=#CECFCE class=normal align=center><A HREF="java script:reSort(3);">Size</A></TH> <TH bgcolor=#CECFCE class=normal align=center><A HREF="java script:reSort(4);">Last modified</A></TH> <TH bgcolor=#CECFCE class=normal align=center><A HREF="java script:reSort(5);">Author</A></TH> <TH bgcolor=#CECFCE class=normal align=center><A HREF="java script:reSort(6);">Owner</A></TH></TR><%'With the array nicely sorted, this part is a piece of cake!For i = 0 To fileCount Response.Write "<TR class=normal>" & vbNewLine For j = 0 To UBound( theFiles(i) ) Response.Write " <TD><a href= """ & path & "/" & fname & """ >"& theFiles(i)(j) & "</a></TD>" & vbNewLine Next Response.Write "</TR>" & vbNewLineNextEnd Function%> about the filters, the user should be able to filter the results on every item that appears. i'm a little stuck with this, it's in these time that i realise how little i know about ASP =/thanks everyone,ember
  8. sure, here it goes <%' In this demo, at least, we don't allow user to change directories...' Change the DIRECTORY to point to any virtual directory of your choice.CONST DIRECTORY = "/" ' relative path in virtual directories'Option Explicit 'These consts are only valid for default file-folders 'virtual folders may have their own ids! Const FILE_NAME = 0 CONST FILE_SIZE = 1 CONST FILE_TYPE = 2 CONST FILE_MODIFIED = 3 Const FILE_CREATED = 4 Const FILE_ACCESSED = 5 Const FILE_OWN = 8 Const FILE_AUT = 10 ' get requested sort order, if not first time here...' (forward by name is default)req = Request("sortBy")If Len(req) < 1 Then sortBy = 0 Else sortBy = CInt(req)req = Request("priorSort")If Len(req) < 1 Then priorSort = -1 Else priorSort = CInt(req)'' did user ask for same sort? to reverse the order?' but if so, then zap priorSort so clicking again will do forward!If sortBy = priorSort Then reverse = true priorSort = -1Else reverse = false priorSort = sortByEnd If' now start the *real* code...'Dim path Dim sh Dim oShellFolder Dim theFiles Dim info path = Server.MapPath( DIRECTORY ) Set sh = CreateObject("Shell.Application") Set oShellFolder = sh.Namespace( path ) theFiles = getItemsInfo(oShellFolder) 'dump result, replace WSH.Echo for ASP For Each info in theFiles 'WSH.Echo join(info ,"*") Next 'WSH.StdIn.ReadLine() ' Function getItemsInfo (oShF) Dim ######em Dim currentSlot Dim p Dim fname Dim fext Dim ftype Dim fcreate Dim fmod Dim faccess Dim fsize Dim fauthor Dim fowner ReDim theFiles(oShF.Items.Count-1) currentSlot = -1 For Each ######em in oShF.Items 'if ######em.isFolder Then ######em.GetFolder fname = ######em.Name p = instrrev(fname,".") If (p> 0) Then fext = Mid(fname, p+1,len(fname)) Else fext = fname ftype = oShF.GetDetailsOf(######em, FILE_TYPE) fsize = oShF.GetDetailsOf(######em, FILE_SIZE) fmod = oShF.GetDetailsOf(######em, FILE_MODIFIED) fcreate = oShF.GetDetailsOf(######em, FILE_CREATED) faccess = oShF.GetDetailsOf(######em, FILE_ACCESSED) fauthor = oShF.GetDetailsOf(######em, FILE_AUT) fowner = oShF.GetDetailsOf(######em, FILE_OWN) currentSlot = currentSlot + 1 theFiles(currentSlot) = Array(fname, fext, ftype, fsize, fmod, fauthor, fowner) 'end ifNext getItemsInfo = theFiles 'End Function '' files are now in the array...'' As noted, it is actually an ARRAY *OF* ARRAYS. Which makes' picking the column we will sort on easier!'' ...size and sort it...fileCount = currentSlot ' actually, count is 1 more, since we start at 0ReDim Preserve theFiles( currentSlot ) ' really not necessary...just neater!' First, determine which "kind" of sort we are doing.' (VarType=8 means "string")'If VarType( theFiles( 0 )( sortBy ) ) = 8 Then If reverse Then kind = 1 Else kind = 2 ' sorting strings...Else If reverse Then kind = 3 Else kind = 4 ' non-strings (numbers, dates)End If'' A simple bubble sort for now...easier to follow the code...'For i = fileCount TO 0 Step -1 minmax = theFiles( 0 )( sortBy ) minmaxSlot = 0 For j = 1 To i Select Case kind ' which kind of sort are we doing? ' after the "is bigger/smaller" test (as appropriate), ' mark will be true if we need to "remember" this slot... Case 1 ' string, reverse...we do case INsensitive! mark = (strComp( theFiles(j)(sortBy), minmax, vb script:reSort(0);">File name</A></TH> <TH bgcolor=#CECFCE class=normal align=center><A HREF="java script:reSort(1);">Extension</A></TH> <TH bgcolor=#CECFCE class=normal align=center><A HREF="java script:reSort(2);">Type</A></TH> <TH bgcolor=#CECFCE class=normal align=center><A HREF="java script:reSort(3);">Size</A></TH> <TH bgcolor=#CECFCE class=normal align=center><A HREF="java script:reSort(4);">Last modified</A></TH> <TH bgcolor=#CECFCE class=normal align=center><A HREF="java script:reSort(5);">Author</A></TH> <TH bgcolor=#CECFCE class=normal align=center><A HREF="java script:reSort(6);">Owner</A></TH></TR><%'With the array nicely sorted, this part is a piece of cake!For i = 0 To fileCount Response.Write "<TR class=normal>" & vbNewLine For j = 0 To UBound( theFiles(i) ) Response.Write " <TD><a href= """ & path & "/" & fname & """ >"& theFiles(i)(j) & "</a></TD>" & vbNewLine 'End Function Next Response.Write "</TR>" & vbNewLineNextEnd Function%> i still have some tweaking to do, that's to make the script also scan folders inside the root folder, and where it displays the name of the file for it to have a link to the file.thanks everyone!
  9. yep, filtering, the page already has a sort function in it.the main problem is that the index has to be dynamic, so you don't have to be changing it each time you add or modify a file in the directory...maybe if i show you the code you can see the main idea better?thanks again
  10. i've thought about that, also, but as you may have noticed, i'm a newbie on asp... it has to display the results and only after that be able to filter them, using something like javascript dropdown navigation menus or something similar.i didn't quite understand your question about the files though...anyway, thanks for your reply
  11. Hello everyone. i've been learning a lot here in the past few weeks, but unfortunately it's not enough for what i need now...Here it goes:I have an ASP script wich scans a given directory and returns information on the files inside it (name, type, size, date last mod, owner and author). Everything works fine, but now i need a new element on this - a way to filter the results. someone i know has told me something about recordsets, but all the info i can find is about connections with Access databases.so, i'd like to ask if there is a way to sort my problem out, and if you know any links or online documentation to do so.best regards and thanks in advance, ember
  12. thanks, this is sorted out, i'm already using it!thanks again,br, ember
  13. ember

    Problem Running ASP

    finally, it's working!it didn't work exactly after the re-registering process, but after searching for the obtained errors on google and re-registering a few more dll's, it's working just fine!thankyou very much, justsomeguy!
×
×
  • Create New...