Long shot - automatic HTML coding

Discussion in 'Mac Programming' started by MrSmith, Feb 9, 2006.

  1. macrumors 68040

    MrSmith

    Joined:
    Nov 27, 2003
    #1
    You know how with GraphicConverter you can catalog a folder (where it writes the HTML and makes thumbnails)? Well, I'm not worried about the thumbnails, but do any of you know of an application that can produce HTML for nested folders? I.e. where it puts one .html page in the top folder with links to all images in the sub-(sub-)folders.

    Long shot, but thought I'd ask. Thanks.

    Uhh...sorry. Wrong place for this. Could a kind mod please move it? Thanks
     
  2. macrumors 68030

    superbovine

    Joined:
    Nov 7, 2003
    #2
    there are you perl and php programs that will allow this and full control of the directory. You could also just allow apache to display the directorys which will be a folder view on your directory.
     
  3. thread starter macrumors 68040

    MrSmith

    Joined:
    Nov 27, 2003
    #3
    Thanks for your reply. Actually, I wanted to use it for a front end to a CD: an index page I can just drop on Safari and have access to the contents from there.
     
  4. macrumors 68030

    homerjward

    Joined:
    May 11, 2004
    Location:
    fig tree
    #4
    are you familiar with basic html? if you have a small working knowledge of html you could do it yourself with a bit of work. how many images are you using?

    in case you don't know how:
    what you could do (though it would take a while with a lot of images) is something like this: let's say it writes the html to look for picture.jpg, then you put picture.jpg in a folder called pictures, which will break the link. you can fix this by going into the source code and changing the path where it looks for the image. replace
    Code:
    <img src=picture.jpg>
    with
    Code:
    <img src=pictures/picture.jpg>
    or similar.

    that tell is to look first in the pictures folder, then for picture.jpg. you can do something similar for a picture in a folder somewhere else. like let's say the html page is in the "html" folder and the pics are in the "pictures folder" so the above wouldnt work. you'd use
    Code:
    <img src=../pictures/picture.jpg>
     
  5. thread starter macrumors 68040

    MrSmith

    Joined:
    Nov 27, 2003
    #5
    I've done loads of html coding. I just wanted to avoid doing it manually. I'm talking about over 500 images in sub-folders two or three deep.
     
  6. macrumors 68030

    superbovine

    Joined:
    Nov 7, 2003
    #6
    you could write a perl or php script to produce the output pretty quickly then just burn it with a cd.

    I used to have a job where we either had a flash front end or html front-end index on cds. We always used a templating system and just adjusted it by hand, but it was only 3 data points to adjust.
     
  7. macrumors 6502

    Joined:
    Nov 23, 2005
    #7
    Exactly what i was thinking. A simple php script can do it with ease... I have one written up. it is ugly. but It gets the job done.
     
  8. thread starter macrumors 68040

    MrSmith

    Joined:
    Nov 27, 2003
    #8
    I want a program that will write me one index.html file in a top folder with <a href> tags to all images in subfolders/subsubfolders, and below. You have a php script that can do that on my HD??
     
  9. macrumors 6502

    Joined:
    Nov 23, 2005
    #9
    lol, no, what will have to happen is that you point the index.html to gallery.php or just have index.php.. And it will generate the HTML for you.. And each Dir have its on Index.php with the same code. It will grab all the images in that dir.
     
  10. thread starter macrumors 68040

    MrSmith

    Joined:
    Nov 27, 2003
    #10
    That sounds the same as GC. I want something that will go deeper than one directory. Maybe there is no such program.
     
  11. macrumors 6502

    Joined:
    Nov 23, 2005
    #11
    sure it can, just have a while loop that checks to see if the file is a directory, if it is, go to it, check to see if it has the .jpeg, gif extension. If it does, it sets it, then move back one directory then continue on. Wouldnt be that hard to do.
     
  12. thread starter macrumors 68040

    MrSmith

    Joined:
    Nov 27, 2003
    #12
    OK. I've written a CMS for my database, so I've grappled with the basics of php. I can check out the syntax. But how do I run php on my mac? I've only done it on a server.
     

Share This Page