Topic: Update quickly many multiple SV galleries

Hey everyone,

I could not find the answer to my question in existing posts so here is a new one:

as many of you might have, I own a website presenting a bunch of projects and photo galleries for each one of them.
My server file structure is like this:
index.php
projects_folder
   project1
      index.php
      gallery_folder
         buildgallery.php
         Simpleviewer_files
   project2
      index.php
      gallery_folder
         buildgallery.php
         Simpleviewer_files
...

Currently, when I add images to some project galleries (worst : to all of them), I have to run the build_gallery.php script of each subfolder to update the gallery files. This can take a lot of time...

I just wanted to know if there would be an easier way to update multiple galleries at once... I don't think SVManager helps in this case since I would have to update each gallery one by one. (or would there be a 'rebuilt all' option available ?)


Thanks for your help !

Last edited by bdeschryver (2012-11-21 13:05:23)

Re: Update quickly many multiple SV galleries

Knowing the locations of all the galleries on your web server, you could modify the 'buildgallery.php' file to rebuild all your galleries at once. However, this would require knowledge of PHP.

Alternatively, for each gallery, you could use a PHP file (instead of a static XML file) to dynamically create an XML file on-the-fly to display all images in a designated folder. In doing so, you could simply upload new images to the designated folder and the images would appear in the gallery the next time it is viewed without any further action.
Please see this forum post to see how this can be achieved.

Steven Speirs
SimpleViewer Support Team.

Re: Update quickly many multiple SV galleries

Thank you for the reply.

I do have some moderate knowledge of PHP and I looked into the build_gallery.php code but I don't understand how to reuse it for multiple galleries updated at once. Could you give any hint on this ?

I also looked into your solution of php file instead of XML and this looks nice, but that means no thumbnail files are created, just the regular images used as thumbnails (and resized) , right ? That does not slow down the viewing ?

Re: Update quickly many multiple SV galleries

I do have some moderate knowledge of PHP and I looked into the build_gallery.php code but I don't understand how to reuse it for multiple galleries updated at once. Could you give any hint on this ?

It might be easier to simply write a script to run all the individual 'buildgallery.php' scripts on your web server.
Take a look at this forum post for a suggestion on how this might be achieved.

I also looked into your solution of php file instead of XML and this looks nice, but that means no thumbnail files are created, just the regular images used as thumbnails (and resized) , right ?

That is correct.

That does not slow down the viewing ?

SimpleViewer will dynamically resize the main images for use as the thumbnails and this should not slow down the gallery significantly (as long as the images are not too large in file size).

Steven Speirs
SimpleViewer Support Team.

Re: Update quickly many multiple SV galleries

thank you !

I'll create a system webpage where I list all the build_gallery scripts present in my subfolders. This way I can select which ones to update.

Thank you for this good support !

Re: Update quickly many multiple SV galleries

Hey Steven,

just got some time to think about you idea of calling the build_gallery script from another main php script.
I don't think it would work since the build_gallery script shows a webpage with the options and the user has to click on the "build" button.
Calling the script would just show the webpage, but user action would still be needed.
Do you agree on this ?
Any way to automate the user action ? Could I maybe pass some parameters to the build_gallery script maybe ? (using build_gallery.php?param=...)

Thanks

Re: Update quickly many multiple SV galleries

If you would like BuildGallery to run silently on execution of the script (without the need for the user to click the 'Update' button first), try adding the following code on line 77 of the 'buildgallery.php' file:

$buildGallery->update();

... and comment out lines 208 and 209 as follows:

//if (!isset($_POST['customizesubmitted'])) return;
//$this->customize($_POST);
Steven Speirs
SimpleViewer Support Team.