Starter help with slideshow

Hi,
I am using ZenPhoto for first time. I want to implement a slideshow on my home screen (of ZenPhoto) instead of gallery picture.

I am trying to put it into functions.php (in one of basic themes) where I am trying "echo printSlideShow(true,false,'4.9.2011', "", 400,400);" where 4.9.2011 is name of my album.

Cans omeone help me how do I correctly call slideshow on my ZenPhotos page please?

Comments

  • fretzl Administrator, Developer
    You have to create an album object first.
    `
    <?php
    $albumobject = newAlbum('4.9.2011');
    printSlideShow(true,false,$albumobject, '', 400,400);
    ?>
    `
    And don't forget to check the page on which you want the slideshow to be visible in the plugin options.
  • acrylian Administrator, Developer
    I am trying to put it into functions.php (in one of basic themes) where I am trying "echo printSlideShow(true,false,'4.9.2011', "", 400,400);" where 4.9.2011 is name of my album.

    You need to put it on the theme page where you want it to appear – in this case the theme's `index.php` – and not the theme`s`functions.php`. If you haven't take a look here: http://zenphoto.org/news/theming-tutorial

    Also, the `echo` is not needed the function "prints" already.
  • Hello,
    I tried to put something like this:
    $randomAlbum = $randomImage->getAlbum();
    $randomAlt1 = $randomAlbum->getTitle();
    $albumobject = newAlbum($randomAlt1);
    printSlideShow(true,false,$albumobject, '', 1000,400);

    To each theme, each file and each folder but it isnt working anywhere. For example I tried to put it into "printHeadingImage()" in Effervescence theme or into "indexpage" in ZenPage theme and it is still not working. All it can do is to broke whole gallery. I am not even able to dump it, the last avible dump is on "getTitle()" but there is going something wrong on "newAlbum()"
  • acrylian Administrator, Developer
    Well, in any case you are using the object model wrong:
    `
    $randomAlt1 = $randomAlbum->getTitle();
    $albumobject = newAlbum($randomAlt1);
    `
    You use the title but you have to use the name (or filename, titlelink for other item types):
    `
    $randomAlt1 = $randomAlbum->getFolder(); // alternatively: $randomAlbum->name;
    $albumobject = newAlbum($randomAlt1);
    `
    http://www.zenphoto.org/news/zenphotos-object-model-framework

    Where is `$randomImage->getAlbum()` coming from? `$randomImage`must be an image object for this to work.
  • Hello, thank you for help but it is still crashing on PrintSlideshow.

    I got "slideshow" allowed in theme settings.
    - randomAlt1 is ok now (dumps right names)
    - albumobject prints "album (6)"

    My code:
    $randomAlbum = $randomImage->getAlbum();
    $randomAlt1 = $randomAlbum->name;
    $albumobject = newAlbum($randomAlt1);
    printSlideShow(true,false,$albumobject, '', 1000,400);
  • acrylian Administrator, Developer
    You need to be more specific what "crash" means. Please review your error log.
  • There is nothing about slideshow in the log.
    There is only this:

    USER ERROR: Invalid album instantiation: Rhodos 8-15.9.2015 does not exist. in /../class-album.php on line 1215
    trigger_error called from Album->_albumCheck (class-album.php [1215])

    (and that album exists)
  • acrylian Administrator, Developer
    Well apparently the album does not exist. Sorry, can't help as I don't know your site.

    Btw, I would recommend to not have spaces etc in album names. URLs look nice and it possibly saves some issues although it is not a technical problem.
  • fretzl Administrator, Developer
    Let's start from the beginning ;-)
    Which theme are you using ?
Sign In or Register to comment.