PDA

View Full Version : Long shot - automatic HTML coding




MrSmith
Feb 9, 2006, 04:33 AM
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



superbovine
Feb 15, 2006, 05:56 PM
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.

MrSmith
Feb 15, 2006, 06:06 PM
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.

homerjward
Feb 15, 2006, 06:10 PM
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
<img src=picture.jpg>
with
<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
<img src=../pictures/picture.jpg>

MrSmith
Feb 15, 2006, 06:16 PM
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.

superbovine
Feb 15, 2006, 06:17 PM
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.

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.

jtalerico
Feb 15, 2006, 06:47 PM
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.

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.

MrSmith
Feb 15, 2006, 06:57 PM
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??

jtalerico
Feb 15, 2006, 07:09 PM
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.

MrSmith
Feb 15, 2006, 07:14 PM
That sounds the same as GC. I want something that will go deeper than one directory. Maybe there is no such program.

jtalerico
Feb 15, 2006, 07:27 PM
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.

MrSmith
Feb 15, 2006, 08:27 PM
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.