I spent some time trying to untangle the mess, and actually made some progress.
The housekeeping tasks are:
The original random image generator used whatever images were in the photos directory on my site. This created two problems: first, all images in that directory were duplicated elsewhere, resulting in wasted space on the webserver; second, the thumbnails for the images were linked only to the large images alone, rather than to a larger image contained within some sort of template page that looked like the rest of my site.
I handled the image issues by having a text file with one line for each image in the rotation, for example:
<a href="photos_nc.php?image=02pb10"><img src="tnails/02pb10-sm.jpg" class="littlepic" /></a>
Instead of copying the jpegs into a photos directory, I'm just pointing to my Gallery albums directly. There is a separate template page for each album, and a php variable is set to the individual filename by clicking on the thumbnail itself.
There is a line in each template page that places the correct image in the middle of the page:
<img src=albums/central-NC/<?php echo($image) ; ?>_lg.jpg class="mainpic">
Because Gallery creates separate directories for each album, I took the path of least resistance and creates separate php templates for each album. I was still able to save several 10s of mb by deleting all the duplicate images.
I used the same technique to create a template for all the other sub-pages on my site. There is one template, or skeleton, page that contains all the stuff I want all my pages to have (menubar, links, copyright statement, etc), plus the following line:
<?php @ require_once ("$page"); ?>
Any time someone clicks a link, say to the Photos page, the link points to the template page, and the variable gets set to the correct *.txt file, and the above code places that *.txt file in right spot.
All the links have been updated, so instead of a link to
<a href="about.html">
there's a link to
<a href="skel.php?page=about.txt">
There's a single template to modify now, and a whole bunch of plain text files that get loaded into that template when someone clicks on the appropriate link. Much simpler to maintain.
The last thing I had to do was put a redirect at the top of all the original html pages like so:
<?php header("location: ../skel.php?page=about.txt"); ?>
So, I still have a bazillion html files, but they all redirect to the new php-based pages. When I decide to rework my page design, I'll only have to modify the single template page.
A note on the php redirect, that line has to go at the very top of the html file for it to work.
I still have to work on tidying up the CSS, as some pages look fine and others look... not so fine. And I have to write the Movable Type archive pages.
But, I finished the photoblog, so that's done. Now if I could only get some people to come look at my pictures...
A consequence of having had a website for a number of years, and of having a short attention span, is that I have dozens of old files that I don't recognize sitting in various places on my web server. Even though this site isn't all that complex, there are still several dynamic elements like the random quote and image generators. Also, since I use Movable Type to manage much of the content now, I have multiple versions of many of the page templates. I have found that I just don't have enough time to sit down and sort through the mess that my website has become.
I did manage to purge some old image files, and rework most of the pages to use the photos in my photo gallery. This has saved me around 20 mb of space.
While going through this housecleaning, I got the bright idea to run my site through a validation exercise to see how big a mess my html and css really is.
Yow.
Wish I hadn't done that. Now I have way more work than I had before. Based on the validator's output, I'm amazed my site is even viewable... Guess I'll start fixing things, one page at a time, until it's cleaned up. This will probably take months, which will leave me way behind in everything else, I'm sure.