PHP Compatibility problems in PHP Photo Album
1) Script Title: PHP Photo Album
2) Script URL (on DD): http://www.dynamicdrive.com/dynamici...photoalbum.htm
3) Describe problem:
There are a few problems with the PHP to get the images for cross-server compatibility:
1. It uses short tags: <?....?>. On some (many) servers this won't work. It's a simple fix: The first open tag must be <?php.
2. On newer releases of PHP if it isn't setup by default, PHP will refuse to use date(). http://www.php.net/manual/en/functio...mezone-set.php As explained on that page, that function (at the start of the script) will fix this. Since the real time is irrelevant and only relative time matters, that's good.
3. The order of images is hard to control because it's using file date. Perhaps there could be a parameter to do alphabetical. For example, on my old server they were in a different order because that is how I uploaded them, but now they are in alphabetical order because that is how I restored the site from a backup (automatically).
I could rewrite any of the PHP as needed, if I can find some time (on vacation now, so not on the computer much, but it won't take too long to find a few minutes for this).
There may be more minor issues with various types of servers, and cross-server compatibility isn't something I've worked much with yet in PHP, just a bit now that I've switched servers and found a few things to be different.
Most importantly, short tags should never be used to distribute code: long tags always work and short tags don't always.
Then maybe a note about the date thing. I'm not sure if that's usually configured, but it isn't on my server so it may be a problem for others. I'm not sure if this is common though.
Reworking the image gathering system would be another issue.
Finally, the ereg functions are deprecated and throw warnings generating (I believe) invalid JS. I've replaced them with the preg functions and can post that here as needed.