![]() |
|
Zenphoto as a plugin - 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: Zenphoto as a plugin (/thread-1910.html) |
Zenphoto as a plugin - sbillard - 2007-12-07 I have done some experimentation in responding to a post here on the forum. Thought I'd share the findings with everyone. You can use zenphoto functions on any of your WEB pages so long as you successfully inclucde `template-functions.php` in your page. To do so, include the following PHP. This assumes that your zenphoto installation is in a folder named `zenphoto`. `<?php define('ZENFOLDER', 'zp-core'); define('WEBPATH', 'zenphoto'); require_once(WEBPATH . "/" . ZENFOLDER . "/template-functions.php"); ?>` Zenphoto as a plugin - jayteegee - 2007-12-19 I have tried this but I'm getting an error message stating that zenphoto cannot connect to the database. My zenphoto install works perfectly otherwise. Any thoughts? Zenphoto as a plugin - sbillard - 2007-12-19 here is the full source of an index.php that works. It displays a random image. `<?php define('ZENFOLDER', 'zp-core'); define('WEBPATH', 'zenphoto'); require_once(WEBPATH . "/" . ZENFOLDER . "/template-functions.php"); header ('Content-Type: text/html; charset=' . getOption('charset')); ?> <html> <head> <title>Test Index</title> </head> <body> <?php $randomImage = getRandomImages(); $randomImageURL = getURL($randomImage); echo "<img src='". $randomImage->getSizedImage(getOption('image_size')) . "' alt=\"random image\"n" . $randomImage->getTitle() . '" />'; ?> </body> </html>` This file is in the root folder of the site. Zenphoto is installed in the folder `zenphoto`. Try it out and see if you get the same result. Also, please describe the geography of your site. What is the folder structure. Where is zenphoto and where is the "plug-in" use. Where in your plug-in code does the error message occur? Zenphoto as a plugin - michaelsam - 2009-02-02 how to use that with two different galleries ? i want to show on one page a link to two different galleries with random thumb_img - is that possible ? Zenphoto as a plugin - sbillard - 2009-02-02 That has never been tried. And it probably cannot be made to work since the environment setup needs to be done before headers are sent and you would have to set up two different environments. Zenphoto as a plugin - michaelsam - 2009-02-02 $randomImage->getSizedImage(getOption('image_size')) . how do i get instead of image_size the crop_image_sized thumbnails ? thumb_size i tried but it's not working like in the gallery can u please help me. Zenphoto as a plugin - acrylian - 2009-02-03 You need to use this: http://www.zenphoto.org/documentation/classes/Image.html#methodgetCustomImage Zenphoto as a plugin - michaelsam - 2009-02-03 thx for your help, but i don't get it working, i'm not used to php that much. so i tried a view things but always i got errors or the image was in original size. where i have it to fill in ? i think i'm not right when i think in this section instead of image_size, cause that didn't work correktly. echo "<img src='". $randomImage->getSizedImage(getOption('image_size')) . "' alt=\"random image\"n" . $randomImage->getTitle() . '" />'; can you please post the whole code for me? |