zenphoto forums » General Zenphoto Discussion

randomimage from a unpublished album?

(12 posts)
  1. easynow

    Member
    Joined: Feb '10
    Posts: 41

    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.

    Posted 2 years ago #
  2. Zenphoto development team
    sbillard

    Chief Developer
    Joined: May '07
    Posts: 9,767

    Please look at the function getRandomImagesAlbum(). I believe it is what you want.

    Don't forget to read the Forum rules and usage resources
    Posted 2 years ago #
  3. easynow

    Member
    Joined: Feb '10
    Posts: 41

    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?

    Posted 2 years ago #
  4. Zenphoto development team
    sbillard

    Chief Developer
    Joined: May '07
    Posts: 9,767

    Did you perhaps look at the parameter definitions for this function?

    Don't forget to read the Forum rules and usage resources
    Posted 2 years ago #
  5. easynow

    Member
    Joined: Feb '10
    Posts: 41

    $showunpublished=false

    woops ;)

    Posted 2 years ago #
  6. easynow

    Member
    Joined: Feb '10
    Posts: 41

    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..

    Posted 2 years ago #
  7. Zenphoto development team
    acrylian

    Developer
    Joined: Jul '07
    Posts: 13,350

    Replace one with the other...

    Don't forget to read the Forum rules and usage resources
    Posted 2 years ago #
  8. easynow

    Member
    Joined: Feb '10
    Posts: 41

    working on that, thanks for you help, i will report back..

    Posted 2 years ago #
  9. easynow

    Member
    Joined: Feb '10
    Posts: 41

    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)); ?>

    Posted 2 years ago #
  10. Zenphoto development team
    acrylian

    Developer
    Joined: Jul '07
    Posts: 13,350

    It is the album name (for subalbums it is toplevel/sublevel/...), not the title. This small difference is quite important!

    Don't forget to read the Forum rules and usage resources
    Posted 2 years ago #
  11. easynow

    Member
    Joined: Feb '10
    Posts: 41

    woops yes of course! thankyou

    Posted 2 years ago #
  12. easynow

    Member
    Joined: Feb '10
    Posts: 41

    wrong post sorry

    Posted 9 months ago #

RSS feed for this topic

Reply

You must log in to post.