randomimage from a unpublished album?

hi, i love zenphoto!

At the moment i am using randomimage on my frontpage as a kind of banner.

My idea was to have it only source images from an unpublished album, so i can control what images it uses. However, if you are not logged in and viewing an unpublished album, the randomimage doesn't work and you get a placeholder instead.

is there alternative (to unpublishing) way of hiding the source album to get around this?

maybe there is some other way of doing this completely?

thanks for any help.

Comments

  • Please look at the function `getRandomImagesAlbum()`. I believe it is what you want.
  • i understand this, however, the album i will be calling from will be un-published, so i assume people who are not me (logged in), will not be able to see it?
  • Did you perhaps look at the parameter definitions for this function?
  • $showunpublished=false

    woops ;)
  • i have just realised that the function i am using currently isn't the randomimage one, it is the printHeadingImage($randomImage) function within the effervescence theme.

    this one crops and resizes the image before printing it.

    i have no idea how to hack up this function to call $randomImageAlbum.

    steep learning curve for me..
  • acrylian Administrator, Developer
    Replace one with the other...
  • working on that, thanks for you help, i will report back..
  • sorted it! thankyou for your help. php is new to me.

    in case anyone else finds this useful:

    in my html
    `<?php printHeadingImage(getRandomImagesAlbum(ALBUM_TITLE_HERE)); ?>```
  • acrylian Administrator, Developer
    It is the album name (for subalbums it is toplevel/sublevel/...), not the title. This small difference is quite important!
  • woops yes of course! thankyou
  • wrong post sorry
Sign In or Register to comment.