<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Zenphoto &#187; User Guide</title>
	<atom:link href="http://www.zenphoto.org/category/User-guide/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.zenphoto.org</link>
	<description>Blog for news about Zenphoto and its development.</description>
	<lastBuildDate>Sun, 07 Mar 2010 10:47:58 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Zenphoto&#8217;s object model framework</title>
		<link>http://www.zenphoto.org/2010/02/zenphotos-object-model-framework/</link>
		<comments>http://www.zenphoto.org/2010/02/zenphotos-object-model-framework/#comments</comments>
		<pubDate>Mon, 22 Feb 2010 15:51:18 +0000</pubDate>
		<dc:creator>acrylian</dc:creator>
				<category><![CDATA[Customizing]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Theming & Templating]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[User Guide]]></category>

		<guid isPermaLink="false">http://www.zenphoto.org/?p=1325</guid>
		<description><![CDATA[This is a short tutorial about how to use Zenphoto&#8217;s object model framework  that you for example can use to leave the standard theme way described on the  theming tutorial or to do other custom stuff.
Before reading this you should be familiar with Zenphoto themes in general and having read the theming tutorial. Also you [...]]]></description>
			<content:encoded><![CDATA[<p>This is a short tutorial about how to use Zenphoto&#8217;s object model framework  that you for example can use to leave the standard theme way described on the <a title="http://www.zenphoto.org/2009/03/theming-tutorial/" href="../2009/03/theming-tutorial/"> theming tutorial</a> or to do other custom stuff.</p>
<p>Before reading this you should be familiar with Zenphoto themes in general and having read the<a title="http://www.zenphoto.org/2009/03/theming-tutorial/" href="http://www.zenphoto.org/2009/03/theming-tutorial/"> theming tutorial</a>. Also you should have quite some PHP knowledge and an understanding about how object orientation works.</p>
<ol>
<li><a href="#changing-database-entries">Zenphoto&#8217;s main classes</a></li>
<li><a href="#global-object-variables">Global object variables</a></li>
<li><a href="#creating-an-object">Creating an object</a></li>
<li><a href="#changing-objects">Changing objects</a></li>
<li><a href="#deleting-objects">Deleting objects</a></li>
</ol>
<h4><a name="zenphoto-main-classes"></a>Zenphoto&#8217;s main classes</h4>
<ul>
<li><strong>Gallery</strong>: the gallery itself</li>
<li><strong>PersistentObject</strong>: This is a very general and powerful abstract database persistence class. It defines types by table names and records by a set of unique fields (keys). To instantiate a new database based object in Zenphoto, all that&#8217;s needed are the values of those unique fields. <strong>PersistentObject</strong> provides caching, lazy-evaluating, persistable object support.  <strong>PersistentObject</strong> is the root class for the following objects:
<ul>
<li><strong>Album</strong>:  represents an album.</li>
<li><strong>Image</strong>:  represents an image within an album. The base <strong>Image</strong> object has been extended to handle other &#8220;image&#8221; types:
<ul>
<li><strong>Video</strong> <em>(optional video class plugin)</em>:  represents an extended image that is multimedia content like mp3,mp4,flv</li>
<li><strong>TextObject</strong> <em>(optional text object class plugin)</em>: its object represents an image object that is a .txt file. This object is intended as an example on how to extend Zenphoto for other filetypes</li>
</ul>
</li>
<li><strong>ZenpageNews</strong> <em>(</em><a title="http://www.zenphoto.org/2009/03/zenpage-a-cms-plugin-for-zenphoto/" href="http://www.zenphoto.org/2009/03/zenpage-a-cms-plugin-for-zenphoto/"><em>optional </em></a><em><a title="http://www.zenphoto.org/2009/03/zenpage-a-cms-plugin-for-zenphoto/" href="http://www.zenphoto.org/2009/03/zenpage-a-cms-plugin-for-zenphoto/">Zenpage CMS plugin</a>)</em>: represents a Zenpage news article</li>
<li><strong>ZenpagePages</strong> <em><a title="http://www.zenphoto.org/2009/03/zenpage-a-cms-plugin-for-zenphoto/" href="http://www.zenphoto.org/2009/03/zenpage-a-cms-plugin-for-zenphoto/">(</a></em><a title="http://www.zenphoto.org/2009/03/zenpage-a-cms-plugin-for-zenphoto/" href="http://www.zenphoto.org/2009/03/zenpage-a-cms-plugin-for-zenphoto/"><em>optional </em></a><em><a title="http://www.zenphoto.org/2009/03/zenpage-a-cms-plugin-for-zenphoto/" href="http://www.zenphoto.org/2009/03/zenpage-a-cms-plugin-for-zenphoto/">Zenpage CMS plugin</a>)</em>: represents a Zenpage page</li>
</ul>
</li>
<li><strong>SearchEngine</strong>: represents a search</li>
</ul>
<h4><a name="global-object-variables"></a>Global object variables</h4>
<p>Zenphoto operates with several global object variables that for example contain the object of the current image, album or if using Zenpage the current new article or page if in the related theme context.</p>
<p>On this little roundup we will concentrate on examples of the three most important globals: <tt>$_zp_gallery</tt> for the Gallery class object, <tt>$_zp_current_album</tt> for the Album class object and of course <tt>$_zp_current_image</tt> for the <strong>Image</strong> object classes. As you see the globals are named quite understandable.</p>
<p>These global objects are automatically set up depending on the context. So  depends of course on the context:</p>
<ul>
<li><tt>$_zp_gallery</tt> is always setup on all theme pages as it represents the gallery in total.</li>
<li><tt>$_zp_current_album</tt> is setup in album context as within the <tt>next_album()</tt> loop or on a theme&#8217;s <tt>album.php</tt>.</li>
<li><tt>$_zp_current_image</tt> is setup in image context as within the <tt>next_image()</tt> loop on a theme&#8217;s <tt>album.php</tt> or on the single image display on <tt>image.php</tt>.</li>
</ul>
<p>For example to get the title of the current album selected you can use <tt>$_zp_current_album-&gt;getTitle()</tt>. This is actually the same as the template function <tt>getAlbumTitle()</tt>.</p>
<p>All template functions of course use these global objects and you can actually do everything with the class methodes directly. Although that would mean double work in some places as some template functions will output full html sets for your convenience (like the tag cloud html list, the page navigation and similar things).</p>
<p><em>Read more:</em> A more complete list of<a title="http://www.zenphoto.org/2008/07/zenphotos-global-variables/" href="../2008/07/zenphotos-global-variables/"> Zenphoto&#8217;s global variables</a></p>
<h4><a name="creating-an-object"></a>Creating a new object</h4>
<p>Of course you can create objects besides being &#8220;current&#8221; within any context. That is pretty standard object orientation. Here the steps to create an image and album object with Zenphoto&#8217;s framework:</p>
<ol>
<li><strong>New gallery object:</strong> <tt>$galleryobject = new Gallery();</tt></li>
<li><strong>New album object</strong>:<br />
<tt>$albumobject = new Album($galleryobject,"&lt;folder name of the album&gt;");</tt><br />
Note that &#8220;folder name&#8221; means the name of the real folder on the filesystem within the root &#8220;albums&#8221; folder of your installation. If you want to create an object of a subalbum the name must include the parent album name(s) like &#8220;toplalbumfoldername/subalbum1folder/subalbum2folder&#8221; (etc);</li>
<li><strong>New image object</strong>: <tt><br />
$imageobject = newImage($albumobject,"&lt;file name of the image&gt;");</tt><br />
NOTE: This is not a typo as you should NOT use the constructor <tt>new Image()</tt> for creating a new image object but always the special function <tt>newImage()</tt>! It is this function that determines the appropriate &#8220;image&#8221; class to instantiate based on the filename suffix.</li>
</ol>
<p>It works similar for Zenpage items as well:</p>
<ol>
<li><strong>New news article object:</strong> <tt>$newsobj = new ZenpageNews("&lt;titlelink of article&gt;");</tt></li>
<li><strong>New page object</strong> = <tt>$pageobj = new ZenpagePage("&lt;titlelink of page&gt;");</tt></li>
</ol>
<p>You can now use all methodes of the classes with their object. One speciality: For all objects that contain objects of child classes of the main PeristentObject class you can use <tt>$object-&gt;get("&lt;name of the database field"&gt;);</tt> to get the value of any database field entry for this item.</p>
<p><em>Read more:</em> <a title="http://www.zenphoto.org/documentation/li_classes.html" href="../documentation/li_classes.html">Available class methods</a></p>
<h4><a name="changing-objects"></a>Changing objects</h4>
<p>As you now know <tt>$_zp_current_album-&gt;getTitle()</tt> gets the title of the current image. That title is of course stored in the &#8220;images&#8221; table of the database.</p>
<p>Now the object model alsp provides functionality to change this value. So for the current image object you could change the image&#8217;s title like this:</p>
<p><tt>$imageobject-&gt;set("title","&lt;new title&gt;");</tt></p>
<p>Just doing this  the change will be temporarily. If you really want a persistent change of the database entry you also have to save it:</p>
<p><tt>$imageobject-&gt;save();</tt></p>
<h4><a name="deleting-objects"></a>Deleting an object</h4>
<p>You can delete an object using this:</p>
<p><tt>$obj-&gt;remove();</tt></p>
<p><strong>NOTE: </strong>Deleting an object of an image or album also deletes the file/folder on the file system. In case of albums it will also delete all content of this album like images or sub albums recursivly.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.zenphoto.org/2010/02/zenphotos-object-model-framework/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Zenphoto as a &#8220;plug-in&#8221;</title>
		<link>http://www.zenphoto.org/2009/12/zenphoto-as-a-plug-in-using-zenphoto-functions-from-outside-zenphoto/</link>
		<comments>http://www.zenphoto.org/2009/12/zenphoto-as-a-plug-in-using-zenphoto-functions-from-outside-zenphoto/#comments</comments>
		<pubDate>Thu, 24 Dec 2009 20:13:23 +0000</pubDate>
		<dc:creator>acrylian</dc:creator>
				<category><![CDATA[CMS integration]]></category>
		<category><![CDATA[FAQ]]></category>
		<category><![CDATA[Theming & Templating]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[User Guide]]></category>

		<guid isPermaLink="false">http://www.zenphoto.org/?p=949</guid>
		<description><![CDATA[NOTE: This  is known not to work anymore with (at least) Wordpress and Joomla for yet unknown reasons and results in MySQL errors. Also see this forum thread. 

You can use zenphoto features in your main web pages by including template-functions.php in your php pages. To do this successfully when the page is not in [...]]]></description>
			<content:encoded><![CDATA[<p><strong>NOTE: </strong><em>This  is known not to work anymore with (at least) Wordpress and Joomla for yet unknown reasons and results in MySQL errors. Also see this <a title="http://www.zenphoto.org/support/topic.php?id=6622" href="http://www.zenphoto.org/support/topic.php?id=6622">forum thread</a>.</em> <strong><br />
</strong></p>
<p>You can use zenphoto features in your main web pages by including <tt>template-functions.php</tt> in your php pages. To do this successfully when the page is not in the zenphoto folders include the following PHP code in you page (this assumes zenphoto is installed in a folder named <tt>zenphoto</tt>):</p>
<pre>define('WEBPATH', 'zenphoto');
require_once(WEBPATH . "/zp-core/template-functions.php");</pre>
<p>You will now be able to use zenphoto functions on your page to, for instance, place an random image from your album on your index page. Code for this is:</p>
<pre>$randomImage = getRandomImages();
$randomImageURL = getURL($randomImage);
echo "&lt;a href='".$randomImageURL."' title='Random Picture...'&gt;
&lt;img src='". $randomImage-&gt;getSizedImage(getOption('image_size')) . "'
alt=\"random image\n" . $randomImage-&gt;getTitle() . '" /&gt;&lt;/a&gt;';</pre>
<p><strong>NOTE:</strong> Many of the zenphoto template-functions operate on <tt>$_zp_current_album</tt>, <tt>$_zp_current_image</tt>, and <tt>$_zp_gallery</tt>. The latter are refered to as the <em>current album</em> and <em>current image</em> in the function documentation (see below.) These variables normally are setup by the process of loading the root <tt>index.php</tt> file and proceding to your theme php file. They will <strong>NOT</strong> be setup automatically for you when you use zenphoto as a plugin. You can use the functions <tt>zp_load_gallery()</tt>, <tt>zp_load_album($folder)</tt>, and <tt>zp_load_image($folder, $filename)</tt> to set these variables up. <tt>$folder </tt>is the path from the album folder to the album. <tt>$filename</tt> is the name of the image within <tt>$folder</tt>.</p>
<p>For further details on the template functions visit the Zenphoto Functions Guide</p>
<p><strong><span style="text-decoration: line-through;">UPDATE for zenphoto 1.1.6 and beyond:</span></strong></p>
<p><span style="text-decoration: line-through;">Zenphoto 1.1.6 has implemented a plugin architecture for adding functionality. If you wish to use functions from these plugins as part of your implementation you will need to initialize the plugins with the following code. Place the code after the &#8216;require_once&#8217; line that loads the template functions.</span></p>
<pre><span style="text-decoration: line-through;">//load extensions
$_zp_plugin_scripts = array();
$_zp_flash_player = NULL;
$curdir = getcwd();
chdir(SERVERPATH . "/" . ZENFOLDER . PLUGIN_FOLDER);
$filelist = safe_glob('*'.'php');
chdir($curdir);
foreach ($filelist as $extension) {
$opt = 'zp_plugin_'.substr($extension, 0, strlen($extension)-4);
if (getOption($opt)) {</span>
<span style="text-decoration: line-through;">require_once(SERVERPATH . "/" . ZENFOLDER . PLUGIN_FOLDER . $extension);
}
}</span></pre>
<pre>(No longer required with Zenphoto 1.2.7)</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.zenphoto.org/2009/12/zenphoto-as-a-plug-in-using-zenphoto-functions-from-outside-zenphoto/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>General contributor guidelines</title>
		<link>http://www.zenphoto.org/2009/11/general-contributor-guidelines/</link>
		<comments>http://www.zenphoto.org/2009/11/general-contributor-guidelines/#comments</comments>
		<pubDate>Sun, 29 Nov 2009 10:37:31 +0000</pubDate>
		<dc:creator>acrylian</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[FAQ]]></category>
		<category><![CDATA[Theming & Templating]]></category>
		<category><![CDATA[User Guide]]></category>
		<category><![CDATA[internationalisation & localisation]]></category>

		<guid isPermaLink="false">http://www.zenphoto.org/?p=1174</guid>
		<description><![CDATA[
Help on the forum
Provide translations
Test svn/nighty builds and report bugs
Contribtute to documentations or write tutorials
Themes and plugins


Help on the forum
You can help by answering general questions of users the developers do not have the time to answer. If we see you helping a lot you may even be provided with moderator status and so to [...]]]></description>
			<content:encoded><![CDATA[<ol>
<li><a href="#forum-help">Help on the forum</a></li>
<li><a href="#translations">Provide translations</a></li>
<li><a href="#testing">Test svn/nighty builds and report bugs</a></li>
<li><a href="#documentation">Contribtute to documentations or write tutorials</a></li>
<li><a href="#themes-and-plugins">Themes and plugins</a></li>
</ol>
<ul></ul>
<h5><a name="forum-help"></a>Help on the forum</h5>
<p>You can help by answering general questions of users the developers do not have the time to answer. If we see you helping a lot you may even be provided with moderator status and so to speak part of the &#8220;support team&#8221;.</p>
<h5><a name="testing"></a>Test svn/nighty builds and report bugs</h5>
<p>Zenphoto is constantly developed and sometimes new bugs sneak in without being noticed while fixing other things. By testing the <a title="http://www.zenphoto.org/files/nightly/" href="http://www.zenphoto.org/files/nightly/">nightly build</a> or the <a title="http://www.zenphoto.org/trac/browser/trunk" href="http://www.zenphoto.org/trac/browser/trunk">svn</a> you help finding these.</p>
<p>Report any bugs you find via the <a title="http://www.zenphoto.org/trac/report/10" href="http://www.zenphoto.org/trac/report/10">bugtracker</a> (registration required) and provide detailed information what you did and what setup you use (Zenphoto version, theme, server configuration etc.).</p>
<h5><a name="translations"></a>Provide translations</h5>
<p>Before starting you should read our <a title="http://www.zenphoto.org/2008/05/translating-tutorial/" href="http://www.zenphoto.org/2008/05/translating-tutorial/">translating tutorial</a> that has detailed info how Zenphoto&#8217;s translation works and what tools you need to provide a translation.</p>
<h5><a name="documentation"></a>Contribtute to documentations or write tutorials</h5>
<p>We try hard to documentate everything Zenphoto related but there might be things that are missing. You can suggest things on the forum or you can register on <a title="http://www.zenphoto.org/trac" href="http://www.zenphoto.org/trac">Trac</a> and use the somewhat unused Wiki as a sandbox. If your tutorial is good to go we may move it to the real user guide section or provide a link.<br />
Or if you have written on your blog or found something useful elsewhere let us know via the <a title="http://www.zenphoto.org/support" href="http://www.zenphoto.org/support">forum</a>. We then either add to our site and/or post it on our news sections.</p>
<h5><a name="themes-and-plugins"></a>Themes and plugins</h5>
<p>Of course it is assumed that you have some knowledge of general webtechniques and have read specifially <a title="http://www.zenphoto.org/2009/03/theming-tutorial/" href="http://www.zenphoto.org/2009/03/theming-tutorial/">theming tutorial</a>, <a title="http://www.zenphoto.org/2009/06/developer-coding-guidelines/" href="http://www.zenphoto.org/2009/06/developer-coding-guidelines/">developer coding guidelines</a> and other related articles on our <a title="http://www.zenphoto.org/category/User-Guide" href="http://www.zenphoto.org/category/User-Guide">user guide</a> section.</p>
<ul>
<li>Be sure to use the most recent Zenphoto release. Best test also the current nightly build to be save for the next release, too..</li>
<li>Provide a read me file and list if your theme or plugin requires anyhting specific. Also if your theme supports specific plugins or requires special settings to run as expected.</li>
<li>If you took over or modified an existing theme that has been abandoned beware of its licence. While the code may be under a GPL open source license, the design may not and released under a specific license (like the stopdesign themes that are not free for commercial use!)</li>
<li>If you made your own theme or plugin state the license under which you release it.</li>
<li>Create a page for the plugin or theme on your website that we can link to from our themes section as we generally don’t host third party themes or plugins (except for some very old ones we do)</li>
<li>Let us know on the <a title="http://www.zenphoto.org/support" href="http://www.zenphoto.org/support">forum</a> what you did so we can add it to the related sections</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.zenphoto.org/2009/11/general-contributor-guidelines/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Features</title>
		<link>http://www.zenphoto.org/2009/11/features/</link>
		<comments>http://www.zenphoto.org/2009/11/features/#comments</comments>
		<pubDate>Thu, 26 Nov 2009 17:26:53 +0000</pubDate>
		<dc:creator>acrylian</dc:creator>
				<category><![CDATA[FAQ]]></category>
		<category><![CDATA[User Guide]]></category>

		<guid isPermaLink="false">http://www.zenphoto.org/?p=1143</guid>
		<description><![CDATA[This is just the current list of Zenphoto&#8217;s main features. There’s more in store for Zenphoto in the future, as you can see in the roadmap. Keep checking back for news and new versions. Sound good? Take a look at the demo and see for yourself.
Gallery management

Upload images, videos, mp3s or even zip-archives via the [...]]]></description>
			<content:encoded><![CDATA[<p>This is just the current list of Zenphoto&#8217;s main features. There’s more in store for Zenphoto in the future, as you can see in the <a title="http://www.zenphoto.org/trac/roadmap" href="http://www.zenphoto.org/trac/roadmap">roadmap</a>. Keep checking back for news and new versions. Sound good? Take a look at the demo and see for yourself.</p>
<h4>Gallery management</h4>
<ul>
<li>Upload images, videos, mp3s or even zip-archives via the admin interface or even albums (folders) directly via FTP</li>
<li>Move, copy and rename images and albums without loosing any data</li>
<li>Automatically generated thumbnails, custom crops possible!, and sized<br />
down images</li>
<li>Tags for categorizing your images and albums</li>
<li>AJAX-powered edit-while-you-browse</li>
<li>Dynamic albums: Generate albums from searches!</li>
<li>EXIF and IPTC support (images only)</li>
<li>Multiple administrative users with varying rights</li>
<li>Password protection for gallery and albums</li>
<li>RSS for gallery, albums and comments (Media RSS support)</li>
</ul>
<h4>Supported media formats</h4>
<ul>
<li>Images: JPEG, GIF, PNG*</li>
<li>Video: Flash video (.flv)<em>**, </em>MPEG4 (.mp4)**, Quicktime (.mov)***, 3GP (.3gp)***</li>
<li>Audio: MP3 (.mp3)**</li>
</ul>
<p><small><em>*all formats the installed GDlibary supports<br />
** via standard plugins / ***  handled by your browser if available</em></small></p>
<ul><em></em></ul>
<h4>Extendable with plugins</h4>
<ul>
<li><a title="Zenpage - a CMS plugin for Zenphoto" href="../2009/03/zenpage-a-cms-plugin-for-zenphoto/">CMS plugin Zenpage</a> for managing an entire site with custom pages and news section (blog)</li>
<li>Slideshow</li>
<li>Image and album rating</li>
<li>Google maps</li>
<li>FLV player</li>
<li>Flowplayer3</li>
<li>and <a title="http://www.zenphoto.org/2008/06/zenphoto-plugins/" href="../2008/06/zenphoto-plugins/">here are some more plugins</a>!</li>
</ul>
<h4>Internationalization/localization</h4>
<ul>
<li>Admin backend fully translatable <em>(gettext server support required)</em></li>
<li>Multi-lingual site support</li>
</ul>
<h4>Highly customizable theme engine and framework</h4>
<ul>
<li>Predefined themes available<em> (four included standard)</em></li>
<li>Flexible to fit your personal needs <em>(XHTML, CSS, PHP knowledge required)</em></li>
</ul>
<p>Also visit  <a title="http://www.zenphoto.org/zp/showcase/" href="../zp/showcase/">showcase</a> to see what else you can do with Zenphoto!</p>
<h4>Other notable features</h4>
<ul>
<li>Search engine with boolean expressions</li>
<li>Comments with powerful spam filters</li>
<li>Watermarks for images</li>
<li>Cruft free, search engine friendly URLs with mod_rewrite</li>
<li>And many more!</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.zenphoto.org/2009/11/features/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Integrating Zenphoto into Wordpress Tutorials</title>
		<link>http://www.zenphoto.org/2009/11/wordpress-integration-tutorials/</link>
		<comments>http://www.zenphoto.org/2009/11/wordpress-integration-tutorials/#comments</comments>
		<pubDate>Sat, 14 Nov 2009 11:26:34 +0000</pubDate>
		<dc:creator>acrylian</dc:creator>
				<category><![CDATA[CMS integration]]></category>
		<category><![CDATA[Customizing]]></category>
		<category><![CDATA[FAQ]]></category>
		<category><![CDATA[Theming & Templating]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[User Guide]]></category>

		<guid isPermaLink="false">http://www.zenphoto.org/?p=1006</guid>
		<description><![CDATA[Integrating Zenphoto into Wordpress
Written by Steffen Rusitschka (ruzee)
This tutorial is already from 2006 but still applicable:
http://www.ruzee.com/blog/2006/06/integrating-zenphoto-into-wordpress
Eina Regilsson also provided some premade files based on this tutorial here: http://tech.einaregilsson.com/2007/08/06/integrating-zenphoto-into-wordpress/

Integrating Zenphoto and Wordpress
Written by Nate Nuzum
A zenphoto theme tutorial with the wordpress navigation:
http://www.natenewz.com/2009/10/13/integrating-zenphoto-and-wordpress/

Take also a look at Zenphoto as a &#8220;plugin&#8221;
]]></description>
			<content:encoded><![CDATA[<h4>Integrating Zenphoto into Wordpress</h4>
<p>Written by <a title="http://www.ruzee.com" href="http://www.ruzee.com">Steffen Rusitschka (ruzee)</a></p>
<p>This tutorial is already from 2006 but still applicable:<br />
<a title="http://www.ruzee.com/blog/2006/06/integrating-zenphoto-into-wordpress/" href="http://www.ruzee.com/blog/2006/06/integrating-zenphoto-into-wordpress/">http://www.ruzee.com/blog/2006/06/integrating-zenphoto-into-wordpress</a></p>
<p>Eina Regilsson also provided some premade files based on this tutorial here: <a title="http://tech.einaregilsson.com/2007/08/06/integrating-zenphoto-into-wordpress/" href="http://tech.einaregilsson.com/2007/08/06/integrating-zenphoto-into-wordpress/">http://tech.einaregilsson.com/2007/08/06/integrating-zenphoto-into-wordpress/</a></p>
<hr />
<h4>Integrating Zenphoto and Wordpress</h4>
<p>Written by <a title="http://www.natenewz.com" href="http://www.natenewz.com">Nate Nuzum</a></p>
<p>A zenphoto theme tutorial with the wordpress navigation:<br />
<a title="http://www.natenewz.com/2009/10/13/integrating-zenphoto-and-wordpress/" href="http://www.natenewz.com/2009/10/13/integrating-zenphoto-and-wordpress/">http://www.natenewz.com/2009/10/13/integrating-zenphoto-and-wordpress/</a></p>
<hr />
Take also a look at <a href="../2009/11/zenphoto-as-a-plug-in-using-zenphoto-functions-from-outside-zenphoto/">Zenphoto as a &#8220;plugin&#8221;</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.zenphoto.org/2009/11/wordpress-integration-tutorials/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Adding third party features to Zenphoto</title>
		<link>http://www.zenphoto.org/2009/11/adding-third-party-features-to-zenphoto/</link>
		<comments>http://www.zenphoto.org/2009/11/adding-third-party-features-to-zenphoto/#comments</comments>
		<pubDate>Tue, 03 Nov 2009 18:04:39 +0000</pubDate>
		<dc:creator>sbillard</dc:creator>
				<category><![CDATA[Customizing]]></category>
		<category><![CDATA[FAQ]]></category>
		<category><![CDATA[User Guide]]></category>

		<guid isPermaLink="false">http://www.zenphoto.org/?p=847</guid>
		<description><![CDATA[In addition to theming, Zenphoto has a plugin architecture that lets third party developers add capability to the Gallery. In addition many of the standard features can be enhanced by the addition of specific files. As from Zenphoto release 1.2.7 we have separated as much as possible the standard Zenphoto files and scripts from ones [...]]]></description>
			<content:encoded><![CDATA[<p>In addition to <a title="Zenphoto Theming tutorial" href="http://www.zenphoto.org/2009/03/theming-tutorial/">theming</a>, Zenphoto has a <a title="Zenphoto Plugin Architecture" href="http://www.zenphoto.org/2008/04/zenphoto-plugin-architecture/">plugin architecture </a>that lets third party developers add capability to the Gallery. In addition many of the standard features can be enhanced by the addition of specific files. As from Zenphoto release 1.2.7 we have separated as much as possible the standard Zenphoto files and scripts from ones that are otherwise provided.</p>
<p>As in the past, new themes can be added as folders in the root <em>themes</em> folder. With release 1.2.7 the <em>plugins</em> folder has been moved into the root. It is entirely for third party extensions to Zenphoto. Zenphoto standard plugins now reside in the <em>zp-core/zp-extensions</em> folder. You can now remove a few root files, the <em>zp-core</em> folder, and the theme folders of Zenphoto distributed themes prior to uploading a new version and insure that your new install will not contain any legacy Zenphoto scripts.</p>
<p>There are several folders included in the <em>plugins</em> folder for adding to Zenphoto standard features. These are:</p>
<ul>
<li><em>effenberger_effects</em> &#8212; the folder where the effenberger_effects plugin effects scripts are stored. (We have not provides these scripts based on licensing restrictions. You can download them and place them in this folder and they will be available to the plugin. See the plugin description for details.)</li>
<li><em>flvplayer</em> &#8212; Also due to licensing restrictions you will have to download the flvplayer support files and place them in this folder. (See the plugin description for details.)</li>
<li><em>gd_fonts</em> &#8212; <em>Captcha</em> and the <em>text-watermark</em> plugin can make use of custom fonts. You can add to the repetoir of fonts available by placing them in this folder. You can download gd_fonts from <a href="http://www.devtrolls.com/gdf_fonts/fonts.html">http://www.devtrolls.com/gdf_fonts/fonts.html</a></li>
<li><em>watermarks</em> &#8212; Place images you wish to use for watermarking in this folder.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.zenphoto.org/2009/11/adding-third-party-features-to-zenphoto/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Developer coding guidelines</title>
		<link>http://www.zenphoto.org/2009/06/developer-coding-guidelines/</link>
		<comments>http://www.zenphoto.org/2009/06/developer-coding-guidelines/#comments</comments>
		<pubDate>Wed, 17 Jun 2009 13:17:08 +0000</pubDate>
		<dc:creator>acrylian</dc:creator>
				<category><![CDATA[Customizing]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Theming & Templating]]></category>
		<category><![CDATA[User Guide]]></category>

		<guid isPermaLink="false">http://www.zenphoto.org/?p=602</guid>
		<description><![CDATA[
Coding style
Commenting and documentation
Nightly builds
Subversion (svn)

Coding Style
Zenphoto code follows some basic style guidelines. We essentially use the 1TBS variant of the K&#38;R notation C-code syntax, for example:
function foo($bar) {
 if ($bar == 2) {
   return $bar;
 } else if ($bar &#60; 2) {
   while($bar &#60; 2) {
     [...]]]></description>
			<content:encoded><![CDATA[<ol>
<li><a href="#codings-style">Coding style</a></li>
<li><a href="#commenting-and-documentation">Commenting and documentation</a></li>
<li><a href="#nightly-builds">Nightly builds</a></li>
<li><a href="#subversion">Subversion (svn)</a></li>
</ol>
<h4 id="Style"><a name="codings-style"></a>Coding Style</h4>
<p>Zenphoto code follows some basic style guidelines. We essentially use the <a title="http://en.wikipedia.org/wiki/Indent_style#Variant:_1TBS" href="http://en.wikipedia.org/wiki/Indent_style#Variant:_1TBS">1TBS variant of the </a><a class="ext-link" href="http://en.wikipedia.org/wiki/Indent_style#K.26R_style">K&amp;R notation C-code syntax</a>, for example:</p>
<pre>function foo($bar) {
 if ($bar == 2) {
   return $bar;
 } else if ($bar &lt; 2) {
   while($bar &lt; 2) {
     echo $bar;
     $bar++;
   }
 }
}</pre>
<p>This is a fairly standard formatting for PHP code and makes things nice and readable.</p>
<p>A few rules:</p>
<ul>
<li>Spaces should be used liberally. Eg: <tt>if($x == 2 || $y == 3)</tt> and <strong>not</strong> <tt>if($x==2||$y==3)</tt>.</li>
<li>Indentation should be hard tabs, not space-emulated tabs.</li>
<li>Always use variable and function names that make sense and are self explanatory. Eg: <tt>$album_name</tt> and <strong>not</strong> <tt>$n</tt></li>
<li><tt>$underscored_variable_names</tt> are preferred. Global variables should always be named like <tt>$_zp_something</tt></li>
<li><tt>camelCaseFunctionNames()</tt> are preferred. Example: <tt>printImageTitle()</tt></li>
<li>Try to make your function names &#8220;speaking&#8221;, so the name says what it generally does.</li>
<li>Function that just get data without printing should be prefixed with a &#8220;get&#8221; and function that echo something with &#8220;print&#8221;. Examples:
<ul>
<li><tt>getImageTitle()</tt>: gets the title to be passed to a variable for processing.</li>
<li><tt> printImageTitle()</tt>: echos the title directly.</li>
</ul>
</li>
<li>Don&#8217;t use PHP &#8220;short tags&#8221; like <tt>&lt;?</tt> in themes and plugins whereas the correct syntax shoud be <tt>&lt;?php</tt> as they may not be usable on certain strict PHP installations</li>
</ul>
<p>And a few guidelines for coding in general that we encourage:</p>
<ul>
<li>Use generalization and abstraction. DRY! (Don&#8217;t repeat yourself).</li>
<li>Keep it simple &#8211; if something seems too complex it probably is.</li>
<li>Keep efficiency in mind &#8211; try not to put filesystem operations in nested loops, for example.</li>
<li>Write clean code! Make things readable and understandable.</li>
<li>Comment your code so that others can understand it. Remember we are open source.</li>
</ul>
<h4><a name="commenting-and-documentation"></a>Commenting and Documentation</h4>
<p>Zenphoto uses PHPDoc to generate function and class documentation. This works well because the documentation is both in-line with the code, and browsable externally as a reference.</p>
<p>Zenphoto&#8217;s PHPDoc reference is <a href="http://www.zenphoto.org/documentation/">on the main zenphoto.org site</a>.</p>
<p>Instructions for how to form comments for functions and variables <a href="http://manual.phpdoc.org/HTMLSmartyConverter/HandS/phpDocumentor/tutorial_phpDocumentor.pkg.html">can be found on PHPDoc&#8217;s site here.</a> Or take a look at Zenphoto&#8217;s code for examples.</p>
<p>Also don&#8217;t forget to comment other parts outside the PHPdoc comment blocks if necessary.</p>
<h4><a name="nightly-builds"></a>Nightly Builds</h4>
<p>If you would like to simply test the development releases of Zenphoto between releases, you can use a nightly build. These are created from the current SVN trunk every 23:00 Pacific Standard Time.</p>
<p>The nightly builds are located at: <strong><a href="http://www.zenphoto.org/files/nightly">http://www.zenphoto.org/files/nightly</a></strong></p>
<p><strong>Warning:</strong> These packages <strong>may be unstable</strong> and haven&#8217;t necessarily been tested. Use them only if you wish to help test new features and give us feedback.</p>
<h4><a name="subversion"></a>Subversion (svn)</h4>
<p>Zenphoto uses Subversion for revision control, and we like it a lot. You can browse the repository by using the <a href="/trac/trac/browser">Trac source code browser</a>, which is very useful for seeing diffs and revisions in real time.</p>
<p>The SVN repository is located at: <strong><a href="http://www.zenphoto.org/svn">http://www.zenphoto.org/svn</a></strong></p>
<p>And the repository structure is fairly standard:</p>
<ul>
<li><tt>/trunk</tt> is the current version in development, where we do most of our work.</li>
<li><tt>/branches</tt> are versions with less stable code in heavy development, which may be later merged into trunk.</li>
<li><tt>/tags</tt> are snapshots of the trunk at any given time, usually all version releases, or pre-merge from a branch.</li>
</ul>
<p>If you want the &#8220;Latest SVN Code&#8221; to <em>work with</em>, you should &#8220;check out&#8221; the repository locally by running:</p>
<p>SVN checkout <a title="http://www.zenphoto.org/svn/trunk" href="http://www.zenphoto.org/svn/trunk">http://www.zenphoto.org/svn/trunk</a></p>
<p>If you just want to run the latest code without all the SVN metadata files, you should do an export:</p>
<pre>svn export http://www.zenphoto.org/svn/trunk zenphoto/</pre>
<p>And finally, if you&#8217;re going to be working with the SVN copy a lot, you should get a good SVN client for your operating system. We use these ourselves:</p>
<ul>
<li>Windows: <a href="http://tortoisesvn.tigris.org/">TortoiseSVN</a></li>
<li>Mac: <a href="http://code.google.com/p/svnx/">snvX</a></li>
</ul>
<p><strong>Recommended additional read:</strong> <a title="http://www.zenphoto.org/2009/11/general-contributor-guidelines/" href="http://www.zenphoto.org/2009/11/general-contributor-guidelines/">General contributor guidelines</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.zenphoto.org/2009/06/developer-coding-guidelines/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Troubleshooting Zenpage</title>
		<link>http://www.zenphoto.org/2009/03/troubleshooting-zenpage/</link>
		<comments>http://www.zenphoto.org/2009/03/troubleshooting-zenpage/#comments</comments>
		<pubDate>Mon, 02 Mar 2009 15:01:21 +0000</pubDate>
		<dc:creator>acrylian</dc:creator>
				<category><![CDATA[FAQ]]></category>
		<category><![CDATA[Troubleshooting]]></category>
		<category><![CDATA[User Guide]]></category>

		<guid isPermaLink="false">http://www.zenphoto.org/?p=212</guid>
		<description><![CDATA[
If I change the language in Zenphoto&#8217;s options Zenpage&#8217;s admin pages are still in english.
The zenpage theme is in english even if I change the language in Zenphoto&#8217;s options.
TinyMCE and/or the file manager are not translated.
Is it possible to configure TinyMCE differently?
Can I use another WSIWYG editor than TinyMCE?
Where does the file manger store uploaded [...]]]></description>
			<content:encoded><![CDATA[<ol>
<li><a href="#1">If I change the language in Zenphoto&#8217;s options Zenpage&#8217;s admin pages are still in english.</a></li>
<li><a href="#2">The zenpage theme is in english even if I change the language in Zenphoto&#8217;s options.</a></li>
<li><a href="#3">TinyMCE and/or the file manager are not translated.</a></li>
<li><a href="#5">Is it possible to configure TinyMCE differently?</a></li>
<li><a href="#6">Can I use another WSIWYG editor than TinyMCE?</a></li>
<li><a href="#7">Where does the file manger store uploaded files?</a></li>
<li><a href="#8">Is it possible to rename the &#8220;uploaded&#8221; folder and put it somewhere else?</a></li>
<li><a href="#9">On my pages/articles list on the admin some pages/articles are greyed out and I can&#8217;t edit them.</a></li>
<li><a href="#10">What is a permaTitleLink?</a></li>
<li><a href="#11">Why is there a check box for editing the Title Link? It seems editable even though the box is not checked.</a></li>
<li><a href="#12">Is it possible to extend Zenpage myself? </a></li>
<li><a href="#13">Can I change the names of the theme files pages.php and news.php?</a></li>
<li><a href="#14">The search does not work for articles and pages!</a></li>
<li><a href="#15">Can I use tags from Zenphoto on my news articles?</a></li>
<li><a href="#16">Where do I report bugs I find in Zenpage?</a></li>
<li><a title="#18" href="#18">How to assign a user to a page or article?</a></li>
<li><a title="#19" href="#19">How do I get images into my pages or news articles?</a></li>
<li><a title="#20" href="#20">How to change the upload file size limit for the File Manager?</a></li>
<li><a title="#21" href="#21">What is the CombiNews mode?</a></li>
<li><a title="#22" href="#22">I have added pages and articles but I don&#8217;t see them on my site!</a></li>
</ol>
<h4><a name="1"></a>If I change the language in Zenphoto&#8217;s options Zenpage&#8217;s admin pages are still in english.</h4>
<p>Zenpage&#8217;s is now an included fully official plugin and it&#8217;s translation is now included within the main Zenphoto translation file. However, the join is quite new so not all languages might have been updated to incude the Zenpage translation.<a title="http://www.zenphoto.org/2008/05/translating-tutorial/#plugin-translation" href="http://www.zenphoto.org/2008/05/translating-tutorial/#plugin-translation"></a></p>
<p>Of course you are welcome to provide a translation. Please read <a title="http://www.zenphoto.org/2008/05/translating-tutorial" href="http://www.zenphoto.org/2008/05/translating-tutorial">http://www.zenphoto.org/2008/05/translating-tutorial</a></p>
<h4><a name="2"></a>The zenpage theme is in english even if I change the language in Zenphoto&#8217;s options.</h4>
<p>Zenpage&#8217;s is now an included fully official plugin and it&#8217;s translation is now included within the main Zenphoto translation file. However, the join is quite new so not all languages might have been updated to incude the Zenpage translation.</p>
<p>Of course you are welcome to provide a translation. Please read <a title="http://www.zenphoto.org/2008/05/translating-tutorial" href="http://www.zenphoto.org/2008/05/translating-tutorial">http://www.zenphoto.org/2008/05/translating-tutorial</a></p>
<p><a name="3"></a></p>
<h4>TinyMCE and/or the file manager are not translated.</h4>
<p>TinyMCE and Ajax File Manager are third party solutions that use their own translation files and technique. There are already some languages preinstalled. These are bascially those that are currently completed or partly available for Zenphoto itself and listed here: <a title="http://www.zenphoto.org/trac/report/9" href="http://www.zenphoto.org/trac/report/9">http://www.zenphoto.org/trac/report/9</a> But you might want to check their own project sites for more or also updated translations:</p>
<ul>
<li>Ajax File Manger language packs: <a title="http://www.phpletter.com/Language-Packs-Download-Center/ " href="http://www.phpletter.com/Language-Packs-Download-Center/ ">http://www.phpletter.com/Language-Packs-Download-Center/ </a></li>
<li>TinyMCE language packs: <a title="http://services.moxiecode.com/i18n/" href="http://services.moxiecode.com/i18n/">http://services.moxiecode.com/i18n/</a></li>
</ul>
<h4><a name="5"></a>Is it possible to configure TinyMCE differently?</h4>
<p>Yes, of course. The file <tt>editor_config.js.php</tt> within the zenpage plugin folder contains the configuration code for TinyMCE. You will find all info about configuration options on the TinyMCE wiki:  <a title="http://wiki.moxiecode.com/index.php/TinyMCE:Index" href="http://wiki.moxiecode.com/index.php/TinyMCE:Index">http://wiki.moxiecode.com/index.php/TinyMCE:Index</a></p>
<h4><a name="6"></a>Can I use another WSIWYG editor than TinyMCE?</h4>
<p>Generally yes. The file <tt>editor_config.js.php</tt> within the zenpage plugin folder contains the configuration code for TinyMCE. This could possibly be replaced with configuration code for another editor but it has not been tried and is not supported.  Also the Ajax File Manager Zenpage uses may not work as a plugin with another editor. According to Ajax File Manger&#8217;s creator phpletter it is compatible with FCKeditor though.</p>
<h4><a name="7"></a>Where does the file manger store uploaded files?</h4>
<p>The files are stored within the folder <tt>uploaded</tt> that is located in the root folder of your Zenphoto installation and that is created while running Zenpage setup automatically.</p>
<h4><a name="8"></a>Is it possible to rename the &#8220;uploaded&#8221; folder and put it somewhere else?</h4>
<p>Yes, open <tt>plugins/tiny_mce/plugins/ajaxfilemanger/inc/config.base.php</tt> and in the lines 51 and 52 you find these lines:</p>
<pre>define('CONFIG_SYS_DEFAULT_PATH', '../../../../../uploaded/'); //accept relative path only
define('CONFIG_SYS_ROOT_PATH', '../../../../../uploaded/');	//accept relative path only</pre>
<p>Change the name and the path (must be relative paths!) as you like but remember this will be overwritten with every update.  It will not be made an option because the file manager is a third party product that gets updated itself so the modification of it is kept to a minimun to make updates easier.</p>
<h4><a name="9"></a>On my pages/articles list on the admin some pages/articles are greyed out and I can&#8217;t edit them.</h4>
<p>These pages/articles are locked by the original author or last author who edited them. Only that author&#8217;s user will be able to edit or unlock them or any user with full admin rights.</p>
<h4><a name="10"></a>What is a permaTitleLink?</h4>
<p>The <em>titlelink</em> is the URL name of a page/article/category that is automatically generated seo friendly when adding a page. This is basically the equivalent to Zenphoto&#8217;s album name and image file name and unique to that page/article/category even if using Zenphoto&#8217;s multilingual mode.<br />
If you don&#8217;t check the <em>permaTitlelink</em> option the <em>titlelink</em> will be newly generated everytime you change the title of a page/article/category. This can lead to broken links if someone or a search engine links to you. This concept is taken from Wordpress where it is called <em>permalink</em> (or <em>slug</em>). It is referred to that as <em>titlelink</em> in all functions so it is called that that here, too.</p>
<h4><a name="11"></a>Why is there a check box for editing the Titlelink? It seems editable even though the box is not checked.</h4>
<p>In case you are not satisfied with the automatic generation of the titlelink you can edit it. For example if you have a long title you might want to have a shorter url name or maybe the seo friendly generation cleared out something you want to be there, then you can edit it.<br />
Changes are only saved if you check the checkbox. If you checked the permaTitlelink option, checking the &#8220;edit titlelink&#8221; checkbox will override the permaTitlelink option.</p>
<h4><a name="12"></a>Is it possible to extend Zenpage myself?</h4>
<p>Zenpage is just a little more complex Zenphoto plugin, but just a plugin. This means you can write just another Zenphoto plugin or a theme custom function that uses Zenpage functions to provide custom functionality.  You only can extend the theme relevant part of Zenpage that way unless you want to hack the plugin itself. That of course is not recommended because of possible problems with further updates. If you have a suggestion please use the <a title="Zenphoto forums" href="http://www.zenphoto.org/support">Zenphoto forums</a>.</p>
<h4><a name="13"></a>Can I change the names of the theme files <em>pages.php</em> and <em>news.php</em>?</h4>
<p>Yes. First rename the files to what you like (don&#8217;t use special characters to be on the secure side), then enter these names including the .php suffixes on Zenpage&#8217;s plugin option for it. If you use mod_rewrite you have to adjust the rewrite rules to match the new names, too.</p>
<h4><a name="14"></a>The search does not work for articles and pages!</h4>
<p>Zenpage currently does not have search functionality except for the date archive. Maybe this will be added in a later version.</p>
<h4><a name="15"></a>Can I use tags from Zenphoto on my news articles?</h4>
<p>No, Zenpage does not have support for tags. You would have to use categories instead. Maybe this will be added in a later version.</p>
<h4><a name="16"></a>Where do I report bugs I find in Zenpage?</h4>
<p>Please use the <a title="Zenphoto bugtracker" href="http://www.zenphoto.org/trac/report/1">Zenphoto bugtracker</a> for that. Open a ticket and select the component <em>Zenpage</em> and report your problem.</p>
<h4><a name="18"></a>How to assign a user to a specific page or article?</h4>
<p>This is the way if you are the master admin and want to set up something for users with lower rights:</p>
<div>
<div>
<ol>
<li>Create a user with rights for one album and Zenpage rights.</li>
<li>Create a new page/article as master admin for that user.</li>
<li>Now select the user the page/article should belong to from the author dropdown.</li>
<li>Now set the page/article to <em>locked for changes</em> and save it. Then only admins with full admin rights or that user will be able to edit or delete that page. For all others the link and the icon buttons should be grayed out.</li>
</ol>
</div>
<p>Note that every user with Zenpage rights can set every page or article <em>locked for changes</em> himself that is not already <em>locked for changes</em>. It does not matter if he is the original author or not.</div>
<h4><a name="19"></a>How do I get images into my pages or news articles?</h4>
<p>There are now two ways:</p>
<ol>
<li>You can use  Phpletter&#8217;s Ajax File Manager  that is included as a TinyMCE plugin. That file manager is either accessible via the &#8220;Manage files&#8221; button on the main pages or main articles page or via the image button onTinyMCE tool bar. You can view some screenshots on how to use it here: <a title="http://www.zenphoto.org/zp/screenshots/zenpage-using-the-ajax-file-manager" href="http://www.zenphoto.org/zp/screenshots/zenpage-using-the-ajax-file-manager/Manage-files-only.jpg.php">How to use the file manager</a><br />
You can use this file manager to upload and manage many formats that Zenphoto itself does not support. Note that files you upload with this are placed within the uploaded folder and are independend from the normal albums. Visit also the site of the creators of this file manager: <a title="Phpletter" href="http://www.phpletter.com">www.phpletter.com</a>.</li>
<li>Also you can use <em>tinyZenpage</em> to access images, albums as well as pages, articles or news cateogries for including. Here are some <a title="http://www.zenphoto.org/zp/screenshots/zenpage-tinyzenpage" href="http://www.zenphoto.org/zp/screenshots/zenpage-tinyzenpage/start-page.jpg.php">tinyZenpage screenshots</a> about it and there is also some general info on the <a title="http://www.zenphoto.org/2009/03/zenpage-a-cms-plugin-for-zenphoto/" href="http://www.zenphoto.org/2009/03/zenpage-a-cms-plugin-for-zenphoto/">Zenpage plugin page</a>.<a title="tinyZenpage" href="http://zenpage.maltem.de/pages/tinyZenpage"></a></li>
</ol>
<h4><a name="20"></a>How to change the upload file size limit for the file manager?</h4>
<p>There is no option but you can change it directly in the file<br />
<tt>zp-core/plugins/tiny_mce/plugins/ajaxfilemanger/inc/config.base.php</tt> in line 70.</p>
<h4><a name="21"></a>What is the CombiNews mode?</h4>
<p>This mode shows the lastest gallery items like images incl. videos and audio or albums mixed within the news section as if they <em>were</em> news articles. The image/album title is shown as the title and the image/album description as the article content. There is of course also a RSS mode available for CombiNews (see the documentation).</p>
<p>Image and albums and articles are still independend and nothing is changed on your site, except the display. You can use this to easily setup a photoblog or audio/podcast blog for example.<br />
<a title="http://zenpage-demo.maltem.de/" href="http://zenpage-demo.maltem.de/">View a live demo here</a></p>
<h4><a name="22">I have added pages and articles but I don&#8217;t see them on my site!</a></h4>
<p>A theme with Zenpage support is required to see them. Themes with Zenpage support are currently:</p>
<ul>
<li><a title="http://www.zenphoto.org/zp/theme/zenpage-default/Image.jpg.php" href="http://www.zenphoto.org/zp/theme/zenpage-default/Image.jpg.php">Zenpage-default</a> (official and included)</li>
<li><a title="http://www.zenphoto.org/zp/theme/effervescenceplus/index_blueandgreen.png.php" href="http://www.zenphoto.org/zp/theme/effervescenceplus/index_blueandgreen.png.php">effervescence+</a> (official and included)</li>
<li><a title="http://www.zenphoto.org/zp/theme/zpfocus/zpfocus-index.jpg.php" href="http://www.zenphoto.org/zp/theme/zpfocus/zpfocus-index.jpg.php">zpfocus</a> (third party)</li>
</ul>
<p>Of course you can setup any theme with Zenpage support yourself. Read on the <a title="http://www.zenphoto.org/2009/03/theming-tutorial/" href="http://www.zenphoto.org/2009/03/theming-tutorial/">theming tutorial</a> how to do it.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.zenphoto.org/2009/03/troubleshooting-zenpage/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Troubleshooting Zenphoto</title>
		<link>http://www.zenphoto.org/2009/03/troubleshooting-zenphoto/</link>
		<comments>http://www.zenphoto.org/2009/03/troubleshooting-zenphoto/#comments</comments>
		<pubDate>Mon, 02 Mar 2009 06:00:41 +0000</pubDate>
		<dc:creator>acrylian</dc:creator>
				<category><![CDATA[FAQ]]></category>
		<category><![CDATA[Troubleshooting]]></category>
		<category><![CDATA[User Guide]]></category>

		<guid isPermaLink="false">http://www.zenphoto.org/blog/2007/12/troubleshooting-zenphoto/</guid>
		<description><![CDATA[For common used terms please also read the Zenphoto glossary.

I&#8217;m having a problem installing, what should I check first?
I have problems installing Zenphoto on Dreamhost
When I have a problem with Zenphoto, where can I get help?
My pictures are in /zenphoto/albums/MyAlbum but the URL says /zenphoto/MyAlbum! It’s wrong!
What is mod_rewrite and how does it work?
My host [...]]]></description>
			<content:encoded><![CDATA[<p>For common used terms please also read the <a title="http://www.zenphoto.org/2008/08/zenphoto-glossary/" href="http://www.zenphoto.org/2008/08/zenphoto-glossary/">Zenphoto glossary</a>.</p>
<ol>
<li><a href="#1">I&#8217;m having a problem installing, what should I check first?</a></li>
<li><a href="#2">I have problems installing Zenphoto on Dreamhost</a></li>
<li><a href="#3">When I have a problem with Zenphoto, where can I get help?</a></li>
<li><a href="#4">My pictures are in /zenphoto/albums/MyAlbum but the URL says /zenphoto/MyAlbum! It’s wrong!</a></li>
<li><a href="#5">What is mod_rewrite and how does it work?</a></li>
<li><a href="#6">My host is 1&amp;1, and I dont have thumbnails</a></li>
<li><a href="#7">How do I enable mod_rewrite?</a></li>
<li><a href="#8">I think I found a bug! What do I do?</a></li>
<li><a href="#9">Someone’s asking for a PHPInfo(), what is that?</a></li>
<li><a href="#10">Help! My images aren’t displaying after installation and setup!</a></li>
<li><a href="#11">Why are some thumbnails/sized images not generated? Why does Zenphoto make my server crash while processing images?<br />
</a></li>
<li><a href="#12">I have set my Album to not published (my images to not visible) but they still show up when I view my gallery.</a></li>
<li><a href="#13">I have password protected my album but I can still view it without entering the password.</a></li>
<li><a href="#14">I don’t have any items in my Theme Colors (Spam Filter, Watermark) dropdown list</a></li>
<li><a href="#15">When I click on “Gallery” the directory structure is shown</a></li>
<li><a href="#16">I forgot my admin password, now what do I do?</a></li>
<li><a href="#17">Is it possible to administrate images hosted on another server?</a></li>
<li><a href="#18">Why does deleting of an album via the admin interface fail?</a></li>
<li><a href="#19">Why does Zenphoto not show a thumbnail from my video?</a></li>
<li><a href="#20">The number of thumbnails on my theme&#8217;s album view does not match my setting</a></li>
<li><a href="#21">I have just installed version 1.1.7 and I cannot change the language</a></li>
<li><a href="#22">Is it really necessary to pre-cache my images at all?</a></li>
<li><a href="#23">Is there any limit to the number of images?</a></li>
<li><a href="#24">I am having difficulties with zenphoto language translations.</a></li>
<li><a href="#25">Some of my Images aren&#8217;t loading and/or pre-cache doesn&#8217;t work.</a></li>
<li><a href="#26">What is magic_quotes_gpc and why should it be disabled?</a></li>
<li><a href="#27">I am having probems with album sorting?</a></li>
<li><a href="#28">I am having probems albums (images) witth accented characters in their names?</a></li>
<li><a href="#29">Setting permissions for Zenphoto files and folders</a></li>
<li><a href="#30">Is it possible to remove the filename extension from image names in the URL?</a></li>
<li><a href="#31">I did enable a plugin but why I don&#8217;t see anything of its features on my gallery?</a></li>
<li><a href="#32">Can I integrate Zenphoto with Wordpress or another CMS?</a></li>
<li><a href="#33">Can I extend the functionality of Zenphoto myself?</a></li>
<li><a href="#34">Does Zenphoto work with PHP Safe Mode?</a></li>
<li><a href="#35">Is it possible to configure TinyMCE differently?</a></li>
<li><a href="#36">I have moved my zenphoto installation on my server and now all urls are wrong!</a></li>
<li><a href="#37">I have enabled comments on the gallery options and for each image and album but there is no comment form showing up on my theme!</a></li>
<li><a href="#38">Is it possible to manage youtube videos (or from another portal)?</a></li>
<li><a href="#39">How to protect my images from hotlinking?</a></li>
<li><a href="#40">How to move my installation to a new server?</a></li>
<li><a href="#41">Can I just use specific files of a nightly build or svn version to fix a problem in a stable release?</a></li>
<li><a href="#42">Opening full images using Thickbox or any other JavaScript &#8220;box&#8221; script does not work</a></li>
<li><a href="#43">I have problems installing or upgrading using SimpleScripts</a></li>
<li><a href="#44">How do I disable the right click button to protect my image against downloading?</a></li>
<li><a href="#45">Why is the image rotate button grayed out?</a></li>
</ol>
<h4><a name="1"></a>I&#8217;m having a problem installing, what should I check first?</h4>
<p>Make sure you&#8217;ve:</p>
<ol>
<li>Downloaded files for latest zenphoto release.</li>
<li>Uploaded everything to your web server (including .htaccess file in root zenphoto directory)</li>
<li>Visit your gallelry. Setup will run and show you a system check status.</li>
<li>Correct any issues indicated.</li>
<li>Press the GO button.</li>
<li>Upload the pictures you want into your albums directory, and organize them how you wish in folders and subfolders (zenphoto will currently only handle the subalbums if you&#8217;re using the subalbums testing-dev theme)</li>
</ol>
<p>If you need more help, go to the <a class="wiki" href="http://www.zenphoto.org/support">Zenphoto Forums</a>.</p>
<h4><a name="2"></a>I have problems installing Zenphoto on Dreamhost</h4>
<p>A tutorial by our user bensp: <a title="Dreamhost Installation" href="http://www.zenphoto.org/support/topic.php?id=316&amp;replies=31">http://www.zenphoto.org/support/topic.php?id=316&amp;replies=31</a></p>
<h4><a name="3"></a>When I have a problem with Zenphoto, where can I get help?</h4>
<p>Keep reading this page, or go straight to the <a href="http://www.zenphoto.org/support">Support Forums</a>.</p>
<h4><a name="4"></a>My pictures are in <tt>/zenphoto/albums/MyAlbum</tt> but the URL says <tt>/zenphoto/MyAlbum</tt>! It&#8217;s wrong!</h4>
<p>No, it&#8217;s not! <strong>The URLs are correct</strong> as Zenphoto makes them. They aren&#8217;t supposed to have <tt>albums</tt> in them because they aren&#8217;t pointing to the folder! They&#8217;re <strong>rewritten</strong> by the Apache module <tt>mod_rewrite</tt>, which translates URLs into script arguments, in this case, inputs to zenphoto. Read the next question to find out how this works.</p>
<h4><a name="5"></a>What is mod_rewrite and how does it work?</h4>
<p><strong>mod_rewrite</strong> is an Apache module for translating URLs. In zenphoto with mod_rewrite enabled, <tt>http://www.zenphoto.org/zenphoto/impressionists/</tt> is the URL you see (even though the album is stored at <tt>/zenphoto/albums/impressionists</tt> on the server &#8212; the two are related, but not the same). Then, <tt>mod_rewrite</tt> translates the requested <tt>/zenphoto/impressionists</tt> into <strong><tt>/zenphoto/index.php?album=impressionists</tt></strong>! They&#8217;re the same! The first URL, which looks like paths to a folder, is called &#8220;pretty&#8221; or &#8220;cruft-free&#8221;, because it&#8217;s user-friendly and easy to remember. Pretty cool huh?</p>
<p>If you get &#8220;404 &#8211; Page Not Found&#8221; errors and images that don&#8217;t show up, you probably have told zenphoto to use <tt>mod_rewrite</tt>, but you don&#8217;t have it enabled on your server. You should set the configuration option <tt>mod_rewrite </tt>to false. Logon to <strong>Admin</strong>, click on the <em>Options</em> tab then the <em>Gallery configuration</em> tab. Uncheck the box for <em>Enable mod_rewrite</em> and press the <em>save</em> button<em>.</em> Or you can read the next question to see how to turn it on.</p>
<h4><a name="6"></a>I have problems installing Zenphoto on 1&amp;1</h4>
<p>If you don&#8217;t have thumbnails you will need to open up the .htaccess file and add the following line to it if you are running php4.</p>
<pre class="wiki">AddType x-mapp-php5 .php
</pre>
<p>For further issues please take a look at this tutorial:<br />
<a title="http://www.cyberward.net/blog/2009/05/installing-zenphoto-on-1and1/" href="http://www.cyberward.net/blog/2009/05/installing-zenphoto-on-1and1/">http://www.cyberward.net/blog/2009/05/installing-zenphoto-on-1and1/</a></p>
<h4><a name="7"></a>How do I enable mod_rewrite?</h4>
<p>mod_rewrite is an <strong>Apache module</strong>, so it requires Apache. If you&#8217;re on a shared web host, you&#8217;ll have to e-mail them and ask for it. Most large web hosts that use Apache will have it enabled already, but yours may not, it&#8217;s not uncommon. When the apache module mod_rewrite is not loaded, you can´t use mod_rewrite within your ZenPhoto configuration. Via phpinfo() you can look to see if mod_rewrite is listed as loaded module. If is not, you can load it by open the httpd.conf of your apache and uncomment (delete the leading #) or add this line:<br />
<tt>LoadModule rewrite_module modules/mod_rewrite.so</tt></p>
<p>Secondly, you need have the correct<tt>.htaccess</tt> file in your zenphoto installation. If you have copied the one from the distribution, <em>Setup</em> will have updated it to your configuration. Otherwise, make sure the <tt>RewriteBase</tt> line is correct. It should be the URL to your zenphoto after the domain name. For example, the <tt>RewriteBase</tt> for <tt>http://www.zenphoto.org/zenphoto</tt> looks like <tt>RewriteBase /zenphoto</tt> .</p>
<p>Third, you need to make sure mod_rewrite option is enabled (see the last question.)</p>
<h4><a name="8"></a>I think I found a bug! What do I do?</h4>
<p>If you think you&#8217;ve found a bug, first check for a new version and upgrade if you find one. If that doesn&#8217;t fix the problem, then <a href="http://www.zenphoto.org/trac/search">search for the bug</a>, <a href="http://www.zenphoto.org/trac/report">look for a similar bug</a>, and if you still think we don&#8217;t know about it, submit a ticket on <a href="http://www.zenphoto.org/trac/">Trac</a>! (Note: you must register to see the new ticket link.) Be as thorough as possible and include your server configuration (Apache version, PHP version, etc.) and a detailed description. Also include a URL to your site, preferably the link that shows the problem. We can do a much better job of helping you if we can see what is going on.</p>
<h4><a name="9"></a>Someone&#8217;s asking for a PHPInfo(), what is that?</h4>
<p>PHPInfo() is a method by which you can get a HTML (browser-based) report on your version of PHP which is installed on your webserver, and also any information about installed modules relating to your ISP or webhost configuration of PHP. It provides very useful information for supporting zenphoto, as it will help us to determine vital information about your server.</p>
<p>This is how you can display your PHPinfo():</p>
<ol>
<li>Open a new text document in your favorite text editor.</li>
<li>Add the following line to the document: &lt;? phpinfo(); ?&gt;</li>
<li>Save the document as phpinfo.php and upload it to your webserver in an web-accessible location.</li>
<li>Execute the document by pointing your browser to the file (e.g. <a class="ext-link" href="http://www.yourhost.com/locationoffile/phpinfo.php"><span class="icon">http://www.yourhost.com/locationoffile/phpinfo.php</span></a></li>
</ol>
<p>This will output a large amount of very useful information for you to peruse. You can provide this link to the support forum as a means to help us troubleshoot your configuration. You should delete the file once the issue has been resolved just to be safe.</p>
<h4><a name="10"></a>Help! My images aren&#8217;t displaying after installation and setup!</h4>
<p>There are a number of reasons why you photos might not display after installation and setup.</p>
<ol>
<li>You may need to check your permissions on your albums directory and cache directory. The permissions should be 777 to allow Zenphoto to display everything properly.</li>
<li>It could be that PHP Safe Mode is enabled. Your ISP will need to help you with this configuration. You can obtain more information in the FAQ item entitled &#8220;What is PHP Safe Mode?&#8221;</li>
<li>Check your .htaccess file if you&#8217;re using Apache, and make sure you have the correct path for the <tt>RewriteBase</tt> line at the top. If you&#8217;re not using Apache or it doesn&#8217;t seem to be working, reset your <tt>mod_rewrite </tt>option.</li>
<li>Search the <a class="wiki" href="http://www.zenphoto.org/support">ZenphotoForums</a> for help, or start a new topic there. Zenphoto has a very helpful community, so don&#8217;t be shy!</li>
</ol>
<h4><a name="11"></a>Why are some of my thumbnails/sized images not generated?  Why does Zenphoto make my server crash while processing images?</h4>
<p>If you&#8217;re running a web server on a VPS or other resource-limited environment, then you might not have enough memory available to the server to process very large images. You can use the following table as a guideline to see how much memory you need available to process images of different sizes:</p>
<ul>
<li>VGA Image, 640 x 480 pixels =&gt; needs ~4.1 MB Memory</li>
<li>SVGA Image, 800 x 600 pixels =&gt; needs ~4.8 MB Memory</li>
<li>1 MP Image, 1024 x 798 pixels =&gt; needs ~6.3 MB Memory</li>
<li>2 MP Image, 1600 x 1200 pixels =&gt; needs ~11.7 MB Memory</li>
<li>6 MP Image, 2816 x 2112 pixels =&gt; needs ~22.6 MB Memory</li>
<li>8.2 MP Image, 3571 x 2302 pixels =&gt; needs ~41.7 MB Memory</li>
</ul>
<p>As you can see, the 8.2-Megapixel 3571&#215;2302 image requires a very large amount of memory to process, and that&#8217;s simply because of the number of pixels. It doesn&#8217;t matter if the image is only 2 or 3 megabytes when compressed in JPEG form, or what colors the image contains or anything&#8211; it&#8217;s just how big it is, because all of those pixels have to have a place in memory while the GD library processes them. There&#8217;s no way around it!</p>
<p>Another problem is that browsers often make two requests per server at the same time to speed up image loading. This is perfectly normal, but if two requests for that 8-megapixel image are made and both need processing, then the memory requirement is doubled. The only way around this is to limit the number of requests your browser makes. In Firefox, this can be done by going to <tt>about:config</tt> as the URL and searching for the <tt>network.http.max-persistent-connections-per-server</tt> option and setting it to 1.</p>
<p>In future versions of Zenphoto, ImageMagick may be an optional image processor, which may require less memory, and at least won&#8217;t share memory with Apache.</p>
<h4><a name="25"></a>Some of my Images aren&#8217;t loading and/or pre-cache doesn&#8217;t work.</h4>
<p>There could be many reasons for this, so the best way to diagnose this problem is to view the actual image error itself. You can do this by adding &#8216;&amp;debug&#8217; to the image URL zenphoto uses to process the image. To do that, locate the failed image in your gallery (it should show just the filename with a box around it, in place of the image), then right-click it and choose &#8216;Copy Image Location&#8217; (Firefox; in IE, choose &#8216;properties&#8217; and copy the image URL from there). Then, paste that URL into your address bar, and at the end of it, type &#8220;&amp;debug&#8221; without quotes. Press enter to see the image processor&#8217;s error message. If you need help diagnosing it, feel free to post on the support forums.</p>
<h4><a name="12"></a>I have set my Album to not published (my images to not visible) but they still show up when I view my gallery.</h4>
<p>If you are logged in as the administrator all albums and images are visible so that you can edit, delete, etc. them. Log out and they should become invisible.</p>
<h4><a name="13"></a>I have password protected my album but I can still view it without entering the password.</h4>
<p>There are three things that might be happening here:</p>
<ol>
<li>You are logged in as the administrator. Administrators are allowed to view any album, password protected or not.</li>
<li>You have logged into the album at sometime in the past. Album passwords are remembered in cookies so that vieweres do not have to log in at each page display.</li>
<li>If you are viewing an image page of a gallery that was not part of the zenphoto distribution it may not have implemented password protection. It is necessary for all image.php pages to use <code>checkforPassword()</code> to protect elements that you do not want displayed if the viewer has not logged in.</li>
</ol>
<h4><a name="14"></a>I don&#8217;t have any items in my Theme Colors (Spam Filter, Watermark) dropdown list</h4>
<p>Check your CGI log. You will probably find that the PHP glob() function has been disabled. Zenphoto uses this function in multiple places. But, don&#8217;t pannic. There is a define at the front of functions.php which you can change to enable replacement code for this function. Find the line <code>define('SAFE_GLOB', false');</code> in functions.php and change the <code>false</code> to <code>true</code>.</p>
<h4><a name="15"></a>When I click on &#8220;Gallery&#8221; the directory structure is shown</h4>
<p>Clearly the problem is that index.php isn&#8217;t set as a default file for directories under Apache (or whichever server you&#8217;re using).</p>
<p>If it&#8217;s Apache and you have access to your server&#8217;s main Apache config file, you need to edit your apache.conf or httpd.conf and find the DirectoryIndex line. It should read:<br />
<tt>DirectoryIndex index.html index.htm default.html</tt> or something similar.<br />
Change it to:<br />
<tt>DirectoryIndex index.html index.htm default.html index.php</tt> and whichever other directory default files you want, but definitely add the index.php to that line <img src='http://www.zenphoto.org/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  That should do it.<br />
Read more here&#8230;<br />
<a title="http://httpd.apache.org/docs/2.0/mod/mod_dir.html" href="http://httpd.apache.org/docs/2.0/mod/mod_dir.html">http://httpd.apache.org/docs/2.0/mod/mod_dir.html</a></p>
<p>or</p>
<p>If you have no access to the main config file, create a file called index.html (This is the file that Apache looks for (This is set up in http.conf)) and write a redirect code to point to the index.php file.</p>
<h4><a name="16"></a>I forgot my admin password, now what do I do?</h4>
<p>If you supplied an email address in the Admin options there should be a Captcha string image on the log-on page. Entering that string as the log-on password will email you a link to reset your password. If the Captcha is not there, or if you don&#8217;t get the email, you need to delete some database items.</p>
<p>Delete the Administrators table. You may also have to delete the rows of the Option table where the name field is <code>adminuser</code> and <code>adminpass</code> if they exist in your installation. Run setup to recreate the table. You will be prompted to enter a new admin user name and password. Now be sure there is an email address to send the reset link the next time!</p>
<h4><a name="17"></a>Is it possible to administrate images hosted on another server?</h4>
<p>Zenphoto unfortunately does not support this. Zenphoto must be installed on the same server as the photos it is hosting. This is what we recommend.<br />
Even if this was possible, it would be very slow as Zenphoto is filesystem-based and uses many filesystem operations, and doing that over a network would slow things down significantly.</p>
<h4><a name="18"></a>Why does deleting of an album via the admin interface fail?</h4>
<p>This may be caused by some files within the folder of that album that should not be there like for example the hidden/invisible .DS_Store files the finder of Mac OS X creates. They may be transfered with upload folders or archives. You would have to delete these files directly via ftp. Best is to avoid uploading them in the first place.</p>
<h4><a name="19"></a>Why does Zenphoto not show a thumbnail from my video?</h4>
<p>Zenphoto is not able to generate thumbnails from videos and shows therefore a default replacement image. There is no way at all to do this automatically with PHP without installing a extension on your server itelf.<br />
But you can do it manually: Make a screenshot from your movie and put the image named as the movie (for example: movie named <em>movie.flv</em>, image named <em>movie.jpg </em>— lower case suffixes are required!) into the album folder where your movie is located.</p>
<h4><a name="20"></a>The number of thumbnails on theme&#8217;s album view does not match my setting</h4>
<p>Please see the explanation here in our functions guide: <a title="http://www.zenphoto.org/documentation/functions/_template-functions.php.html#functionnormalizeColumns" href="http://www.zenphoto.org/documentation/functions/_template-functions.php.html#functionnormalizeColumns">normalizeColumns</a></p>
<h4><a name="21"></a>I have just installed version 1.1.7 and I cannot change the language</h4>
<p>There is a problem with the 1.1.7 release that occurs on virgin installations or upgrades from releases prior to version 1.1.6. It may not be possible to change the language from HTTP Accept Language. To correct this, make a file named fixlocale.php and insert the following code:<br />
<code><br />
&lt;?php<br />
require_once('template-functions.php');<br />
query("INSERT INTO " . prefix('options') . " (name, value, ownerid) VALUES ('locale','en_US', 0)");<br />
?&gt;<br />
</code></p>
<p>place this file in your zp-core folder then browse to it. Once the script has run you will be able to change to the language of your choice. This problem is also corrected in the nightly builds.</p>
<h4><a name="22"></a>Is it really necessary to pre-cache my images at all?</h4>
<p>Zenphoto was designed to lazy-load images to allow a gallery of unlimited size while still allowing viewing any image at any time regardless of whether it has been processed or not. It does it on the fly. It was not designed to process them all at once, the pre-caching was a hack that was added on later. The following diagram shows the process:</p>
<p><a href="http://www.zenphoto.org/wp-content/uploads/2008/09/zenphoto-12-image-discovery12.jpg"><img class="alignnone size-thumbnail wp-image-150" title="zenphoto-12-image-discovery12" src="http://www.zenphoto.org/wp-content/uploads/2008/09/zenphoto-12-image-discovery12-150x150.jpg" alt="" width="150" height="150" /></a></p>
<p>Better to leave them be, let the gallery work as it is, and process them when they&#8217;re first requested. For users, this will mean a very slight delay the first time an image is *ever* viewed, and absolutely none after that. This is how Zenphoto is designed to work, and we think how it works best. No need to pre-cache anything, just quit worrying about the initial lag from the first processing, it only happens once.</p>
<h4><a name="23"></a>Is there any limit to the number of images?</h4>
<p>Nope, there are no limits to the number of images Zenphoto can display in a gallery or album. Zenphoto is file system based and unique in that it scales relatively well due to its simple design. The speed of the gallery is dependent on a few minor things, namely the number of images in any given album.<br />
Zenphoto should be able to handle any number of images in the entire gallery – it will help greatly with performance if they are separated into smaller albums. Even then, single albums with 2000+ photos are possible and will still be usable.</p>
<p>If you&#8217;re having trouble with the speed of large galleries, try using the static_html_cache plugin to cache Zenphoto pages. Frequently loaded pages will be much faster.</p>
<h4><a name="24"></a>I am having difficulties with zenphoto language translations.</h4>
<p>There are several problems you might be having with language translations:</p>
<ol>
<li><strong>There is no language selection for my desiered language</strong>.<br />
Zenphoto relies on volunteers to translate each release. We have a large number of dedicated individuals making translations. There may be a translation for your language which was not avaiable in time for the zenphoto release. You can check by reviewing the <a href="http://www.zenphoto.org/trac/report/9">language tickets on TRAC</a>. If you language does not have a ticket, consider volunteering to produce it. For details see our <a href="http://www.zenphoto.org/2008/05/translating-tutorial/">translation tutorial</a>.</li>
<li><strong>There are phrases which are displayed in English even though I have selected a different language</strong>.<br />
Zenphoto is an ever evolving software. We will occasionally include a translation that is not 100% complete feeling that something is better than nothing. Check the <a href="http://www.zenphoto.org/trac/report/9">language tickets on TRAC</a> to see if there is an update for your language. If that does not resolve the issue, post a note on the ticket indicating what revision of zenphoto your are running and phrases which are displaying in English. (It will also help if you indicate where you see them, eg. the <em>Stopdesign</em> image page, the <em>admin</em> theme tab.)</li>
<li><strong>When I select my language I get an error saying that the locale is not supported on my server</strong>.<br />
Language support requires two capabilities in addition to #1 above. First the server running your site must have support installed for the <em>locale</em> associated with your language. (See #4 for the second capability.) If you are getting an error when selecting a language saying that it is not supported on the server you will have to contact your provider to get the server updated with the necessary language support. You can get a list of <em>locales</em> your server supports by running the <a href="http://www.zenphoto.org/wp-content/uploads/2008/08/list_locales.zip">list_locales</a> script. For further information on <em>locales</em> see <a href="http://www.linux.com/feature/53781">Controlling your locale with environment variables</a> and <a href="http://herkules.oulu.fi/z3950/Locales">Locales mini-HOWTO.</a>You can also look at the output of the list_locales script to see if there is an alternative language that fits your needs. For instance, if Zenphoto supplies a Spanish (Latin America) tranlsation But your server does not support it. Maybe your server supports Spanish (Bolivia). You could rename the es_LA folder to es_BO and get the translations.</li>
<li><strong>Even though support for my language exists, I am getting only English text.</strong><br />
Zenphoto uses a PHP feature named <em>gettext()</em> to support translations. If you are getting a notice from setup.php that PHP <em>gettext()</em> support is not installed all text will be displayed in English no matter which language you have selected. We hope in the future to have a replacement library to provide translations for installations with no <em>gettext()</em> support. Until then you will have to arrange with your ISP for gettext to be installed.</li>
<li><strong>I have selected HTTP Accept Language on the admin gallery configuration tab but I am not seeing text in my language.<br />
</strong>Your browser must specify your preferred language. To see what is being reported as your preferred languages run the <a href="http://www.zenphoto.org/wp-content/uploads/2008/08/list_locales.zip">list_locales</a> script. (Also see #3 and #4 above.</li>
</ol>
<h4><a name="26"></a>What is magic_quotes_gpc and why should it be disabled?</h4>
<p>To quote from the PHP manual itself:</p>
<p><strong>Warning This feature has been </strong><strong>DEPRECATED and </strong><strong>REMOVED as of PHP 6.0.0. Relying on this feature is highly discouraged.</strong></p>
<p><strong>magic_quotes_gpc</strong> is an early functionality of PHP that was ill-conceived and has been a great burden to developers, as well as end users ever since it&#8217;s inception. It encourages sloppy code and consumes valuable resources when it is enabled.</p>
<p>You can disable <strong>magic_quotes_gpc</strong> by editing your PHP.ini file. Change the line <code>magic_quotes_gpc = On</code> to <code>magic_quotes_gpc = Off</code> You can also disable <strong>magic_quotes_gpc</strong> in your zenphoto .htaccess file by adding the line <code>php_value magic_quotes_gpc off</code> Please contact your hosting provider for further assistance.</p>
<h4><a name="27"></a>I am having trouble with album sorting</h4>
<p>If you have used either the move album or the copy album feature introduced in zenphoto version 1.2 you may be have some albums which do not have the proper <em>parentid</em>. You can run the <a href="http://www.zenphoto.org/wp-content/uploads/2008/09/parentid_check.zip">parentid_check</a> script to check for an fix any problems with <em>parentid</em>&#8217;s. The script should be placed in your <em>zp-core</em> folder. A fix for the orginal problem was made to the nightly builds and included in the 1.2.1 release; however, any move or copy done before the fix was made will result in albums that need this correction.</p>
<h4><a name="28"></a>I am having trouble with album (images) with accented characters in their names</h4>
<p>It is best you avoid using accented characters in your file or folder names. it is really unnecessary to have them in file/folder names since you can edit the title to use whatever characters you like. Your site viewers see the Title, not the file/folder name.</p>
<p>The technical explaination is that zenphoto stores its data in <em>UTF-8</em> format in the database. But your files ystem probably uses some other character set, most likely ISO-8859-1. So when zenphoto gets the name of the image (filename) or the album (folder name) the character set of that string will not be <em>UTF-8</em>. This is OK so long as the string also does not contain any characters which are invalid in <em>UTF-8</em>. Unfortunately many accented characters from ISO-8859-1 are not valid when interpreted in <em>UTF-8</em> so when the string is stored into the database <em>MySQL</em> truncates it at the first non <em>UTF-8</em> character.</p>
<p>Current versions of Zenphoto will handle conversion of file system character strings to UTF-8 representation. However Zenphoto assumes that the filesystem characterset is ISO-8859-1, so if yours is in some other character set, things still will not work. Another player in  this drama is the character set assumed for Image URIs. Most servers seem to use ISO-859-1 even though the page claims to be in UTF-8. If your server actually assumes UTF-8 for these, you need to change the <tt>UTF8 image URIs </tt>option on the gallary configuration tab.</p>
<h4><a name="29"></a>Permissions for Zenphoto files and folders</h4>
<p>Zenphoto defaults the permissions for files and folders to 0777. The reason we recommend is that on most hosting environments, you cannot change the group or owner of the files.</p>
<p>Ideally, it should be set up with 0644 files/0755 directories ([rw-r--r--] files and [rwxr-xr-x] directories) permissions, with [youruser:webservergroup] ownership. If you can do that, we highly recommend it.  The idea is basically to keep ownership of the files yourself, give group access to the web server, and shut everyone else out.</p>
<p>NOTE: As from Zenphoto release 1.2.4 you can alter these defaults from the setup program. See the <em>Strict Permissions</em> entry. Starting with release 1.2.7 Setup will attempt to modify the permissions on its files and folders. However, if it is unable to do this you will have to manage the permissions manually.</p>
<h4><a name="30"></a>Is it possible to remove the filename extension from image names in the URL?</h4>
<p>No, the unique identifier to find the photo requested is the actual filename, and the only way to get that is from the URL, so it must contain the filename. That&#8217;s just how ZP works, it&#8217;s filesystem-based. The titles are rather stored in the database as metadata, which you can&#8217;t use to get a photo and doesn&#8217;t need to be unique. Take a look at this diagram to learn how Zenphoto discovers images.</p>
<p><a href="http://www.zenphoto.org/wp-content/uploads/2008/09/zenphoto-12-image-discovery12.jpg"><img class="alignnone size-thumbnail wp-image-150" title="zenphoto-12-image-discovery12" src="http://www.zenphoto.org/wp-content/uploads/2008/09/zenphoto-12-image-discovery12-150x150.jpg" alt="" width="150" height="150" /></a></p>
<h4><a name="31"></a>I did enable a plugin but why I don&#8217;t see anything of its features on my gallery?</h4>
<p>We did not setup all standard theme with all plugin feature because they are optional. On our themes page your can see what standard theme supports which plugins.</p>
<p>This means &lt;ou have to add some of them to your theme files yourself. This is generally very easy as it is mostly just adding one extra function where you want the plugin&#8217;s feature to be visible. Please refer to these text to learn how to do that:</p>
<ul>
<li><a title="http://www.zenphoto.org/documentation/index.html" href="http://www.zenphoto.org/documentation/index.html">Zenphoto functions documentation</a></li>
<li><a title="http://www.zenphoto.org/2008/04/how-to-read-the-zenphoto-functions-guide/" href="http://www.zenphoto.org/2008/04/how-to-read-the-zenphoto-functions-guide/">How to read the functions guide</a></li>
<li><a title="http://www.zenphoto.org/2008/05/theming-tutorial/" href="http://www.zenphoto.org/2008/05/theming-tutorial/">Theming tutorial</a></li>
</ul>
<h4><a name="32"></a>Can I integrate Zenphoto with Wordpress or another CMS?</h4>
<p>At this time, officially, no. Technically, there are basically three recommended ways to &#8220;integrate&#8221; Zenphoto with another CMS:</p>
<ol>
<li>Match the look of your Zenphoto site to your existing CMS site is to create a zenphoto theme using the CSS and HTML from yoursite&#8217;s theme.</li>
<li>Technically more advanced is the <a title="http://www.zenphoto.org/2009/11/zenphoto-as-a-plug-in-using-zenphoto-functions-from-outside-zenphoto/" href="http://www.zenphoto.org/2009/11/zenphoto-as-a-plug-in-using-zenphoto-functions-from-outside-zenphoto/">zenphoto as a &#8220;plugin&#8221;</a><a title="http://www.zenphoto.org/category/Extensions/" href="http://www.zenphoto.org/category/Extensions/"></a>.</li>
<li>A third way would be to use one of these methods: <a title="http://www.ruzee.com/blog/2006/06/integrating-zenphoto-into-wordpress/" href="http://www.ruzee.com/blog/2006/06/integrating-zenphoto-into-wordpress/">http://www.ruzee.com/blog/2006/06/integrating-zenphoto-into-wordpress/</a> (We basically use this on zenphoto.org) or <a href="http://tech.einaregilsson.com/2007/08/06/integrating-zenphoto-into-wordpress/">http://tech.einaregilsson.com/2007/08/06/integrating-zenphoto-into-wordpress/</a></li>
</ol>
<p>Also please review our <a title="http://www.zenphoto.org/2009/03/theming-tutorial/" href="http://www.zenphoto.org/2009/03/theming-tutorial/">theming tutorial</a>. For Wordpress specially there are some <a title="http://www.zenphoto.org/category/extensions/wordpress-tools/" href="http://www.zenphoto.org/category/extensions/wordpress-tools/">Wordpress  tools</a> available.</p>
<p>Or maybe you want to run your entire site with Zenphoto using the <a title="http://www.zenphoto.org/2009/03/zenpage-a-cms-plugin-for-zenphoto/" href="http://www.zenphoto.org/2009/03/zenpage-a-cms-plugin-for-zenphoto/">CMS plugin Zenpage</a>.</p>
<h4><a name="33"></a>Can I extend the functionality of Zenphoto myself?</h4>
<p>Yes, you can. Zenphoto supports an extensive <a href="http://www.zenphoto.org/2008/04/zenphoto-plugin-architecture/">plugin architecture </a>.  It is best you extend using these tools. You can browse to the <a title="http://www.zenphoto.org/category/Extensions/" href="http://www.zenphoto.org/category/Extensions/"><span class="wiki">extensions section</span></a> and see what&#8217;s already available.</p>
<p>Zenphoto is open source, so you can modify its core directly. Bear in mind code changes to the core Zenphoto code may make upgrading difficult later on, and generally hacks have little or no support.</p>
<h4><a name="34"></a>Does Zenphoto work with PHP Safe Mode?</h4>
<p>Safe mode is generally considered bad practice for web hosts and users, as it breaks many programs and does not provide any real improvement in security.</p>
<p>1.0.8 and above should now be compatible with PHP safe mode. If any problems occur in a safe_mode configuration, please report a <a href="http://www.zenphoto.org/trac/report">New Ticket</a> describing the problem.</p>
<p>There may still be problems uploading using the administrator&#8217;s interface while in safe_mode. This problem is not possible to fix, as in safe_mode it is impossible to both create a folder and write to that folder using the web server alone. You may only upload to existing folders that you&#8217;ve created using FTP upload. To get around this, we recommend you upload via FTP, or create the folders you want using FTP, and also ask your host to turn off safe mode as noted above.</p>
<h4><a name="35"></a>Is it possible to configure TinyMCE differently?</h4>
<p>Yes, of course. You find the configuration file for the text editor under <tt>/zp-core/js/file editor_config.js.php</tt>. You will find all info about configuration options on the TinyMCE wiki: <a title="http://wiki.moxiecode.com/index.php/TinyMCE:Index" href="http://wiki.moxiecode.com/index.php/TinyMCE:Index">http://wiki.moxiecode.com/index.php/TinyMCE:Index</a></p>
<h4><a name="36"></a>I have moved my zenphoto installation on my server and now all urls are wrong!</h4>
<p>If you first installed Zenphoto within <tt>www.yourdomain.com/zenphoto</tt> and later decide to move it directly into the root <tt>www.yourdomain.com</tt> you need to run setup (<tt>/zp-core/setup.php</tt>) again. This will correct the rewrite base within the <tt>.htaccess</tt> file.</p>
<p>You need to do the same if you want to keep Zenphoto within a subfolder but would like to rename it to <tt>/gallery </tt>for example.</p>
<h4><a name="'37"></a>I have enabled comments on the gallery options and for each image and album but there is no comment form showing up on my theme!</h4>
<p>Zenphoto 1.2.6 introduces the comment_form plugin that needs to be enabled to enable the comments section.</p>
<h4><a name="38"></a>Is it possible to manage youtube videos (or from another portal)?</h4>
<p>Zenphoto is actually meant to manage multimedia files on your own webspace  but with Zenphoto 1.2.6 there is indeed a way:</p>
<ol>
<li>Enable the <tt>class-textobject</tt> plugin on the backend plugins page.</li>
<li>Upload a plain text file (.txt) with code to embeed a specifc (video) file via ftp or the backend.</li>
<li>To use an thumbnail besides the default one follow the same <a title="Zenphoto video thumbnails" href="http://www.zenphoto.org/2009/03/troubleshooting-zenphoto/#19">instructions as for video thumbnails</a>.</li>
<li>That&#8217;s all.</li>
</ol>
<h4><a name="39"></a>How to protect my images from hotlinking?</h4>
<p>Although Zenphoto has an option for image protection it does only protect from getting the (full) image link from your gallery site itself but not prevent real hotlinking from outside. Everyone who knows how Zenphoto stores images can find out the direct link with ease.</p>
<p>So, to really protect your images from hotlinking you need to use <tt>.htaccess</tt> (if you server supports this). Here is a little generator tool for this: <a title="http://www.htaccesstools.com/hotlink-protection/" href="http://www.htaccesstools.com/hotlink-protection/">http://www.htaccesstools.com/hotlink-protection/.</a> The lines generated need to be added to the standard <tt>.htaccess</tt> file that comes with the Zenphoto package.</p>
<h4><a name="40"></a>How to move my installation to a new server?</h4>
<ol>
<li>Install Zenphoto on the new server. Do not run setup yet.</li>
<li>Copy all customized themes or plugins from the old to the new location.</li>
<li>Copy the <tt>albums</tt> and the <tt>cache</tt> folder from the old to the new location and if you used Zenpage also the <tt>uploaded</tt> folder.</li>
<li>Export the database using the database backup tool on the admin overview page of the old install.</li>
<li>Copy the <tt>backup</tt> folder with its content to the root of your new installation.<br />
Now run setup (<tt>zp-core/setup.php</tt>). It will provide the option to import that database backup when you have to set your user/password details.</li>
<li>Now access your site/admin backend and everything should be as usual.</li>
</ol>
<h4><a name="41"></a>Can I just use specific files of a nightly build or svn version to fix a problem in a stable release?</h4>
<p>This is strongly discouraged — unless you have been told to do this by the developers — as we have made many changes and certainly do not test except as a complete package. You could, of course, do a file comparison to see what has changed exactly.</p>
<h4><a name="42"></a>Opening full images using Thickbox or any other JavaScript &#8220;box&#8221; script does not work</h4>
<p>If you see some weird messy text showing instead of the full image you need to disable the full image protection on the backend options (Options &gt; Images &gt; Full Image Protection). These &#8220;box&#8221; scripts need to access the full image directly which naturally is not possible if it is protected.</p>
<h4><a name="43"></a>I have problems installing or upgrading using SimpleScripts</h4>
<p>We don&#8217;t support using installtion helper scripts like SimpleScripts and we don&#8217;t know what these are doing. If you have problems please ask the creators of SimpleScripts.</p>
<p>There are frequent reports that especially upgrades are often not working as expected. A user has provided some instructions on this <a href="http://www.zenphoto.org/support/topic.php?id=6549&amp;page=2#post-38213">forum thread</a>.</p>
<p><strong>We recommend to do a manual install as described on our <a title="http://www.zenphoto.org/2008/08/installation-and-upgrading/" href="http://www.zenphoto.org/2008/08/installation-and-upgrading/">installation page</a>.</strong></p>
<h4><a name="44"></a>How  do I disable the right click button to protect my images against  downloading?</h4>
<p>The question boils down to “how can I protect my intellectual rights by preventing viewers from capturing my images while still making them available for view.” Usually the actual question is “how can I disable the right click button {so that people cannot download my images.}”</p>
<p>The first part of this question is easily answered. There are many java scripts available to disable this action. Unfortunately, the second part of the question is not addressed by the first. The right click/save target as context menu is only one of a myriad of ways that someone can capture web content.</p>
<p>There is a very good discussion of this on about.com. But, just in case this link goes away without us noticing, I will summarize what it tells you.</p>
<ul>
<li>Disabling the context menu (what right click takes you to) is very annoying to people used to using the context menu for web browsing. Disabling it may turn people away from your site in disgust.</li>
<li>Disabling the context menu does not prevent capture of web content, it only prevents one small method of doing so.</li>
</ul>
<p>So, if you wish to protect your images you need to take a different tact. Some suggestions are:</p>
<ul>
<li>Watermark your image. Zenphoto provides a means to do this.</li>
<li>Upload only small, WEB quality images. These images may be captured, but will be useful only for WEB pages.</li>
<li>Imbeed copyright information in the image — both in the metadata and with <a title="http://en.wikipedia.org/wiki/Steganalysis" href="http://en.wikipedia.org/wiki/Steganalysis">steganalysis</a>.</li>
</ul>
<p>But please do not cripple your site by disabling the context menu. Even if you do, it is quite easy for the viewer to re-enable it by typing <tt>javascript:void oncontextmenu(null)</tt> into the address bar of the browser.</p>
<h4><a name="45"></a>Why is the image rotate button grayed out?</h4>
<p>The GD graphics libary on your server is missing support for image rotation. You have to contact your host about that.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.zenphoto.org/2009/03/troubleshooting-zenphoto/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Theming Tutorial</title>
		<link>http://www.zenphoto.org/2009/03/theming-tutorial/</link>
		<comments>http://www.zenphoto.org/2009/03/theming-tutorial/#comments</comments>
		<pubDate>Mon, 02 Mar 2009 06:00:24 +0000</pubDate>
		<dc:creator>acrylian</dc:creator>
				<category><![CDATA[Customizing]]></category>
		<category><![CDATA[Theming & Templating]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[User Guide]]></category>

		<guid isPermaLink="false">http://www.zenphoto.org/?p=113</guid>
		<description><![CDATA[
Part 1: Theme Basics

What should I know before making a theme?
What is a theme
Where are the theme files located?
How can I install a theme designed by someone else?
How does a theme work?
Theme structure


Part 2: Making a theme

theme_description.php
theme.png
index.php
album.php
image.php
search.php
Adding the comments section


Part 3: Advanced Theme Functionality

Custom pages with the example of archive.php and slideshow.php
Separation of the gallery [...]]]></description>
			<content:encoded><![CDATA[<ol>
<li><a href="#part-1"><strong>Part 1: Theme Basics</strong></a>
<ol>
<li><a href="#what-should-I-know-before-making-a-theme">What should I know before making a theme?</a></li>
<li><a href="#what-is-a-theme">What is a theme</a></li>
<li><a href="#where-are-the-theme-files-located">Where are the theme files located?</a></li>
<li><a href="#installing-a-theme">How can I install a theme designed by someone else?</a></li>
<li><a href="#how-does-a-theme-work">How does a theme work?</a></li>
<li><a href="#theme-structure">Theme structure</a></li>
</ol>
</li>
<li><a href="#part-2"><strong>Part 2: Making a theme</strong></a>
<ol>
<li><a href="#theme_description.php">theme_description.php</a></li>
<li><a href="#theme.png">theme.png</a></li>
<li><a href="#index.php">index.php</a></li>
<li><a href="#album.php">album.php</a></li>
<li><a href="#image.php">image.php</a></li>
<li><a href="#search.php">search.php</a></li>
<li><a href="#adding-comments">Adding the comments section</a></li>
</ol>
</li>
<li><a href="#"><strong>Part 3: Advanced Theme Functionality</strong></a>
<ol>
<li><a href="#custom-pages">Custom pages <em>with the example of archive.php and slideshow.php</em></a></li>
<li><a href="#custom-gallery">Separation of the gallery and the index page</a></li>
<li><a href="#custom-functions">Custom functions</a></li>
<li><a href="#theme-options">Theme options</a></li>
<li><a href="#override-options">Overriding options for special theme effects.</a></li>
<li><a href="#special-images">Special images</a></li>
<li><a title="#special-scripts" href="#special-scripts">Special scripts</a></li>
<li><a href="#theme-translations">Separate theme translations</a></li>
<li><a href="#sophisticated-theme-design">Sophisticated theme design</a></li>
</ol>
</li>
<li><a href="#part-4"><strong>Part 4: Theming Zenpage</strong></a>
<ol>
<li><a title="zenpage-theme-basics" href="#zenpage-theme-basics">Zenpage theme basics</a></li>
<li><a title="pages.php" href="#pages">pages.php</a></li>
<li><a title="news" href="#news">news.php</a></li>
<li><a title="news-on-index" href="#news-on-index">News on index.php</a></li>
<li><a title="search-results-for-zenpage-items" href="#search-results-for-zenpage-items">Adding search results for Zenpage items on search.php</a></li>
<li><a title="zenpage-content-on-other-theme-pages" href="#zenpage-content-on-other-theme-pages">Showing Zenpage content on other theme pages</a></li>
<li><a title="combinews" href="#combinews">The CombiNews feature</a></li>
</ol>
</li>
</ol>
<h4>Part 1: Theme Basics<a name="Part-1"></a></h4>
<h5>What should I know before making a custom theme?<a name="what-should-I-know-before-making-a-theme"></a></h5>
<p>During the process of this article, we will be looking at the basic files and function elements that are necessary to form a working Zenphoto theme, We&#8217;ll use the default theme as an example. We will not go into every single detail of the code because we assume that you have an good understanding of (X)HTML and CSS. You should also have a basic understanding what PHP is and how PHP code is put into a webpage and communicates with the server and returns information back to the client.</p>
<p>For more detailed information on the Zenphoto template functions please visit our <a title="http://www.zenphoto.org/documentation/index.html" href="http://www.zenphoto.org/documentation/index.html">functions documentation</a> and it&#8217;s accompaning <a title="http://www.zenphoto.org/2008/04/how-to-read-the-zenphoto-functions-guide/" href="http://www.zenphoto.org/2008/04/how-to-read-the-zenphoto-functions-guide/">How To Read The Zenphoto Functions Guide article</a>.</p>
<h5>What is a theme?<a name="what-is-a-theme"></a></h5>
<p>In technical terms, it&#8217;s a set of files that use a markup language ((X)HTML and CSS) and embedded PHP code to dynamically create the layout and style of your gallery. In other words, a theme is just a way to give your gallery a different look.</p>
<h5>Where are the theme files located?<a name="where-are-the-theme-files-located"></a></h5>
<p>By default, when you first install Zenphoto, you should have a file structure that looks similar to the image on the left. You have the &#8220;root&#8221; or main folder of Zenphoto, then in it you have four other folders named <tt>albums, cache, themes</tt>, and <tt>zp-core</tt>. The <tt>themes</tt> folder is where the default themes exist, where you should install new themes that you&#8217;ve downloaded, and where you will put all your new themes. Zenphoto comes with four themes: default, example, effervescence_plus and stopdesign.</p>
<h5>Where do I find themes and how can I install a theme designed by someone else?</h5>
<p>You can find all known custom themes at our <a title="zenphoto themes" href="/zp/theme">themes page</a>, or from the theme creator&#8217;s site.</p>
<p>Usually, the distribution of a theme comes with instructions on how to install the theme. For those instances where instructions don&#8217;t exist, here is a basic set of installation instructions for installing themes:</p>
<ol>
<li>Download the theme of your choice.</li>
<li>Expand the zip archive to a local folder.</li>
<li>Upload the extracted folder (keeping the underlying folder structure intact) to your <tt>/themes</tt> directory.</li>
<li>Go into your admin &gt; themes tab and choose your theme.</li>
<li>View your gallery with the new theme in place!</li>
</ol>
<p><strong>Note:</strong> Some themes have custom mods or things that need to be changed in addition to the normal theme installation. So take care to note in the theme distribution what these may be before you install.</p>
<h5>How does a theme work?<a name="how-does-a-theme-work"></a></h5>
<p>Themes are done in a pretty straightforward way. They&#8217;re just PHP files that use a set of theme functions (from <tt>zp-core/template-functions.php</tt>) to display the albums or images in any way. The current theme is selected in the admin themes panel. (Admin uses the file <tt>theme_description.php</tt> within the theme&#8217;s folder as the sorce of its information about the theme.) The root index.php file then looks at the URL arguments (album, image, etc. or lack thereof) and decides whether to load the theme&#8217;s index file, album page, or image page. Pretty simple.</p>
<h5>Theme Structure<a name="theme-structure"></a></h5>
<p>Here&#8217;s a brief description of the basic files that are needed for a standard theme:</p>
<p>These are the required basic files every theme must have:</p>
<ul>
<li><tt>theme_description.php</tt> &#8211; This is the description file which gives ZenPhoto information about your theme. This information is displayed in the themes page of the ZenPhoto admin backend. Older themes before ZenPhoto 1.2 may use a theme.txt file for the same purpose.</li>
<li><tt>theme.png</tt> &#8211; This is the theme thumbnail used in the Options page of ZenPhoto.</li>
<li><tt>index.php</tt> &#8211; This is the default php file. It&#8217;s read and displayed when someone visits your main gallery page.</li>
<li><tt>album.php</tt> &#8211; This page is displayed when someone clicks on an album link from your gallery page (index.php). It then displays all the pictures in the selected album as thumbnails.</li>
<li><tt>image.php</tt> &#8211; This page is displayed when someone clicks on a specific thumbnail picture on your album page (<tt>album.php</tt>). It then displays the selected picture (the sized image), all it&#8217;s comments, and the &#8220;add comment&#8221; form.</li>
</ul>
<p>The following files are optional as they are not required for a basic functioning theme:</p>
<ul>
<li><tt>search.php</tt> &#8211; The page that displays search results. Actually this page is optional if you don&#8217;t want to use the search on your site. It&#8217;s included in all standard themes.</li>
<li><tt>archive.php</tt> &#8211; A custom page that is used to display the monthly archive and a tag cloud. It&#8217;s included in all standard themes except stopdesign.</li>
<li><tt>themeoptions.php</tt> &#8211; This provides the option handling interface used by the admin backend on the theme options page.</li>
<li><tt>slideshow.php</tt> &#8211; A page that displays the slideshow. The design is generic so that it works with all themes without design adjusting, just a black background with the image on it, but it&#8217;s possible to make it look like your other theme pages. Related files that are required to run the slideshow are the <tt>slideshow.css</tt> and the <tt>slideshow-controls.png</tt> and the slideshow plugin must be installed and activated.</li>
</ul>
<p>A diagram that shows the relations of the theme files:</p>
<p><a href="http://www.zenphoto.org/wp-content/uploads/2008/05/zenphoto-theme-diagram-10.png"><img class="alignnone size-full wp-image-115" title="zenphoto-theme-diagram-10" src="http://www.zenphoto.org/wp-content/uploads/2008/05/zenphoto-theme-diagram-10.png" alt="" width="500" height="545" /></a></p>
<h4>Part 2: Making a Theme<a name="part-2"></a></h4>
<p>We will now look at the necessary theme pages and the basic structure of these file that Zenphoto needs to process a theme. You can then take this knowledge and use it to create your own theme. Again, we won&#8217;t discuss any functions (or any (X)HTML or CSS styling) in detail.</p>
<p>More info on specific functions can be found in our functions guide.</p>
<h5>theme_description.php<a name="theme_description.php"></a></h5>
<pre>&lt;?php // Zenphoto theme definition file
$theme_description['name'] = 'Default';
$theme_description['author'] = '&lt;a href="http://www.noscope.com"
target="_blank"&gt;Joen Asmussen&lt;/a&gt;
and &lt;a href="http://www.levibuzolic.com" target="_blank"&gt;Levi Buzolic&lt;/a&gt;';
$theme_description['version'] = '1.5';
$theme_description['date'] = '10/20/2007';
$theme_description['desc'] = "The default theme in 4 distinct flavors.
After choosing this theme you can pick the theme color by going to the
Admin Options tab
and changing the &lt;em&gt;Theme colors&lt;/em&gt; option."; ?&gt;</pre>
<p>First of all, the first line is REQUIRED. This line will tell ZenPhoto that this file is about to describe a theme. Zenphoto will then look at the rest of the information and process it. The information is set up as key-value relationships using the format key::value. This means that whatever the name of the key, the value is shown after the &#8220;=&#8221; . So now let&#8217;s take a look at the list of keys and what they&#8217;re for.</p>
<ul>
<li>name &#8211; This is the name of the theme.</li>
<li>author &#8211; This is the theme author&#8217;s name.</li>
<li>version &#8211; This should be the version number of the theme.</li>
<li>date &#8211; This should be the last known date of modification of the theme.</li>
<li>description &#8211; This should be a short description of the theme. It would be a good idea if you include within the description the Zenphoto version for which you actually made this theme.</li>
</ul>
<p>So just change the values of the keys to match your theme.</p>
<h5>theme.png/theme.gif/theme.jpg<a name="theme.png"></a></h5>
<p>This will most likely be the very last file that you create for your theme; it&#8217;s an image used to represent your theme. This image can either be a .png, .gif, or .jpg and the dimensions of the file should be 150 x 150px. Most themes use a screenshot of thefinished theme for this image.</p>
<h5>index.php<a name="index.php"></a></h5>
<p>Look at the code in <tt>index.php</tt>, it&#8217;s all just a standard xHTML-based webpage, but we&#8217;ll try and explain some of the PHP code that&#8217;s in there.</p>
<pre>&lt;?php if (!defined('WEBPATH')) die(); ?&gt;</pre>
<p>This bit of code makes sure that the configuration for Zenphoto is setup correctly, if not it will stop everything right here. (There&#8217;s no point in processing the rest of the webpage if the configuration is incorrect, right?)</p>
<pre>&lt;?php printGalleryTitle(); ?&gt;</pre>
<p>As you can read from the function name, this function will place the actual name of the Gallery Title on the displayed page. So for example, if the title of your gallery were John&#8217;s Flower Garden then the code would go from looking like this:</p>
<pre>&lt;title&gt;&lt;?php printGalleryTitle(); ?&gt;&lt;/title&gt;</pre>
<p>to like this:</p>
<pre>&lt;title&gt;John's Flower Garden&lt;/title&gt;</pre>
<p>The next bit of PHP code:</p>
<pre>&lt;?php echo $_zp_themeroot ?&gt;</pre>
<p>Tells ZenPhoto to show the current path to the current theme&#8217;s root directory. This is why it&#8217;s used in the following context:</p>
<pre>&lt;link rel="stylesheet" href="&lt;?php echo $_zp_themeroot ?&gt;/index.css" type="text/css" /&gt;</pre>
<p>This will give the correct path to the .css file.</p>
<pre>&lt;?php zenJavascript(); ?&gt;</pre>
<p>This will include some theme supporting JavaScript that, for instance, allows the logged in administrator to dynamically edit the description and title of your images and albums using AJAX.</p>
<pre>&lt;?php if (getOption('Allow_search')) { printSearchForm(''); } ?&gt;</pre>
<p>If you set it in the Allow_search options this will print the search form.</p>
<pre>&lt;?php printHomeLink('', ' | '); echo getGalleryTitle(); ?&gt;</pre>
<p>This is actually a short breadcrumb navigation that will print this if you use Zenphoto within a website and set the link to that site within the options:</p>
<p>Site name | Gallery title</p>
<p>The following code is the main chunk of code for this file. It&#8217;s the so called &#8220;album loop&#8221; that lists all the albums in the gallery:</p>
<pre>&lt;?php while (next_album()): ?&gt; &lt;div class="album"&gt;
&lt;div class="albumthumb"&gt;&lt;a href="&lt;?php echo getAlbumLinkURL();?&gt;"
title="&lt;?php echo getAlbumTitle();?&gt;"&gt;
&lt;?php printAlbumThumbImage(getAlbumTitle()); ?&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class="albumtitle"&gt;
&lt;a href="&lt;?php echo getAlbumLinkURL();?&gt;"
title="&lt;?php echo getAlbumTitle();?&gt;"&gt;&lt;/a&gt;
&lt;?php printAlbumTitle(true); ?&gt;&lt;/div&gt; &lt;/div&gt; &lt;?php endwhile; ?&gt;</pre>
<p>Let&#8217;s take this line by line. First you&#8217;re starting a while loop in PHP and tell ZenPhoto that &#8216;as long as there&#8217;s a another album that&#8217;s next in the list of albums, do the following code&#8217;. The &#8216;code&#8217; that you want Zenphoto to process for every album is placed in between the the lines <tt>'&lt;?php while (next_album()): ?&gt;'</tt> and <tt>'&lt;?php endwhile; ?&gt;'</tt></p>
<p>That is why when you look at the xHTML source from your browser you see a div with an album class more than once, because it will put every album into a div tag with the album class.</p>
<p>Now inside that while loop you will see more PHP code. The functions <tt>getAlbumLinkURL(), getAlbumTitle(), printAlbumThumbImage()</tt>, and <tt>printAlbumTitle()</tt> are all theme functions of which we won&#8217;t explain because there are just too many to create a list here and you can also look them up in the theme function reference. However it&#8217;s pretty obvious what they do just by looking at the function names. Keep in mind that all these functions provide information about the album and this information will be repeated for each album in the list of albums while going through the while loop.</p>
<p><strong>Note:</strong> If you password protect an album via the admin backend and have the image display <em>use lock image</em> option set, Zenphoto uses a default image <tt>err-passwordprotected.gif</tt> as a replacement for the actual album thumb. This image is located within <tt>/zenphoto/zp-core/image/</tt> folder. But a theme can have its own image, all that needs to be done is to place a custom image of the same name like this: <tt>/zenphoto/&lt;themefolder&gt;/images/err-passwordprotected.gif</tt>.</p>
<pre>&lt;?php printPageListWithNav('&lt;', '&gt;'); ?&gt;</pre>
<p>This code will create an unordered list of links that link to the number of pages of albums in the gallery. So, for example, if you have three pages of albums, it will create the follwing code:</p>
<pre>&lt;ul class="pagelist"&gt; &lt;li class="prev"&gt;&lt;span class="disabledlink"&gt;&lt;&lt;/span&gt;&lt;/li&gt;
&lt;li class="current"&gt;&lt;a href="http://www.zenphoto.org:8080/zp"
title="Page 1 (Current Page)"&gt;1 &lt;/a&gt;
&lt;/li&gt; &lt;li&gt;&lt;a href="http://www.zenphoto.org:8080/zp/page/2/" title="Page 2"&gt;2&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://www.zenphoto.org:8080/zp/page/3/" title="Page 3"&gt;3&lt;/a&gt;&lt;/li&gt;
&lt;li class="next"&gt;&lt;a href="http://www.zenphoto.org:8080/zp/page/2/"
title="Next Page"&gt;&gt;&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</pre>
<p>Most themes then contain a footer that prints the gallery rss link and the link to the (optional) archive page:</p>
<pre>&lt;div id="credit"&gt;&lt;?php printRSSLink('Gallery','','RSS', ' | '); ?&gt;
&lt;a href="?p=archive"&gt;&lt;?php echo "Archive View"; ?&gt;&lt;/a&gt; | &lt;?php echo "Powered by"; ?&gt;
&lt;a href="http://www.zenphoto.org" title="&lt;?php echo 'A simpler web photo album'; ?&gt;"&gt;
zenphoto&lt;/a&gt;&lt;/div&gt;</pre>
<p>This is followed by the admin tool box that lets you directly jump to the admin backend if you are logged in, althought not necessary for a theme, this can be very useful:</p>
<pre>&lt;?php printAdminToolbox(); ?&gt;</pre>
<h5>album.php</h5>
<p>This page is almost exactly identical to index.php, so we won&#8217;t explain everything again. But there are some differences though:</p>
<pre>&lt;?php if (!defined('WEBPATH')) die(); $firstPageImages = normalizeColumns('2', '6'); ?&gt;</pre>
<p>As you might notice the second part starting with $firstPageImags is new. Basically (very simplified view) it figures out how many images and albums will fit on a page. In particular, it figures this out for the &#8220;transition&#8221; page where there are both album and image thumbnails on the same pagem which is not unusual if you have subalbums.</p>
<p>Then again we have the expanded breadcrumb navigation, that now prints additionally the album title, too.</p>
<pre>&lt;?php printHomeLink('', ' | '); ?&gt;
&lt;a href="&lt;?php echo getGalleryIndexURL();?&gt;" title="&lt;?php echo 'Albums Index'; ?&gt;"&gt;
&lt;?php echo getGalleryTitle();?&gt;&lt;/a&gt; | &lt;?php printParentBreadcrumb(); ?&gt;&lt;/span&gt;
&lt;?php printAlbumTitle(true);?&gt;&lt;/h2&gt;</pre>
<p>The <tt>&lt;?php printParentBreadcrumb(); ?&gt; </tt>part is for the breadcrumb display if you have one or more subalbum levels.</p>
<p>The next necessary element is then again the &#8220;album loop&#8221; you know already from <tt>index.php</tt>, that now displays the subalbums if available.</p>
<p>But now comes a really new part, the &#8220;image loop&#8221;:</p>
<pre>&lt;?php while (next_image(false, $firstPageImages)): ?&gt;&lt;div class="image"&gt;
&lt;div class="imagethumb"&gt;
&lt;a href="&lt;?php echo htmlspecialchars(getImageLinkURL());?&gt;"
title="&lt;?php echo getImageTitle();?&gt;"&gt;
&lt;?php printImageThumb(getImageTitle()); ?&gt;&lt;/a&gt; &lt;/div&gt;
&lt;/div&gt;&lt;?php endwhile; ?&gt;</pre>
<p>This works just like the &#8220;album loop&#8221; but displays the thumbnails of the images that are in the current selected album.</p>
<p>The remaining code is then again the page navigation and the footer that is the same as on index.php, except that you might want to use the album rss link instead of the gallery rss link.</p>
<h5>image.php<a name="image.php"></a></h5>
<p>Since you should be used to the theme functions by now, we won&#8217;t go into what everyone does, but we&#8217;ll try and explain the more difficult bits of code.</p>
<p>Right at the top of this file (right before you define where the AJAX code goes) you&#8217;ll notice a new bit of JavaScript.</p>
<pre>function toggleComments() { var commentDiv = document.getElementById("comments");
if (commentDiv.style.display == "block") { commentDiv.style.display = "none";
} else { commentDiv.style.display = "block"; } } &lt;/script&gt;</pre>
<p>This code will basically allow you to toggle whether or not you want the comments to show or not. Just use it in a link and use the OnClick method of a link to run the toggleComments() function.</p>
<pre>&lt;div class="navigation"&gt; &lt;?php if (hasPrevImage()) { ?&gt;
&lt;a href="&lt;?php echo getPrevImageURL();?&gt;" title="Previous Image"&gt;&lt;&lt;/a&gt;&lt;?php } ?&gt;
&lt;?php if (hasNextImage()) { ?&gt;&lt;a href="&lt;?php echo getNextImageURL();?&gt;" title="Next Image"&gt;&gt;
&lt;/a&gt;&lt;?php } ?&gt; &lt;/div&gt;</pre>
<p>If there is an image (in the list of images) previous than the one being viewed, tgis creates a link to that previous image with the text &#8220;&lt;&#8221;. Then, if there is an image (in the list of images) following the one being viewed, it creates a link to the following image with the text &#8220;&gt;&#8221;.</p>
<p>Again we will use the breadcrumb naviagtion that is now extended again with the image title:</p>
<pre>&lt;?php printHomeLink('', ' | '); ?&gt;
&lt;a href="&lt;?php echo getGalleryIndexURL();?&gt;" title="&lt;?php 'Albums Index'; ?&gt;"&gt;
&lt;?php echo getGalleryTitle();?&gt;&lt;/a&gt; |
&lt;?php printParentBreadcrumb("", " | ", " | ");
printAlbumBreadcrumb("", " | "); ?&gt; &lt;/span&gt;
&lt;?php printImageTitle(true); ?&gt;</pre>
<p>The next code display the actual image &#8211; we call it the &#8220;sized image&#8221; to separate it from the full size image, that is linked to the full image and if available the image description :</p>
<pre>&lt;div id="image"&gt;&lt;a href="&lt;?php echo getFullImageURL();?&gt;" title="&lt;?php echo getImageTitle();?&gt;"&gt;
&lt;strong&gt;&lt;?php printDefaultSizedImage(getImageTitle()); ?&gt;&lt;/strong&gt; &lt;/a&gt; &lt;/div&gt;
&lt;div id="narrow"&gt;&lt;?php printImageDesc(true); ?&gt;</pre>
<p>This is followed by the display of the EXIF information:</p>
<pre>&lt;?php if(getImageEXIFData()) {echo "&lt;div id=\"exif_link\"&gt;
&lt;a href=\"#TB_inline?height=345&amp;width=300&amp;inlineId=imagemetadata\"
title=\"Image Info\" class=\"thickbox\"&gt;Image Info
&lt;/a&gt;&lt;/div&gt;"; printImageMetadata('', false); } ?&gt;</pre>
<p>If you want to protect the display of your sized image and/or the comments by album or gallery password, you should place this &#8220;if clause&#8221; around the whole part of the above code from sized image to comments like this:</p>
<pre>&lt;?php if (!checkForPassword()) { ?&gt; stuff for sized image, comments, comments form &lt;?php }; ?&gt;</pre>
<p>The remaining is again the same as on album.php.</p>
<h5>search.php<a name="search.php"></a></h5>
<p>This is the last of the actual required theme page. It&#8217;s actually nearly the same as the <tt>album.php</tt> since it does displaying albums and image. But this time the search results and not fixed albums.</p>
<pre>&lt;div id="padbox"&gt; &lt;?php if (($total = getNumImages() + getNumAlbums()) &gt; 0) {
if ($_REQUEST['date']){ $searchwords = getSearchDate();
} else { $searchwords = getSearchWords(); }
echo "&lt;p&gt;Total matches for &lt;em&gt;".$searchwords."&lt;/em&gt;: $total&lt;/p&gt;"; } $c = 0; ?&gt;</pre>
<p>This is the actual new part that fetches the search queries someone entered and prints the how many matches there are. This is then followed by the already known &#8220;album loop&#8221; and &#8220;image loop&#8221; from <tt>album.php</tt>. After that the following code is added, that as you see is used if there are no matches.</p>
<pre>&lt;?php if ($c == 0) { echo "&lt;p&gt;Sorry, no image matches. Try refining your search.&lt;/p&gt;"; }</pre>
<p>The remaining is once again the same as on all other theme pages.</p>
<h5>Adding the comments section<a name="adding-comments"></a></h5>
<p>You can add comments to <a href="#album.php">album.php</a> and <a href="#image.php">image.php</a>. Additionally also to Zenpage&#8217;s <a title="#pages.php" href="#pages.php">pages.php</a> and <a href="#news.php">news.php</a>.</p>
<p>Since Zenphoto 1.2.6 the comment handling code has been transfered to the <em>comment_form</em> plugin. All you need to do is to put this code where you want the comment form and the comment display.</p>
<pre>&lt;?php
if (function_exists('printCommentForm')) { ?&gt;
&lt;div id="comments"&gt;
&lt;?php printCommentForm(); ?&gt;
&lt;/div&gt;
&lt;?php } ?&gt;</pre>
<p>You can of course modify the look of the comment section via CSS or you could even make your own comment form by changeing the file <tt>zp-core/plugins/comment_form/comment_form.php</tt>.</p>
<h4>Part 3: Advanced Theme Functionality<a name="part-3"></a></h4>
<p>This part of our tutorial is about the more advanced functionalitly you can add to your theme.</p>
<h5>Custom pages <em>with the example of <tt>archive.php</tt> and <tt>slideshow.php</tt></em><a name="custom-pages"></a></h5>
<p>&#8220;Custom pages&#8221; are additional pages that do not display actual gallery stuff like albums or images. You can have multiple custom pages that are called with the url</p>
<p><tt>zenphoto/index.php?p=pagetitle</tt> (non mod_rewrite)</p>
<p>or</p>
<p><tt>zenphoto/page/pagetitle</tt> (mod_rewrite)</p>
<p>In general a custom page is just like <tt>index.php</tt> but with the album loop removed. These pages can be used as an &#8220;about&#8221; or &#8220;references&#8221; page for example, but the content needs to be hardcoded and can not be adminstrated by zenphoto. (Of course, you can created theme options to allow customization of these pages from the admin theme options tab.)</p>
<p>You can use some of the more general theme functions as <tt>archive.php</tt> does.</p>
<p>Archive.php is used to display links that organize your images by month &amp; year, and a tag cloud of the most used tags:</p>
<pre>&lt;?php if (!checkForPassword()) {?&gt;
&lt;div id="archive"&gt;&lt;?php printAllDates(); ?&gt;&lt;/div&gt;
&lt;div id="tag_cloud"&gt; &lt;p&gt;Popular Tags&lt;/p&gt;
&lt;?php printAllTagsAs('cloud', 'tags'); ?&gt; &lt;/div&gt; &lt;?php } ?&gt;</pre>
<p>slideshow.php is actual a slim custom page that is outside the actual theme since it is meant to be used as a generic slideshow page. It consists of a basic html structure and the function</p>
<pre>&lt;?php printSlideShow(); ?&gt;</pre>
<h5>Separation of the gallery and the index page<a name="custom-gallery"></a></h5>
<p>You may wish to have an introductory page to your website but still keep the look and feel of the gallery for visitors viewing your images. This can easily be done by using the theme option <em>custom index page</em>. If you have an existing zenphoto gallery the easiest way to accomplish this task is to rename your current theme <tt>index.php</tt> script to something else, say <tt>gallery.php</tt>. Create your new index.php script to introduce your site. Include on it a link to <tt>http://yoursite.com/zenphoto/page/gallelry</tt> (assuming you named your old index file gallery.php and you installed zenphoto in the folder zenphoto). Set the custom <em>index page option</em> to <tt>gallery</tt> and your are all set.</p>
<h5>Custom functions<a name="custom-functions"></a></h5>
<p>Custom functions can be used to add additional functionality to your theme. Actually these are just an extra template functions that are placed as a extra PHP file within your theme&#8217;s folder. Name this theme file <tt>functions.php</tt> and it will be loaded automatically on every theme page to make the custom functions available.</p>
<h5>Theme options<a name="theme-options"></a></h5>
<p>Themes may create options that change the behavior or appearance of the theme. (All the distributed themes have options for these reasons.) Options are defined by PHP code in a file called <tt>themeoptions.php</tt> which is located in your theme folder. The file is optional, if you have no options you need not have <tt>themeoptions.php</tt>. Theme options are one class of Zenphoto plugins. Plugins are described <a title="Zenphoto Plugins" href="http://www.zenphoto.org/2008/04/zenphoto-plugin-architecture/">here</a>. You define the options in this code and make use of them in your theme by calling the function <tt>getOption()</tt> passing the option name. (It is a good idea to be sure any unique options you create have unique names so that they don&#8217;t conflict with options some other theme builder might have made.)</p>
<p>Some of the &#8217;standard&#8217; theme options (as defined by the distributed themes) are: &#8216;Allow_comments&#8217;, &#8216;Allow_search&#8217;, and &#8216;Theme_colors&#8217;. These are used in the distributed themes to enable comment forms, enable serach forms, and select a CSS for the theme. See the default theme for examples.</p>
<p>Themeoptions are a class of Zenphoto Plugin so reading about the <a title="Plugin Architecture" href="http://www.zenphoto.org/2008/04/zenphoto-plugin-architecture/">plugin architecture </a>might also be of some value.</p>
<h5>Overriding options for special theme effects<a name="override-options"></a></h5>
<p>If your theme has special needs for some options it is possible to override temporarily the options as set in the Administrative back end. Cases where this might be useful are, for instance, to insure that the theme looks well balanced when there are multiple album thumbs or image thumbs in a row. The theme may then wish to change the albums per page option (images per page option) so that it is a multiple of the number that will fit in a row. (The standard themes all do this.)</p>
<p>It would not be nice, however, for a theme to permanantly change the option as it would impact other themes that might get used. The <tt>setOption()</tt> function of zenphoto has provided a means to temporarily change an option without updating the options database. There is a third parameter the the <tt>setOption()</tt> function, <tt>$persistent</tt>, which is defaulted to true. Passing <tt>false</tt> to this parameter tells <tt>setOption()</tt> to change the value of the option in memory but not in the database.</p>
<p>The duration for an option set non-persistent is the scope of the script from where it is set until the script ends. This means that each script that relies on the transient value of the option must set it.</p>
<h5>Special images<a name="special-images"></a></h5>
<p>Zenphoto has several special images that a theme can replace it it wished. These are:</p>
<ul>
<li><code>imageDefault.png</code>which is used for album thumbnails when there are no images in the album.</li>
<li><code>multimediaDefault.png</code>which is the default image for video thumbnails.</li>
<p>and</p>
<li><code>err-passwordprotected.gif</code>which is used (optionally) as a standin for the thumbnail of an album which is password protected and the viewer has not supplied the password.</li>
</ul>
<p>A theme can override the images that come with Zenphoto by placing a same named image in a folder named <tt>images </tt>within the theme folder.</p>
<h5>Special scripts <a name="&gt;&lt;a href=" href="http://www.zenphoto.org/wp-admin/mce_href=">&#8220;&gt;</a></h5>
<p>There are currently two special PHP scripts that can be used to enhance your theme. They are optional, so if you have not created them, a standard behavior will replace them.</p>
<p><tt>404.php</tt>: If your theme contains this script it will be invoked whenever a page not found contition is raised by Zenphoto. Creating a script of this name allows you to control the presentaton of the page not found error. Each of the Zenphoto distributed themes contains such a script that you can take as an example.</p>
<p><tt>password.php</tt> (post 1.2.5): Default password protection handling will check passwords in the image and album loops. If an album is password protected, no subalbums or images will be returned from the loops. Instead, a password form will be presented. Additional protection can be achieved by placing <code>if (!checkforPassword(true) { }</code> block around content you wish hidden on password protected pages.</p>
<p>With the 1.2.6 release you can instead create a<tt> password.php</tt> script in your theme folder. If such a script exists, it will be loaded in place of the target Zenphoto page. This allows you to completely control the presentation of the password protected content. Each of the distributed themes contains such a script for your use as an example.</p>
<h5>Separate theme translations (post 1.2)<a name="theme-translations"></a></h5>
<p>If you provide a theme as a third party, it’s translation is naturally not included with Zenphoto’s general translation file. But with post Zenphoto 1.2 you can have an independent translation file for your theme. Zenphoto uses gettext for translations. Please visit our translating tutorial for more detailed information about that.</p>
<p>To set up your theme for separate gettext translation, you just need to place the following function on top of each theme file:</p>
<p><code>&lt;?php setThemeDomain(”&lt;theme name&gt;”); ?&gt;</code></p>
<p>This function tells Zenphoto that this theme uses it’s own translation.</p>
<p>You also need need to have a locale folder set up within your theme&#8217;s folder this way:</p>
<pre>/themes/&lt;theme name&gt;/locale/
/themes/&lt;theme name&gt;/locale/&lt;language locale&gt;/LC_MESSAGES/
/themes/&lt;theme name&gt;/locale/&lt;language locale&gt;/LC_MESSAGES/&lt;theme name&gt;.po
/themes/&lt;theme name&gt;/locale/&lt;language locale&gt;/LC_MESSAGES/&lt;theme name&gt;.mo</pre>
<p>It is important that you then only parse your theme&#8217;s folder with Poedit or another gettext editor.</p>
<h5><a name="sophisticated-theme-design"></a>Sophisticated theme design</h5>
<p>Zenphoto is actually not limited to the already described standard theme way. Besides the fact that all template functions have a &#8220;print&#8221; variant that prints a full convenient HTML setup there is also (nearly) always a &#8220;get&#8221; variant that just returns raw data (strings, objects, array etc.) to build customized functions for special needs.</p>
<p>Zenphoto also provides an object orientated framework for advanced users with coding knowledge to do different and more sophisicated things that are bascially only limited by your abilities.</p>
<p>See the <a title="http://www.zenphoto.org/2010/02/zenphotos-object-model-framework/" href="http://www.zenphoto.org/2010/02/zenphotos-object-model-framework/">object model framework tutorial</a> and the <a title="http://www.zenphoto.org/documentation" href="../documentation">functions documentation</a> for more details.</p>
<h4>Part 4: Theming Zenpage<a name="part-4"></a></h4>
<h5><a name="zenpage-theme-basics"></a>Zenpage theme basics</h5>
<p>This part will give you only a basic overview how to setup your theme for the <a title="http://www.zenphoto.org/2009/03/zenpage-a-cms-plugin-for-zenphoto/" href="http://www.zenphoto.org/2009/03/zenpage-a-cms-plugin-for-zenphoto/">CMS plugin Zenpage</a>. It will not explain every detail. For more about the functions in detail please visit the functions guide and take a look at the included zenpage-default theme.</p>
<p>Zenpage hooks on Zenphoto&#8217;s <a title="custom pages" href="#custom-pages">custom page feature</a> and therefore requires two new custom pages to be available with your theme folder: <tt>pages.php</tt> and <tt>news.php</tt>. The name can be changed if really required for a certain language but this is only recommended for more advanced users. You can read about it in the FAQs.</p>
<p>Generally you can use all general Zenpage functions on all Zenphoto theme pages as you can in turn use all general Zenphoto functions on these two new pages.  Although some functions are limited only to <tt>pages.php</tt> and <tt>news.php</tt> to work correctly.</p>
<h5><a name="pages"></a>pages.php</h5>
<p>This theme page is the simplest of the both since it will only show one page at the time, so we start with it.</p>
<p>For a general site you just need the headline and the content:</p>
<pre>&lt;h2&gt;&lt;?php printPageTitle(); ?&gt;&lt;/h2&gt;&lt;?php printPageContent(); ?&gt;</pre>
<p>You can of course customize this with <tt>printExtraContent()</tt> or the <tt>printCodeblock()</tt> functions.</p>
<p>If you like to have comments on your page you have to add the comments part, too. A pages comments part is quite similar to the normal Zenphoto comments part. The only difference is that it uses to specific Zenpage options <tt>getOption('zenpage_comments_allowed')</tt>and <tt>zenpageOpenedForComments()</tt> that allow to set these independently from the general Zenphoto comments setting. See <a title="#adding-comments" href="#adding-comments">adding the comments section</a> for details.</p>
<p>The last thing you have to add is the admin tool box:</p>
<pre>&lt;?php printAdminToolbox(); ?&gt;</pre>
<h5><strong><a name="news"></a>news.php</strong></h5>
<p>This page is a little more complicated because it showe either the single news article and the news loop. The general structure is <tt>single news articles</tt> or <tt>news loop</tt>. First we check if this is a single news article:</p>
<pre>&lt;?php if(is_NewsArticle()) { ?&gt;</pre>
<p>If it is we show it. This two functions print links to the next or previous articles:</p>
<pre> &lt;?php printPrevNewsLink(); ?&gt; &lt;?php printNextNewsLink(); ?&gt;</pre>
<p>Note that these do not work when in <em>CombiNews</em> mode to avoid confusing since images will not be included.</p>
<p>Next we need the article itself with title, content and a few other functions that should be quite self explaining:</p>
<pre>&lt;h3&gt;&lt;?php printNewsTitle(); ?&gt;&lt;/h3&gt; &lt;?php printNewsDate();?&gt;&lt;?php echo gettext("Comments:"); ?&gt;&lt;?php echo getCommentCount(); ?&gt; &lt;?php printNewsCategories(", ",gettext("Categories: "),"newscategories"); ?&gt;&lt;?php printNewsContent(); ?&gt;</pre>
<p>Now if you like to have comments you need again the comments part that we already know from the <a title="#pages.php" href="#pages.php">pages.php</a> section.</p>
<p>Now we have to close the <tt>&lt;?php if(is_NewsArticle()) { ?&gt; </tt>statement from the beginning and open the else part for the news loop:</p>
<pre>} else {</pre>
<p>The news loop itself is again quite similar to two structures you know from Zenphoto, the <tt>next_image()</tt> and the <tt>next_album()</tt> loops. The content itself is actually nearly the same as for a single news article:</p>
<pre> while (next_news()): ;?&gt; &lt;h3&gt;&lt;?php printNewsTitleLink(); ?&gt;&lt;/h3&gt;&lt;?php printNewsDate();?&gt;&lt;?php echo gettext("Comments:"); ?&gt;&lt;?php echo getCommentCount(); ?&gt;&lt;?php printNewsCategories(", ",gettext("Categories: "),"newscategories"); ?&gt;&lt;?php printNewsContent(); ?&gt;&lt;p&gt;&lt;?php printNewsReadMoreLink(); ?&gt;&lt;/p&gt;&lt;?php  endwhile; ?&gt;</pre>
<p>Closing is a a function that is similar to the pagination of Zenphoto&#8217;s album and index page:</p>
<pre>&lt;?php printNewsPageListWithNav(gettext('next &amp;raquo;'), gettext('&amp;laquo; prev')); ?&gt;</pre>
<p>Then you have to close the else statement that we openend above:</p>
<pre>&lt;?php } ?&gt;</pre>
<p>Last but not least you can again add the admin toolbox.</p>
<pre>&lt;?php printAdminToolbox(); ?&gt;</pre>
<h5><a name="search-results-for-zenpage-items"></a>Adding search results for Zenpage items on <tt>search.php</tt></h5>
<p>Search results for Zenpage news articles and pages are not paginated and only shown on the first search results page.</p>
<p>Since Zenpage is an optional plugin we need to make sure that we set Zenpage results to 0 if the plugin is not enabled to avoid errors:</p>
<pre>$zenpage = getOption('zp_plugin_zenpage');
  if ($zenpage &amp;&amp; !isArchive()) {
   $numpages = getNumPages();
   $numnews = getNumNews();
   $total = $total + $numnews + $numpages;
 } else {
   $numpages = $numnews = 0;
 }</pre>
<p>Now we add the code to show the Zenpage results on the first results page only:</p>
<pre>&lt;?php
if ($_zp_page == 1) {
  if ($numpages &gt; 0) {
  $number_to_show = 5;
  $c = 0;
  ?&gt;
  &lt;/h2&gt;
  &lt;h3&gt;&lt;?php printf(gettext('Pages (%s)'),$numpages); ?&gt;&lt;/h3&gt;
  &lt;ul&gt;
&lt;?php
   while (next_page()) {
     $c++;
  ?&gt;
     &lt;li&gt;
       &lt;h4&gt;&lt;?php printPageTitlelink(); ?&gt;&lt;/h4&gt;
       &lt;p&gt;&lt;?php echo shortenContent(strip_tags(getPageContent()),80,getOption("zenpage_textshorten_indicator")); ?&gt;&lt;/p&gt;
    &lt;/li&gt;
&lt;?php
   }
?&gt;
  &lt;/ul&gt;
&lt;?php
}
if ($numnews &gt; 0) {
  $number_to_show = 5;
  $c = 0;
?&gt;
  &lt;h3&gt;&lt;?php printf(gettext('Articles (%s)'),$numnews); ?&gt;&lt;/h3&gt;
  &lt;ul&gt;
&lt;?php
    while (next_news()) {
      $c++;
?&gt;
      &lt;li&gt;
        &lt;h4&gt;&lt;?php printNewsTitleLink(); ?&gt;&lt;/h4&gt;
        &lt;p&gt;&lt;?php echo shortenContent(strip_tags(getNewsContent()),80,getOption("zenpage_textshorten_indicator")); ?&gt;&lt;/p&gt;
     &lt;/li&gt;
&lt;?php
    }
?&gt;
  &lt;/ul&gt;
&lt;?php
  }
}</pre>
<h5><a name="news-on-index"></a>News on index.php</h5>
<p>This option allows to turn the theme <tt>index.php</tt> into the first page of the news section (all further ones will be displayed on <tt>news.php</tt>). All you have to do to use this is to copy the complete <tt>next_news()</tt> loop to your <tt>index.php.</tt></p>
<p>It is recommended to limit the display to the first index.php page because the news loop uses the same variable for paging as index.php does. So you will get some probably unexpected results if you don&#8217;t limit this.</p>
<p>Alternatively you could also skip albums on index.php and use the <tt>printAlbumMenu()</tt> plugin to access them instead.</p>
<h5><strong><a name="zenpage-content-on-other-theme-pages"></a>Showing Zenpage content on other theme pages</strong></h5>
<p>You can use the <tt>get/printPageContent()</tt>, <tt>get/printExtraContent()</tt> and <tt>get/printCodeblock()</tt> functions to show published or unpublished pages&#8217; content, extracontent or codeblocks elsewhere. More info about these functions&#8217; parameters on the <a title="http://www.zenphoto.org/documentation" href="../documentation">documentation</a>.</p>
<p>If you need more fields like author or date, you probably should do this with the class object directly:</p>
<pre>$page = new ZenpagePage("&lt;titlelink of the page to get&gt;");</pre>
<p>Then you can call each field with <tt>&lt;?php echo $page-&gt;getId(); ?&gt;</tt> for example. Note that the title, content and extracontent fields support the multi-lingual feature, so that they need to be called like this:</p>
<pre>&lt;?php echo get_language_string(<tt>$page-&gt;getTitle()</tt>); ?&gt;&lt;?php echo get_language_string($page-&gt;getContent()); ?&gt;&lt;?php echo get_language_string($page-&gt;getExtraContent()); ?&gt;</pre>
<p>Of course this works similar for news articles, too. For more info about the Zenpage object methods please see the the <a title="http://www.zenphoto.org/2010/02/zenphotos-object-model-framework/" href="../2010/02/zenphotos-object-model-framework/">object  model framework tutorial</a> and the <a title="http://www.zenphoto.org/documentation" href="../documentation">functions  documentation</a>.</p>
<h5><a name="combinews"></a>The CombiNews feature</h5>
<p>This actually does not really need any special theming. Zenpage will just internally use the normal functions to show the lastest image within the normal loop as if they were news articles. They are still independed.</p>
<p>But you have some additional functions to use with them. For example there is:</p>
<pre>&lt;?php getNewsType(); ?&gt;</pre>
<p>This will print if the entry is a news article or an image or a movie. More detailed info on the functions guide.</p>
<p>Since images, movies or audio files do not have categories, but albums you can show this, too:</p>
<pre>&lt;?phpif(is_GalleryNewsType()) {echo gettext("Album:")."&lt;a href='".getNewsAlbumURL()."' title='".getBareNewsAlbumTitle()."'&gt; ".getNewsAlbumTitle()."&lt;/a&gt;";} else {printNewsCategories(", ",gettext("Categories: "),"newscategories");}?&gt;</pre>
<p>If the entry is an image etc it prints a link to the album it belongs to. If not is prints the list of the news article categories.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.zenphoto.org/2009/03/theming-tutorial/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
	</channel>
</rss>
