diff --git a/src/main.c b/src/main.c index 62ebbf3..e0dba47 100644 --- a/src/main.c +++ b/src/main.c @@ -191,6 +191,14 @@ void gallery_handler( struct gallery_info* gallery, hdf_set_value( cgi->hdf, "gallery.title", gallery->gallery_title ); hdf_set_value( cgi->hdf, "gallery.desc", gallery->gallery_desc ); hdf_set_int_value( cgi->hdf, "photos", contents->photos->length ); + + /* Are we generating the gallery? */ + if ( hdf_get_int_value( cgi->hdf, "Query.generate", 0 ) ) { + /* We will do this ignoring the ClearSilver library */ + printf("Location: %s/gallery.cgi/%s/%s?generate=1\n\n", get_cgiuri(), + gallery->gallery_name, contents->photos->string[0] ); + return; + } size_t i; struct photo_info photo;