ZenphotoCMS Forum
How to display zenphoto thumbs on home page site? - 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: How to display zenphoto thumbs on home page site? (/thread-4832.html)



How to display zenphoto thumbs on home page site? - skyscape - 2009-03-10

I need to be able to grab 5 latest gallery pics from Zenphoto and display them on home page of the site as thumbs. Anybody know how I can do that?

Please help

Thanks
Ben




How to display zenphoto thumbs on home page site? - acrylian - 2009-03-11

http://www.zenphoto.org/2008/01/hacks/#zenphoto-as-plugin and please do a forum search about that, there are quite some threads about this.




How to display zenphoto thumbs on home page site? - skyscape - 2009-03-11

I appreciate your help acrylian.
I actually did do search and looked through every thread to page 20, and I did manage to find threads similar to mine, but with no replies.

I would like you to know that I'm a newbie in the PHP department. And I need some more help with the script.

So I put the first code above the header line

define('ZENFOLDER', 'zp-core');
define('WEBPATH', 'zenphoto');
require_once(WEBPATH . "/" . ZENFOLDER . "/template-functions.php");

And I put this code in the body where I want image to appear. The script worked but then I noticed that this script only shows one random image in full size.

$randomImage = getRandomImages();
$randomImageURL = getURL($randomImage);
echo "
';

I want the script to show 5 latest thumbs in horizontal position on the page. Right now the script shows one random image in full size. So I don't know to what extent I can modify it, and if I can modify it, what should I be doing?

Thanks
Ben




How to display zenphoto thumbs on home page site? - acrylian - 2009-03-11

Ok, since "printlatestimages" is a plugin function you need also to include the plugin after the template-functions:
require_once(WEBPATH . "/" . ZENFOLDER . "/plugins/image_album_statistics.php");

The available functions of that plugin are documentated here: http://www.zenphoto.org/documentation/plugins/_plugins---image_album_statistics.php.html




How to display zenphoto thumbs on home page site? - skyscape - 2009-03-11

Ok, I included the statistics plugin. And the code that I need to use from the statistics file is [line 509]

void printLatestImages( [string $number = 5], [string $albumfolder = ''], [bool $showtitle = false], [bool $showdate = false], [bool $showdesc = false], [integer $desclength = 40], [string $showstatistic = ''], [integer $width = 85], [integer $height = 85], [bool $crop = true], [bool $collection = false] )

Now the challenge is, how do I write the php code to call out this function from the statistics file and spit it in the main page where I want thumbs to appear?

For the template function, there is that code, which I have pasted in the above reply but I dont see the code for statistics file.

Thanks
Ben




How to display zenphoto thumbs on home page site? - acrylian - 2009-03-12

Please really take a look at our functions guide: http://www.zenphoto.org/2008/04/how-to-read-the-zenphoto-functions-guide/




How to display zenphoto thumbs on home page site? - skyscape - 2009-03-12

Hello Acrylian
I think you assume I can code PHP. I cannot. I can edit a few little php elements here and there, but I'm not a php coder. I read the fuction guide, and I have very little clue what I'm supposed to do.

Let me know if you can help me resolve this, I know you are busy.
I appreciate your help thusfar.

Thanks
Ben




How to display zenphoto thumbs on home page site? - mr code - 2009-03-13

thanks for this. not quite what I'm doing, but you solved my problem!




How to display zenphoto thumbs on home page site? - skyscape - 2009-03-13

Hello Mr. Code, would you mind sharing, and maybe help me out with my issue?




How to display zenphoto thumbs on home page site? - skyscape - 2009-03-16

For everyone who needs this, and I know many folks will find this important,
Here is the code to call out 3 recent images.

  1. Place this code above the header

  2. Place this code in the body where you want images to appear




How to display zenphoto thumbs on home page site? - nothingbutsong - 2009-03-21

I'm getting a fatal error. It doesn't recognize the printlatestimages hook.

Help?