Let's say I install ZP in a /gallery folder, below my site root.
The site root has an index.php file which is a simple home page with a menu like this: Home Blog Gallery About.
The /gallery will contain all the ZP files: index.php, albums.php, etc. The "Gallery" menu entry would call the ZP index.php file so that I can have the full ZP functionality.
On my home page I just want to pull thumbs from any single ZP albums folder into my index.php home page. I would do this using the printRandomImages or any other function that would allow me to do that. (Then I would want to display the single images from the thumbs).
*** The question is, what do I have to include at the top of my site root index.php file to be able to then use the ZP functions and achieve the above?
I searched the user guide and the forum but so far I did not find anything on this.
Comments
This is nothing we can do to fix since Zenphoto is considered to be a standalone system. Sorry.
The only way would be to declare all globals Zenphoto might need within Wordpress (which might require hacking it). Or building workarounds like we do on our homepage (it is btw planned to move the site to Zenphoto only once we find the time).
`
<?php zp_load_album('/zenphoto/Latest') ?>
`
to load the album specific single context, followed by the
`
<?php while (next_image(false, $firstPageImages)): ?>
...
`
loop to display the album thumbs. it did not work.
I get a blank page, no thumbs.
My index.php works fine if I use the typical loops:
`
<?php while (next_album()): ?>
...
`
or
`
<?php while (next_image(false, $firstPageImages)): ?>
...
`
Again, what I am trying to do is to display on the index.php home page the images from a single folder that I want to be able to specify. In this test the index.php is in the ZP themes folder.
Anyway, to the topic. What you does and can simply not work. `/zenphoto/Latest` would be an subalbum "Latest" within an album "zenphoto" within the `albums` folder. You have to setup the object global of the current album (the global `$_zp_current_album`) use the object model framework to get this working. Please read http://www.zenphoto.org/2010/02/zenphotos-object-model-framework/
`
<?php $galleryobject = new Gallery(); ?>
<?php $albumobject = new Album($galleryobject,"latest"); ?>
<?php while (next_image(false, $firstPageImages)): ?>
... standard image loop code that works ...
`
"latest"is the name of the individual folder within the ZP "albums" folder. Again, it did not work.
By the "forum added" I meant the `` shortcodes in the code.
On spammers: your site does a very good job though in getting rid of the spam. If waiting a few minutes is what it takes, no problem.
`
<?php $galleryobject = new Gallery(); ?>
<?php $albumobject = new Album($galleryobject,"Bikes"); ?>
<?php makeAlbumCurrent($albumobject) ?>
<?php while (next_image(false, $firstPageImages)): ?>
... loop code
<?php endwhile; ?>
`
Inside the loop I used the getCustomImageURL() so that I can display the larger image in a lightbox. To display it using image.php replace it with getImageLinkURL()