Junior Member
Junior Member
patockaj   2015-06-04, 11:05
#1
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?
Administrator
Administrator
fretzl   2015-06-04, 11:37
#2
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.
Administrator
Administrator
acrylian   2015-06-04, 11:39
#3
Quote: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.
Member
Member
jaxczech   2015-10-05, 11:25
#4
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()"
Administrator
Administrator
acrylian   2015-10-05, 12:34
#5
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.
Member
Member
jaxczech   2015-10-09, 08:10
#6
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);
Administrator
Administrator
acrylian   2015-10-09, 10:45
#7
You need to be more specific what "crash" means. Please review your error log.
Member
Member
jaxczech   2015-10-09, 12:30
#8
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)
Administrator
Administrator
acrylian   2015-10-09, 14:02
#9
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.
Administrator
Administrator
fretzl   2015-10-09, 15:23
#10
Let's start from the beginning ;-)
Which theme are you using ?
  
Powered By MyBB, © 2002-2026 MyBB Group.
Made with by Curves UI.