automatically refresh DB ?

Hi,
before my question I wanted thank the creators of ZP quickly. The more I work with it the more I appreciate it. It is not only the technology under the hood but also the functional range which is soo spot on. It has everything any serious photo website needs but nothing more !
This is just what I try to do with my photography !

"Perfection is achieved, not when there is nothing more to add, but when there is nothing left to take away."
-- Antoine de Saint-Exuper

to my question:
I have finished the permutation of all possible tag combinations now. I run it every 24h and it works nicely: http://www.dev.bregler.net/gallery
I order by RAND() and also look for a minimum of 3 pictures. This means the created albums in db change a great deal.
what I would like to do is to automatically refresh the DB after every call.
I this possible without replicating the whole of admin-refresh-metadata.php into a custom function ?
could I call something like this ?
$html = implode ('', file("/zp_admin/admin-refresh-metadata.php&prune"));

but this admin page requires a login. any ideas ?

Comments

  • acrylian Administrator, Developer
    There is the gallery classs method named `garbageCollect()` but I am not sure if that is all for db refresh. Best you wait what sbillard says...;-)
  • Be aware that refreshing the gallery often takes more time than servers/browsers will allow, so you would need to deal with that. I am not sure that the database refresh is really what you need, either. I presume what you want is to be sure that any new albums/images are discovered? If you know which albums you have created, just instantiate them as part of your function. If you are removing any "expired" albums, just use the delete method to get rid of them.
  • ok, how do I initiate them? So far I was just creating the .alb files with fopen,fwrite and fclose. Is there a better way to do this?
  • use `new Album()` after you have created the file. (see the function documentation for details)
  • ahh of course, thanks
Sign In or Register to comment.