How to display zenphoto thumbs on home page site?

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

Comments

  • acrylian Administrator, Developer
    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.
  • 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 "
    <img src='". $randomImage->getSizedImage(getOption('image_size')) . "'
    alt=\"random image\"\n" . $randomImage->getTitle() . '" />
    ';

    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
  • acrylian Administrator, Developer
    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
  • 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
  • acrylian Administrator, Developer
    Please really take a look at our functions guide: http://www.zenphoto.org/2008/04/how-to-read-the-zenphoto-functions-guide/
  • 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
  • thanks for this. not quite what I'm doing, but you solved my problem! :)
  • Hello Mr. Code, would you mind sharing, and maybe help me out with my issue?
  • 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

    <?php define('ZENFOLDER', 'zp-core');
    define('WEBPATH', 'zenphoto');
    require_once(WEBPATH . "/" . ZENFOLDER . "/template-functions.php");
    require_once(WEBPATH . "/" . ZENFOLDER . "/plugins/image_album_statistics.php");
    ?>

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

    <?php
    printLatestImages(3, '', false, false, false, 40, '', 200, 100, true, true);
    ?>
  • I'm getting a fatal error. It doesn't recognize the printlatestimages hook.

    Help?
Sign In or Register to comment.