auto-setting a default album highlight image for all new alb

dylanks

Joined: 2002-10-27
Posts: 1
Posted: Sun, 2002-10-27 22:33

Hi All,

I'd like to modofy album creation so that each time an album is created, a predefined image is included in the album and used as the highlight image.

My outline for how to do this is as follows:
in do_command.php, add to the new-album command
copy relevant code from save_photos.php for passing the url of the default highlight image.

Does this seem reasonable (besides the fact that I will have numerous copies of the same image)?

Thanks,
-Dylan

 
beckett
beckett's picture

Joined: 2002-08-16
Posts: 3474
Posted: Mon, 2002-10-28 01:04

Sounds plausible. Good luck with save_photos.php... it's a jungle in there (look around Line 330 in v1.3.1... $album->addPhoto(...), $album->resizePhoto(...), $album->save()). Once the image is created, you could add code to immediately remove the photo and replace it with a symbolic link to a centralised photo (to update more easily).
PHP function prototype: int symlink (string target, string link)
(Won't work with Windows, of course!)
...I've no idea what happens if you try to unlink() a symlink... hopefully it doesn't delete the original. (?)