ZenphotoCMS Forum
Latest Images Outside Zen Directory - Printable Version

+- ZenphotoCMS Forum (https://forum.zenphoto.org)
+-- Forum: Support (https://forum.zenphoto.org/forum-1.html)
+--- Forum: General support (https://forum.zenphoto.org/forum-4.html)
+--- Thread: Latest Images Outside Zen Directory (/thread-1944.html)



Latest Images Outside Zen Directory - MeenXo - 2007-12-17

Hello Everyone,

I am trying to insert the latest 3 images added to my album to my /index.php
zenphoto resides in /album/
Therefore, the latest images will be displayed OUTSIDE zen.

Can someone provide me with a correct script where I can accomplish that?

Thanks




Latest Images Outside Zen Directory - sbillard - 2007-12-17

look at http://www.zenphoto.org/trac/wiki/ZenphotoHacks#zenphotoasaplug-in for how to use zenphoto outside its realm. Look at the stopdesign theme's index.php file for how to get the latest images.




Latest Images Outside Zen Directory - MeenXo - 2007-12-21

Thanks for reply and your time sbillard.
I am PHP Newbie, sorry if I misunderstanding something incorrectly, I am receiving the following error

Fatal error: Cannot redeclare printlatestimages()

Using the following script
`




Latest Images Outside Zen Directory - acrylian - 2007-12-21

You need to define the webpath in this part define('WEBPATH', ''); For example something like http://www.yoursite.com/zenphoto




Latest Images Outside Zen Directory - sbillard - 2007-12-21

The function printLatestImages is part of zenphoto. You should delete the declaration of it from your page.




Latest Images Outside Zen Directory - sbillard - 2007-12-22

there should be a slash in the line
require_once(WEBPATH . "" . ZENFOLDER . "/template-functions.php");

require_once(WEBPATH . "/" . ZENFOLDER . "/template-functions.php");

The WEBPATH define should match the folder where zenphoto is installed. I.e. if your zenphoto php files are in photos/zp-core/ then the define would be define('WEBPATH', 'photos');

Anyway, the page you show seems only to be defining the function printlatestimages() which you don't need to (and are not allowed to) do.

Please look at the WIKI description for use of zenphoto as a plugin.http://www.zenphoto.org/trac/wiki/ZenphotoHacks#zenphotoasaplug-in

Follow this example to edit your php page that you want to display zenphoto images. Place the call on printlatestimages() where you want the images to appear on your web page.

For a full example of an index.php page that displays a random image:
`

Test Index




Latest Images Outside Zen Directory - sbillard - 2007-12-22

OK, just to be more to the point, I have changed my test home page to put out the latest images as you want to do. Here is the index.php file. (note that there is no adornment to the page, it just shows the images.)
`

Test Index

`




Latest Images Outside Zen Directory - MeenXo - 2007-12-23

Thank you everyone, especially sbillard, for your help