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)) (...)

Client side optimization

As per yahoo! optimization guidelines for making Zenphoto faster at client-side, here are some hacks.

FIRST: Edit .htaccsss file and add the following lines.

ExpiresActive on
ExpiresDefault "access plus 1 year"

FileETag None
That will make your image, javascript,css files cache lifetime 1 year+ and Removes Etags, If Apache WebServer?has attached any. So that webpage header size can be reduced.

SECOND: If your web server is supporting gzip compression, edit index.php and add following line at Top of the page.

header("Vary: Accept-Encoding");if (substr_count($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip'))
else ob_start();

So, Web server will deliver entire webpage as gzip compression format to the browser. So, network bandwidth can be reduced.

THIRD: (...)

Flickr importer

This script grabs the photos and meta data and creates albums in Zenphoto and entries in the appropriate tables.

e107 autogallery to Zenphoto migration

A tutorial from 2008 to migrated from the autogallery plugin of the CMS e107 to Zenphoto including a Phyton script to migrate the view counter to Zenphoto's hitcounter.

Coppermine to Zenphoto import

A very basic script in Perl that will copy over Metadata from Coppermine to Zenphoto. The data is keyed on filename, so it is assumed that you have unique filenames in your albums.

Import Menalto Gallery 2 Image Descriptions

A Perl script to import Menalto Gallery 2 Image Descriptions.

MWZenphoto - MediaWiki integration

A MediaWiki extension to allow inclusion of images from a Zenphoto gallery using a simple tag in the markup.

Windows Live Photo Gallery Zenphoto Plugin

This is a plugin for Windows Live Photo Gallery application that permits publishing photos to a installation of Zenphoto gallery. The code is based on example plugin that comes with Photo Gallery SDK.

Download the plugin, install it, open Windows Live Photo Gallery, and then under "Publish" menu you can find "Zenphoto Plugin".
WLPG Zenphoto Plugin is distributed under the GNU General Public License (I hope that doesn't break the license of Microsoft Photo Gallery SDK examples).

Vista Order Prints Wizard

This script gives you the ability to use the Windows Vista Order Prints Wizard to upload files to your Zenphoto installation using the Explorer sidebar. Just drop it in the root Zenphoto installation directory to install it.

XP Publishing Wizard

This script gives you the ability to use the Windows XP Publishing Wizard to upload files to your Zenphoto installation.