47 users online (1 members and 46 guests)  


  Results 1 to 6 of 6

Related

  1. Replies: 1
  2. Replies: 3
  3. Creating a form with file submission    Forum: Website Scripts Forum
    Replies: 1
  4. Web Site and Inventory for Sale    Forum: Websites For Sale
    Replies: 1
  1. #1
    aldar's Avatar
    New User

    Status
    Offline
    Join Date
    Jul 2008
    Posts
    5

    Need help creating a dvd inventory list from a CSV file

    I wrote a page on my local HD that displays a list of dvd cover images which are linked to the dvd copy on my HD. So I scroll horizontally and browse dvds, when I find one I want to watch, I click and it launches in WinDVD. This is using IE, but I can use Firefox of course.
    Problem is that now Iím approaching 400 movies and using repetitive table entries (see below) itís taking lotís of memory and itís kind of a pain to enter new dvds. But mainly though Iíd really like to put the dvd list in a database (xls or csv) so I can sort it by name or time or whatever. What would be an efficient way to read from a XLS or CSV file to HTML and get something similar to what I have now (horizontal list of dvd cover images linked to the movie on my hd)?

    Here is what I have now (of course this is just 2 dvds, I cut out about 380):

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    <html>
    <head>
    <title> Graphical list </title>
    </head>
    <body bgcolor=#C0C0C0>
    <TABLE CELLSPACING=25>
    <TR>
    <TD><CENTER>
    <font face="Arial" size=+2><B><a href="file:///D:/8mm/video_ts/video_ts.ifo"><img src="file:///C:/DVDs/images/8mm_cs.jpg" width=290 height=400><BR>8mm (2:03)</A></B></font>
    </CENTER></TD>
    <TD><CENTER>
    <font face="Arial" size=+2><B><a href="file:///E:/12_monkeys/video_ts/video_ts.ifo"><img src="file:///C:/DVDs/images/12_monkeys_cs.jpg" width=290 height=400><BR>12 Monkeys (2:11)</A></B></font>
    </CENTER></TD>
    </TR>
    </TABLE>
    </body>
    </html>

    Something I tried, but it lists the movies vertically, Iíd prefer horizontally:

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    <html>
    <head>
    <title> Graphical list </title>
    </head>
    <body bgcolor=#C0C0C0>
    <object ID=data classid="clsid:333C7BC4-460F-11D0-BC04-0080C7055A83">
    <param nAme="DataURL" value="movies-test.csv">
    <param nAme="UseHeader" value="true">
    </object>
    <table CELLSPACING=25 datasrc='#data'>
    <tr>
    <td><center>
    <a href= <span datafld='location'> </span><img width=290 height=400 src=<span datafld='picture'></span> </a><br>
    <span datafld='name'> </span>
    <span datafld='time'></span>
    </center></td>
    </tr>
    </table>
    </body>
    </html>

    Sample CSV file:

    name,time,picture,location
    8mm,123,C:/DVDs/images/8mm_cs.jpg,D:/8mm/video_ts/video_ts.ifo
    12 Monkeys,131,C:/DVDs/images/12_monkeys_cs.jpg,E:/12_monkeys/video_ts/video_ts.if

  2. #2
    jthayne's Avatar

    Status
    Offline
    Join Date
    Aug 2008
    Location
    Texas
    Posts
    508

    Re: Need help creating a dvd inventory list from a CSV file

    One way you could do it is to organize it using UL and format it using CSS.

    For example:

    HTML Code:
    li {
    display: inline;
    float: left;
    min-width: 100px;
    }
    There will be other formatting that will need to be done too, but that is the general idea.

  3. #3
    aldar's Avatar
    New User

    Status
    Offline
    Join Date
    Jul 2008
    Posts
    5

    Re: Need help creating a dvd inventory list from a CSV file

    I tried what you said and things like you see below, but without using tables, I can't get it to parse the entire .csv file. Currently it just reads the first entry and stops.

    -----
    <style type="text/css" media="screen">
    nav ul{
    padding : 0;
    margin : 0;
    }
    nav ul li{
    display : inline;
    }
    </style>


    <div id="nav">

    <object ID=data classid="clsid:333C7BC4-460F-11D0-BC04-0080C7055A83">
    <param nAme="DataURL" value="movies-test.csv">
    <param nAme="UseHeader" value="true">
    </object>

    <ul>
    <li>
    <a href=<span datasrc="#data" datafld="location"></span><img width=290 height=400 src=<span datasrc="#data" datafld="picture"></span></a>
    <span datasrc="#data" datafld="name"></span> <span datasrc="#data" datafld="time"></span>
    </li>
    </ul>

    </div>

  4. #4
    jthayne's Avatar

    Status
    Offline
    Join Date
    Aug 2008
    Location
    Texas
    Posts
    508

    Re: Need help creating a dvd inventory list from a CSV file

    You are going to want to parse through the csv file. Basically, loop through each line adding the information from the CSV into your list. The binding you are trying to do only works with tables, and there is no way to bind each row of the csv to a column in the table.

    Do you have PHP or ASP installed? If not, you might be able to do this via JavaScript. I will have to do some reasearch on it.

  5. #5
    aldar's Avatar
    New User

    Status
    Offline
    Join Date
    Jul 2008
    Posts
    5

    Re: Need help creating a dvd inventory list from a CSV file

    I do not have PHP or ASP installed, I can if it would help though. Also, this is not on a system with a web server installed, I'm just loading a local file.

    When I started looking in to this and then posting here looking for help I really didn't think this was going to be that complicated. I Kinda thought it might be common even, but I guess not.

    Thanks for your time helping.
    Last edited by aldar; 08-22-2008 at 02:17 PM.

  6. #6
    jthayne's Avatar

    Status
    Offline
    Join Date
    Aug 2008
    Location
    Texas
    Posts
    508

    Re: Need help creating a dvd inventory list from a CSV file

    This can be done with JavaScript. I am working on a working example for you.



Tags for this Thread