From f1a914233526692ed11c86e7ad83514cc73e809f Mon Sep 17 00:00:00 2001 From: Stuart Longland Date: Mon, 26 Jan 2009 18:47:12 +1000 Subject: [PATCH] Add in auto-generate facility to gallery handler. --- src/main.c | 8 ++++++++ 1 file changed, 8 insertions(+) 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;