![]() |
|
Adding custom theme option for random image - Printable Version +- ZenphotoCMS Forum (https://forum.zenphoto.org) +-- Forum: Support (https://forum.zenphoto.org/forum-1.html) +--- Forum: General support (https://forum.zenphoto.org/forum-4.html) +--- Thread: Adding custom theme option for random image (/thread-4302.html) |
Adding custom theme option for random image - fretzl - 2008-12-23 Zenphoto 1.2.2 [3131],customized default theme. My index.php has a random image from the gallery. What I need to do for the user is: [list] Any help is much appreciated. Merry Xmas to you all ! Adding custom theme option for random image - sbillard - 2008-12-23 There are two different functions you will be using: If your user selects to use images from the entire gallery your task is fairly simple. use If your user selects random image from a particular album do the following (I assume you have the album name as a string create a new album: Now that you have an image you need to make it the current image: Then you print using one of the template functions for printing images. Adding custom theme option for random image - fretzl - 2008-12-23 Thanks sbillard ! I understand your answer (I think ). That's the part that should be coded in my index.php. My real problem however is to [b]make[/b] it a custom theme option in the The user wants an easy way to regularely change the the source of the random image. I can't figure out how to make a list with all the album names to choose from and a checkbox to override this list so the image will be chosen from the entire gallery. I'm sorry if I made myself not clear enough ...again. Thanks again Adding custom theme option for random image - sbillard - 2008-12-23 I presume you have looked at the other themes So, all you really need is how to get a list of albums to use in a type 5 custom option. Your quickest solution would be to use a query.
Adding custom theme option for random image - fretzl - 2008-12-24 Great! That is exactly what I was looking for. Adding custom theme option for random image - fretzl - 2008-12-25 Just in case anyone is interested, here's what I put together: On the admin -> options -> theme options page I now have a list with all albums (subalbums included) to choose from + an option to select the entire gallery. [b] function ThemeOptions() { function getOptionsSupported() { [b]added[/b]
function handleOption($option, $currentValue) { Adding custom theme option for random image - fretzl - 2008-12-25 OK that was not very clear...I'll try again: Just in case anyone is interested, here's what I put together: On the admin -> options -> theme options page I now have a list with all albums (subalbums included) to choose from + an option to select the entire gallery.
[b]in[/b] function ThemeOptions() [b]in[/b] function getOptionsSupported() [b]in[/b] function handleOption($option, $currentValue) [b] (which I copied from the Effervescence+ theme)[/b] [b]I added:[/b] ` Adding custom theme option for random image - mironb - 2009-01-09 Hi Adding custom theme option for random image - sbillard - 2009-01-10 Use instead of Adding custom theme option for random image - mironb - 2009-01-10 Ok so I change getRandomImage() to getRandomImageAlbum('Krajobrazy') but page does not working Adding custom theme option for random image - acrylian - 2009-01-10 That is probably becasue the function is called Adding custom theme option for random image - mironb - 2009-01-10 Yes !! my mistake now working. thanks! |