News

ZENpressed

ZENpressed is a ZENphoto-integration-plugin for WordPress based on ZenShow by Rui Cruz and the old ZENphoto-insert-plugin and inspired by the simple mp3 player plugin on how to do the Quicktag.

ZenphotoPress

Zenphotopress is a plugin for WordPress. It is designed to provide an easy way to include Zenphoto images into your blog posts.

There is a forum post regarding ZenphotoPress here. This is where you can go for more information and support. "Simbul" keeps an eye on this topic.

ZenLatest

A Wordpress 2.2.3 widget that shows the latest additions to Zenphoto in the sidebar.

Trung_PressZen

This is an extension for Wordpress to integrate Zenphoto into your Wordpress installation. It required ZenPhoto installed on the same server and very easy to install (thanks to Wordpress easy plug-in system).

Zenphoto external thumb

Features:

  • Retrieves images from the gallery based on the image filename. So you can move the image around between albums, move the parent album around, or whatever and not have to change the old thumbnail link.
  • Returns thumbnails in a default size or any requested size.
  • Will return a JSON object for integration into whatever web application you decide to write. It uses a server-side proxy to retrieve the data; so it should be safe against XSS injection.

Limitations:

  • Requires a *NIX host. The script relies on the find utility.
  • Has some hard coded paths at the moment.

You can see an example of the script in action at http://james.roomfullofmirrors.com/extthumb_example.html.

Zenphoto Single-Login

I have created this hack to cater to people who wish to provide a custom login for users which will take them directly to the albums they are allowed to view and/or administrate. This need was suggested on the forums in the thread Linking my login form to ZenPhoto.

The hack assumes that you have created admin users with the appropriate rights and albums to manage. Admin users with User Administration rights are directed to the gallery after they log in. All others are directed to the first album in their managed album list.

Place this script in the root folder of your zenphoto installation. If you installed in 'zenphoto' this file becomes zenphoto/single_login.php. For the page that you tell your users to access create a script that contains only the following:

<?php header("Location: zenphoto/single_login.php" ); ?>
The Script is bare-bones. You will (...)

Random Image for external site

Put the file in your zenphoto/zp-core/random.php

To call from another PHP
@readfile('http://yourgallery.com/zenphoto/zp-core/random.php?
num=9&height=50&width=50&class=one-image')

The above mean return 9 random images which height and width is 50px and the style class is "one-image".

@readfile('http://yourgallery.com/zenphoto/zp-core/random.php?
num=9&height=50&width=50&class=one-image&album=city')

this will only get the random images from album "city"(the parameter is the folder of album).

RSS feed which groups photos

The idea is to group together in the same rss entry all the photos that have been added at the same time in the same album. Photos are browsed by decreasing mtime (=upload date, because id doesn't seem to be very reliable), and every time the album change, or a one hour gap occurred during uploading, a new entry is created. This entry contains the list of all photos with title and description, and optionally photo (?showphotos). RSS entries are not created if the latest photo is less than 1 hour old, in order to avoid multiple entries for the same uploading event (moreover it gives some time to edit titles and descriptions during this hour).

eAccelerator caching

a. Reduce load on the DB server

This is based on the caching technique described on http://www.zenphoto.org/2008/01/hacks/ We'll use eAccelerator shm cache instead of storing the query results on disk.
1. Edit the functions-db.php under zp-core directory.
2. Search function query_single_row, change it to:
function query_single_row($sql, $noerrmsg=false) {
if ($cache = get_cache($sql))
return $cache;
$result = query($sql, $noerrmsg);
if ($result) {
$data = mysql_fetch_assoc($result);
store_cache($sql, $data);
return $data;
}
else {
return false;
}
}

3. Search function query_full_array, change it to:
function query_full_array($sql, $noerrmsg = false) {
if ($cache = get_cache($sql))
return $cache;
$result = query($sql, $noerrmsg);
if ($result) {
$allrows = array();
while ($row = mysql_fetch_assoc($result))
$allrows[] = $row;
(...)

Server side optimization

Database result cache

As we know, the database will use many resource and time to query the information of Image. If we want to save time, we could do optimization with cache the result.
What I use is two functions, you could use other PHP cache library too. The code I use is version 1.13.
!! Please note: because I don't open the comment function, so it may have problem with comment.

1. Edit the functions-db.php under zp-core directory.

2. Search function query_single_row, change it to:
function query_single_row($sql){
if ($cache = get_cache($sql))
return $cache; $result = query($sql);
if ($result) {
$singlerow = mysql_fetch_assoc($result);
store_cache($sql, $singlerow);
return $singlerow;
} else {
return false;
}
}

3. Search function query_full_array, change it to:
function query_full_array($sql){
if ($cache = get_cache($sql)) (...)