Member
Member
MeenXo   2007-12-17, 09:57
#1

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

Member
Member
sbillard   2007-12-17, 12:48
#2

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.

Member
Member
MeenXo   2007-12-21, 08:36
#3

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
`

Administrator
Administrator
acrylian   2007-12-21, 10:45
#4

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

Member
Member
sbillard   2007-12-21, 13:12
#5

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

Member
Member
sbillard   2007-12-22, 02:43
#6

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

Member
Member
sbillard   2007-12-22, 03:12
#7

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

`

Member
Member
MeenXo   2007-12-23, 20:05
#8

Thank you everyone, especially sbillard, for your help

  
Powered By MyBB, © 2002-2026 MyBB Group.
Made with by Curves UI.