ZenphotoCMS Forum
Generate two thumbnails - 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: Generate two thumbnails (/thread-4776.html)



Generate two thumbnails - mariarchi - 2009-03-01

Hi everyone,

When user uploads the photo to the gallery, thumbnail is generated.

I want the gallery to generate two thumbnails of different sizes. (basically, one big thumb is for preview inside the blog, and one small one is for navigating through the gallery)

Any ideas how to do that without heavily hacking zenphoto source? What files should I look at?

Thanks!




Generate two thumbnails - acrylian - 2009-03-01

What do you use for a blog? If you use Wordpress take a look at the zenphotopress wordpress plugin.
If you use the Zenpage plugin that comes with a TinyMCE plugin named tinyZenpage that does the same.




Generate two thumbnails - mariarchi - 2009-03-01

I use wordpress. And I use zenphotopress.
Basically I want to show image of the custom size in the sidebar. Widget which comes with zenphotopress just shows the thumbnails - it is possible to specify the image size only for the popup inside the admin.




Generate two thumbnails - mariarchi - 2009-03-02

Update: I found function that does the trick - printRandomImages(1, null, 'all', '', custom_height, custom_width);

However, the problem is I can't get how to include it in wordpress.

Just requiring zp-core/template-functions.php doesn't work - zenphoto complains about database error




Generate two thumbnails - mariarchi - 2009-03-02

It can find the zp-config.php, but it complains that the DB password or DB user is wrong. I guess the reason is because wordpress works with the same database at the same time from the same process and those two interfere somehow




Generate two thumbnails - mariarchi - 2009-03-02

I found a thread about same problem, but it's quite empty - http://www.zenphoto.org/support/topic.php?id=3405&replies=3




Generate two thumbnails - acrylian - 2009-03-02

Follow the link in the first post. That explains how to use Zenphoto functions outside of Zenphoto. There are also many other threads about this. Also there are other Wordpress plugins on our extensions page you might want to try.




Generate two thumbnails - mariarchi - 2009-03-02

  1. Thanks for the reply!
  2. I solved the problem using @readfile directive. Which is rather dirty, but it does it's job.
  3. It does explain it. However, it does not work. Database error (wrong user/password/host) is raised at some point (though it normally works). Like i've said, i'm not sure why, i suspect that mysql transaction management interferes with zenphoto's (just a random guess)

Other threads do not work as well. Wordpress plugins do not do what i want them to do - display custom sized thumbnail in the sidebar (they display standard sized thumb).