Slideshow error

Hi Guys,

First of all thanks in advance for your help, and congrats for those of you working on this magnificent piece of online software.

I'm building a photography website for someone, and am trying to display a slideshow of each album automatically (do not want or need thumbs).

I added this code in the body of my album.php

`
<?php
$albumobj = $_zp_current_album;
$imageobj = $_zp_current_image;
printSlideShow(true,false,$albumobj, "", 600,400);
?>
`
The result is the two first images of the album, in a row, with an error message saying :

Warning: Invalid argument supplied for foreach() in /homez.56/instantdg/www/zenphoto/zp-core/template-functions.php on line 1012

Any idea on what it could be ? Again thanks a lot for your help.

Comments

  • acrylian Administrator, Developer
    Is the slideshow plugin enabled? How does the album.php look like? Do you maybe have an album without images?

    (Not using thumbs or individual image pages makes them virtually invisble for search engines and not linkable btw but maybe that is the reason?)
  • Thanks for repyling so quickly.

    The slideshow plugin is activated and works fine if i dont modify album.php and click on the slideshow link.

    You can see it following this link :

    http://instantdeviephoto.com/zenphoto/instantdeviephoto/mariage/

    In both sub albums, it displays to two first images then the error displays
  • acrylian Administrator, Developer
    Ok, I think you need to reset the context right after the slideshow call. Try:
    `set_context(ZP_ALBUM);`
  • Thanks ! Did as you said,

    Now the error message is gone but imagewise its the same. Two first pictures one after another, but no slideshow...
  • acrylian Administrator, Developer
    Hm, actually that should work. I will try myself and get back to you.
  • acrylian Administrator, Developer
    I could not reproduce the error regarding context but to get the slideshow to work you need to add `<?php printSlideShowJS(); ?>`to the `` of the page. It is not loaded automatically as the slideshow is normally displayed on the slideshow.php page (or if using the colorbox mode using that).
  • Hello,

    It's already at the head of the page.
  • acrylian Administrator, Developer
    I am sorry then, when I added that and called the slideshow all worked for me. Even without resetting the context, btw.
  • Hello again,

    I found the problem. The `<?php printSlideShowJS(); ?>` had to be put at the end of the ``, and not at the beginning.

    Thanks a lot for your help, acrylian !
  • acrylian Administrator, Developer
    I assumed somehow that was clear, sorry. It has to go after the theme_head filter because that loads the main jQuery script the slideshow depends on.
  • Now i realize i have to figure out how to display thumbnails for subalbums (which i will use), and none in the final albums that are actually containing images to display as a slideshow. Since it's the same album.php file for both, what do you think could be the trick ?
  • acrylian Administrator, Developer
    I don't understand what you mean with thumnials of subalbums. Instead of the album thumb? Then you will have to modify the theme and probably use the object model. See the user guide.

    Also, the slideshow can only display images from one album. If you need a kind of collector you would have to use a dynamci album (see user guide as well). Otherwise you will have to adapt the plugin or use the jQuery Cycle script directly to build your own custom slideshow.
Sign In or Register to comment.