Quote:$_zp_current_album = new Album($_zp_gallery, "/gallery");
This is going to attempt to make an album named "gallery". Unless you actually have a folder of that name in your albums folder the instantiation will fail. The result of this will be NULL so that the next_album() link you have following will do nothing.
I don't know where you have put this code. Generally the $_zp_current_album variable and the next_album() loop are used only on the front end. I am not so sure it is a good idea to put such deletion code on your font end pages--no telling who might visit that URL and zap your gallery (presuming the code actually worked.)
So probably what you want is:
`
$gallery = new Gallery();
$albums = $gallery->getAlbums();
foreach ($albums as $album) {
$albumobj = new Album($gallery, $album);
$albumobj->deleteAlbum();
}
`
Of course, this will clean out your entire gallery. So if that is not what you wish to do, don't try this at home!