<?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 - simpler web gallery management &#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>Thu, 02 Sep 2010 10:29:10 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Zenphoto Plugin Architecture</title>
		<link>http://www.zenphoto.org/2010/08/zenphoto-plugin-architecture/</link>
		<comments>http://www.zenphoto.org/2010/08/zenphoto-plugin-architecture/#comments</comments>
		<pubDate>Sat, 14 Aug 2010 06:00:58 +0000</pubDate>
		<dc:creator>sbillard</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[User Guide]]></category>

		<guid isPermaLink="false">http://www.zenphoto.org/2008/04/zenphoto-plugin-architecture/</guid>
		<description><![CDATA[
Categories of plugins

Template plugins
Admin utilities
Core plugins


Filters
Plugin options
Separate plugin translations

As from the 1.2 release Zenphoto contains an implementation of &#8220;plugins&#8221; so that the functionality of the product can be extended without &#8220;bloating&#8221; the core code. Only users of the plugin will require the resources it uses. This article describes the architecture of Zenphoto plugins. Plugins may come [...]]]></description>
			<content:encoded><![CDATA[<ol>
<li><a href="#categories-of-plugins">Categories of plugins</a>
<ul>
<li><a href="#template-plugins">Template plugins</a></li>
<li><a href="#admin-utilities">Admin utilities</a></li>
<li><a href="#core-plugins">Core plugins</a></li>
</ul>
</li>
<li><a href="#filters">Filters</a></li>
<li><a href="#plugin-options">Plugin options</a></li>
<li><a href="#plugin-translation">Separate plugin translations</a></li>
</ol>
<p>As from the 1.2 release Zenphoto contains an implementation of &#8220;plugins&#8221; so that the functionality of the product can be extended without &#8220;bloating&#8221; the core code. Only users of the plugin will require the resources it uses. This article describes the architecture of Zenphoto plugins. Plugins may come with the Zenphoto distribution or may be available for download from third party developers.</p>
<p>We have provided some <a title="Example plugins" href="http://http://www.zenphoto.org/category/extensions/example-plugins/">example plugins</a> to help with your understanding. Note that these plugins are not formally supported by the Zenphoto team.</p>
<h4><a name="categories-of-plugins"></a>Categories of plugins</h4>
<p>There are three categories of plugins implemented in Zenphoto. The categorys you most likely will experience is plugins that extend the functionality of Themes. These are <em>Template Plugins</em> and <em>Filters</em>.</p>
<ol>
<li><em>Template Plugins</em> add optional functions to the repertoire of capabilities available to Theme designers. Examples of this category of plugin are: <tt>Google Maps</tt> which adds the facility of printing maps based on GPS data from the image EXIF, <tt>Rating</tt> which provides an image rating system, and <tt>shutterfly</tt> which enables viewers to print a copy of an image using the Shutterfly WEB service. Zenphoto plugins reside in the <tt>zp-core/zp-extensions</tt> folder of the Zenphoto installation. Third party plugins should be placed in the root<tt> plugins</tt> folder.</li>
<li><em>Core plugins </em>are the  third category of plugin and are used to provide alternative implementations of Zenphoto core functions. Examples of these plugins are: The spamfilter set and the theme options implementation. These plugins let Zenphoto developers provide choices for how the particular feature is handled. The folder residence is the same as for <em>Template Plugins</em>.</li>
<li><em>Admin utilities</em> are backend plugins that appear as a button on the overview tab&#8217;s utilities section. There are several plugins included in the release that you might look at as examples. They resides in <tt>zp-core/utilities</tt>.<br />
These plugins do not add anything to the core itself, although template or core plugins can add utility buttons. An example is the <tt>sitemap-extended</tt> plugin (Zenphoto 1.3).</li>
</ol>
<p><em>Plugins</em> are PHP scripts that consist of two sections. There is a section that provides the &#8220;glue&#8221; between the plugin and the Zenphoto core. Then there is the section that implements the functionality provided by the plugin. The plugin consists of at least a PHP file residing in the <tt>zp-core/zp-extensions</tt> folder. It may optionally use a folder of its same name, also in the <tt>zp-core/extensions</tt> folder.</p>
<h5><a name="template-plugins"></a>Template plugins</h5>
<p>The &#8220;glue&#8221; section is the interface to Zenphoto. In it are several (possibly optional) statements to initialize variables or register scripts pertaining to the plugin.</p>
<ul>
<li><tt>$plugin_description</tt> should be set to the text you wish displayed on the admin plugins tab description of the plugin.</li>
<li><tt>$plugin_author</tt> is the author of the plugin. This is also displayed on the plugins tab.</li>
<li><tt>$plugin_version</tt> is the version of the plugin.</li>
<li><tt>$plugin_URL</tt> is an URL to the usage documentation for the plugin. For plugins distributed with Zenphoto this is an URL to the PHP documentation page of the plugin on zenphoto.org.</li>
<li><tt>$plugin_disable</tt> controls setting the checkbox to enable the plugin. If the plugin cannot run, set this to the &#8220;reason&#8221; and <em>admin</em> will display the &#8220;reason&#8221; and will not enable the plugin. The variable should not be present or be set to empty the plugin may be enabled.</li>
<li><tt>$plugin_is_filter</tt> [1.2.5] flags this plugin as a <em>filter</em> type plugin and sets it load priority. The filters will be loaded in decending priority order. Normal front-end plugins should set this variable to 1. They will be loaded by index.php after the<em> front-end</em> environment has been established. Values greater than 1 will cause the plugin to load with the class libraries. These will be available to the <em>admin</em> scipts as well as to the front-end, but will load before the front-end environment is established. Values less than zero will load normally on the <em>front-end</em> but will also be available to the admin scripts.[1.2.6] The absolute value of value will be used for the load prioirity.[1.2.7]</li>
<li><tt>$option_interface</tt> If your plugin supports options, this variable should set to an instance of the option handler class for the plugin. (See <a href="#pluginoptions">Plugin Options</a> below.)</li>
<li><tt>Theme interfaces: </tt>There are three &#8220;standard interface points&#8221; where your plugin can insert HTML into a plugin script. You use the zp_retister_filter() function to define what you wish to handle of these insertion points. (see below for how filters work.) The points of insertion are in the <em>head</em> of the script, just after the start of the <em>body</em> and just before then end of the <em>body</em> of the script. Register a filter for &#8216;theme_head&#8217; for the first and one for &#8216;theme_body_open&#8217; and &#8216;theme_body_close&#8221; for the latter two. For instance you can emit HTML to load CSS files in the head with &#8216;theme_head&#8217; or to insert javaScript using any of these filters.</li>
</ul>
<p>The implementation section contains any initialization code needed by the plugin and all the <em>function</em> statements that are to be provided to the Theme designer.</p>
<h5><a name="admin-utilties"></a>Admin utilities</h5>
<p>These plugins are a little different and require this basic setup in the beginning of the page:</p>
<ul>
<li>This sets up the right path for admin use:
<pre>define('OFFSET_PATH', 3);
chdir(dirname(dirname(__FILE__)));</pre>
</li>
<li>Include the necessary admin standard functions.
<pre>require_once(dirname(dirname(__FILE__)).'/admin-functions.php');
require_once(dirname(dirname(__FILE__)).'/admin-globals.php');</pre>
<p>You can of course also call other plugins if you need or create your own utility custom functions.</li>
<li>Setting up the button display:
<pre>$button_text = gettext('Title of the utility button');
$button_hint = gettext('A description of the utiltiy that appears on hovering the button.');
$button_icon = '&lt;option path to a button icon&gt;';
$button_rights = &lt;User rights to limit access to the utility&gt;;</pre>
<p>The other plugin types can also add a button by using a filter (see <a title="http://www.zenphoto.org/2010/04/zenphoto-plugin-architecture/#filters" href="http://www.zenphoto.org/2010/04/zenphoto-plugin-architecture/#filters">below</a>).</li>
<li>Setting up the gallery object and the webpath:
<pre>$gallery = new Gallery();
$webpath = WEBPATH.'/'.ZENFOLDER.'/';</pre>
</li>
</ul>
<p>Additionally admin utilities require a standard html setup to fit in the backend nicely:</p>
<pre>printAdminHeader();
?&gt;
&lt;!-- The opening of the &lt;html&gt; and &lt;head&gt; is printed by printAdminHeader() so you can add further stuff to the head here --&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;?php printLogoAndLinks(); ?&gt;
&lt;div id="main"&gt;
&lt;?php printTabs('home'); ?&gt;
&lt;div id="content"&gt;
&lt;h1&gt;&lt;?php echo (gettext('&lt;Name of your utility&gt;')); ?&gt;&lt;/h1&gt;
&lt;!--  Here you can do whatever your utility should do --&gt;
&lt;/div&gt;&lt;!-- content --&gt;
&lt;/div&gt;&lt;!-- main --&gt;
&lt;?php printAdminFooter(); ?&gt;
&lt;/body&gt;
&lt;/html&gt;</pre>
<h5><a name="core-plugins"></a>Core plugins</h5>
<p>Zenphoto core plugins are extensions to the Zenphoto core. They may extend Zenphoto classes or provide new &#8220;back-end&#8221; capabilities. The current Zenphoto implementation makes use of three classes: <em>class objects</em>, <em>spamfilters</em> and <em>themeoptions</em>. These classes support an options interface (see <a href="#pluginoptions">below</a>.)</p>
<ol>
<li><em>Themeoption</em> plugins support only the options interface. This allows theme designers to have optional implementations and the gallery administrator to choose the appropriate values for these options. Themes are not required to support options and therefore the themeoptions plugin is optional.</li>
<li><em>Spam filter</em> plugins provide a <tt>filtermessage()</tt> function to examine a posting and determine if it is <em>Spam</em> or not.
<ul>
<li><strong><tt>filterMessage($author, $email, $website, $body, $imageLink)</tt></strong></li>
<li><tt>$author</tt> is the author field of the comment</li>
<li><tt>$email</tt> is the email field of the comment</li>
<li><tt>$website</tt> is the website field of the comment</li>
<li><tt>$body</tt> is the comment text</li>
<li><tt>$imageLink</tt> is the url to the full image</li>
</ul>
<p>This function is called to process comment postings. It may pass the comment (return value: 2), reject it (return value: 0), or mark it for moderation (return value: 1). The gallery administrator selects the filter appropriate for his needs from the ones found in the <tt>plugins/spamfilters</tt> folder.</li>
<li><em>Class objects</em> extend Zenphoto class capabilities. Currently the only class objects are for extending the &#8220;image&#8221; capabilities of Zenphoto. <tt>class_video.php</tt> provides support for video files and the example <tt>class_textobject.php</tt> is an example of how a new file type might be supported in Zenphoto by use of a class object plugin.</li>
</ol>
<h4><a name="filters"></a>Filters</h4>
<p><em>Filters</em> modify the behavior of existing Zenphoto functions and can be used by any of the plugin types. Examples of this kind of filter are found in the scripts <tt>filter_zenphoto_seo.php</tt> and <tt>filter_admin_toolbox.php</tt>.  Filters are applied to the output of other functions and may make modifications to that output. So, for instance, <tt>filter_zenphoto_seo</tt> has a filter for the <tt>seoFriendlyURL</tt> function that changes accented characters into non accented equivalents.</p>
<p>Filters are added to a function (which has filtering support) by using the function  <tt>zp_register_filter function($hook, $function_name, $priority, $accepted_args)</tt>).  <em>$hook</em> is the name of the filter item, <em>$function_name</em> is the function that will be invoked to filter the item, <em>$priority</em> is the rank of this filter among the list of filters for this item (defaults to 5), and <em>$accepted_args</em> is how many parmeters the filter requires (defaults to the number of parameters supplied). Filters are applied in ascending <em>$priority</em> order.</p>
<p>The registered function will be passed the parameters(with the exception of the<em> filter name string</em>) from the zp_apply_filter()  call. The function must always return the initial parameter of the list (if it exists) as this is then passed on to subsequent filters in the chain. This provides a means of filters operating on the changes made by other filters.</p>
<p>Zenphoto currently provides filter invocation for the following. Function parameters are indicated within the parens:</p>
<ul>
<li><tt>new_image</tt> ($image_object)<br />
Invoked just after Zenphoto saves a newly discovers image to the database.</li>
<li><tt>image_instantiate</tt> ($image_object) [1.2.9]<br />
Invoked when an image object is instantiated.</li>
<li>image_refresh</li>
<li><tt>new_album </tt>($album_object)<br />
Invoked whenever Zenphoto saves a newly discovered album to the database.</li>
<li><tt>album_instantiate </tt>($album_object) [1.2.9]<br />
Invoked when an album object is instantiated.</li>
<li>album_refresh</li>
<li><tt>new_page</tt> ($page_object) [1.2.5]<br />
Invoked when Zenpage saves a newly created page.</li>
<li><tt>new_article </tt>($news_object) [1.2.5]<br />
Invoked when Zenpage saves a newly created news article.</li>
<li><tt>seoFriendlyURL </tt>($string)<br />
Invoked wherever Zenphoto thinks that URL string text should be processed for non-seo friendly characters. The function return value is used as the new value of the string text.</li>
<li><tt>album_filter</tt> ($files[])<br />
Invoked when Zenphoto checks for albums (folders) for the gallery or a subalbum. The parameter is an array of filenames discovered. The return value of the function is the edited list of filenames.</li>
<li><tt>image_filter</tt> ($files[])<br />
Similar to <tt>album_filter</tt>, but for when Zenphoto checks an album for images. The return value is the updated image name list.</li>
<li><tt>admin_login_attempt</tt>($success, $user, $password)[1.2.6]<br />
Invoked whenever an attempt is made to log in as an administrator. Success is<em> </em>the <em>rights</em> of the user  if the login was successful. $user and $password are the credentials presented for the login.</li>
<li><tt>guest_login_attempt</tt>($success, $user, $password, $athority)[1.2.6]<br />
Invoked whenever an attempt is made to log in as a guest user. Success is <em>true </em>if the login was successful. $user and $password are the credentials presented for the login. $athority is the kind of login, e.g. <em>gallery</em>, <em>album</em>, etc.</li>
<li><tt>check_album_credentials</tt>($success)[1.2.9]<br />
Invoked when checking if a viewer is permitted to access an album. It should return <em>true</em> if access is allowed. If it returns true, no further checking is performed.</li>
<li><tt>check_news_credentials</tt>($success)[1.3.0]<br />
Invoked when checking if a viewer is permitted to access a Zenpage news article or category. It should return <em>true</em> if access is allowed. If it returns true, no further checking is performed.</li>
<li><tt>check_pages_credentials</tt>($success)[1.3.0]<br />
Invoked when checking if a viewer is permitted to access a Zenpage page. It should return <em>true</em> if access is allowed. If it returns true, no further checking is performed.</li>
<li><tt>admin_toolbox_<em>&lt;position&gt;</em></tt> [updated for 1.2.5]<br />
These filters allow additions to the <em>Admin Toolbox</em> links. <em>&lt;position&gt;</em> indicates where in the link list they will be placed. The positions are :</li>
<li>
<ul>
<li><tt>global</tt>:  on all instances of the links</li>
<li><tt>gallery</tt>:   on a gallery page</li>
<li><tt>album($albumname)</tt>:  on an album page</li>
<li><tt>image($albumname, $imagename)</tt>:  on an image page</li>
<li><tt>search</tt>:  on a search page</li>
<li><tt>news</tt>:  on a zenpage article page</li>
<li><tt>page</tt>:  on a zenpage page</li>
</ul>
<p>The filter should output the HTML for the link it desires to place in the <em>Admin Toolbox</em>.</li>
<li><tt>album<em>_&lt;album database field&gt;</em></tt> ($text, $object, $context, $field) [1.2.4]</li>
<li><tt>image<em>_&lt;image database field&gt;</em></tt> ($text, $object, $context, $field) [1.2.4]<br />
These filters are invoked by the various editable print functions. <tt>$text</tt> is the content that would be printed if there were no filter. The actual text printed will be the function return. <tt>$object</tt> is the Zenphoto album or image, <tt>$context</tt> will be  &#8217;album&#8217;, or &#8216;image&#8217;, <tt>$field</tt> is the <em>&lt;database field&gt;</em> name.</li>
<li><tt>comment_post</tt> ($commentobject, $ownerobject)<br />
This filter is called just before a newly posted comment is saved to the database. <tt>$commentobject</tt> is the comment and <tt>$ownerobject</tt> is the item (image, album, etc.) to which the object is posted.</li>
<li><tt>comment_approve(</tt>$commentobject)<br />
This filter is called when a SPAM comment is marked as approved (no longer SPAM) by the administrator.</li>
<li><tt>comment_disapprove(</tt>$commentobject) [1.2.7]<br />
This filter is called when a normal comment is marked as SPAM by the administrator.</li>
<li><tt>edit_album_utilities</tt> ($html, $album, $prefix) [1.2.5]<br />
Used to insert items in the &#8220;Utilities&#8221; acton box on the admin album edit tab.</li>
<li><tt>save_album_utilities_data</tt> ($html, $album, $prefix) [1.2.5]<br />
Used to process the POST of <span style="font-family: Courier New;">edit_album_utilities </span>actions.</li>
<li><span style="font-family: Georgia;">admin_tabs</span>($tabs, $current) [1.2.6]<br />
Used to insert (or delete)  tabs for Admin pages.</li>
<li><span style="font-family: Georgia;">admin_alterrights</span>($alterrights, $userobj) [1.2.6]<br />
Used to override disabling of admin rights and managed album user edit sections.</li>
<li><tt>edit_image_utilities</tt> ($html, $imag, $prefix, $subpage, $tagsort) [1.2.5]<br />
Used to insert items in the &#8220;Utilities&#8221; action box of the admin image edit tab.<em><tt></tt></em></li>
<li><em><tt>save_image_utilities_data</tt> ($html, $image, $prefix, $page, $sort)</em> [1.2.5]<br />
Used to process the POST of <span style="font-family: Courier New;">edit_image_utilities </span>actions.</li>
<li><em>custom data handling filters</em> (data, userobject, index)[1.2.5]<br />
These filters (listed below) are called to process editing and saving of the <tt>custom_data</tt> of images, albums, or comments. The <em>edit</em> variant allows you to format the data on the Admin edit pages. The <em>save</em> variant lets you process the information presented by the <em>edit</em> variant.The filters are:</p>
<ul>
<li><tt>save_image_custom_data</tt></li>
<li><tt>edit_image_custom_data</tt></li>
<li><tt>save_album_custom_data</tt></li>
<li><tt></tt><tt>edit_album_custom_data</tt></li>
<li><tt>save_comment_custom_data</tt></li>
<li><tt>edit_comment_custom_data</tt></li>
<li><tt>save_album_custom_data</tt> [1.2.6]</li>
<li><tt>edit_album_custom_data</tt> [1.2.6]</li>
<li><tt>save_admin_custom_data</tt> [1.2.6]</li>
<li><tt>edit_admin_custom_data</tt> [1.2.6]</li>
<li><tt>save_admin_custom_data</tt> [1.2.7]</li>
<li><tt>edit_admin_custom_data</tt> [1.2.7]</li>
</ul>
</li>
<li><em>register_user filters</em> [1.2.7]<br />
Used to allow extensions to the register_user plugin</p>
<ul>
<li><em>register_user_form ($html)</em><br />
add to the registeration form</li>
<li><em>register_user_register ($userobj)</em><br />
Called when a user registers</li>
<li><em>register_user_verify ($userobj)</em><br />
Called when a user has been verified</li>
</ul>
</li>
<li><em><tt>publish_article_utilities ($html)</tt></em> [1.2.6]<br />
Used to insert items into &#8220;Publish&#8221; action box on the Zenpage article edit tab.</li>
<li><em><tt>publish_page_utilities($html)</tt></em> [1.2.6]<br />
Used to insert items into &#8220;Publish&#8221; action box on the Zenpage pages edit tab.</li>
<li><em><tt>general_zenpage_utilities($html, $zenpage_object)</tt></em> [1.2.6]<br />
Used to insert items into &#8220;General&#8221; action box on the article and pages edit tabs.</li>
<li><em><tt>new_page($message, $pageobject)</tt></em> [1.2.6]<br />
Called just before saving a new Zenpage page.</li>
<li><em><tt>update_page($message, $pageobject, $oldtitlelink)</tt></em> [1.2.6]<br />
Called just before updating an existing Zenpage page.</li>
<li><em><tt>new_article($message, $pageobject)</tt></em> [1.2.6]<br />
Called just before saving a new Zenpage aticle.</li>
<li><em><tt>update_article($message, $pageobject, $oldtitlelink)</tt></em> [1.2.6]<br />
Called just before updating an existing Zenpage page.</li>
<li><em><tt>admin_utilities_buttons($buttons)</tt></em> [1.2.7]<br />
Called just before the Utilities functions buttons are displayed. Use this filter to add buttons to the admin overview page.</li>
<li><em><tt>admin_overview_left($discard)</tt></em> [1.2.9]<br />
Called at the bottom of the left column on the admin overview page.</li>
<li><em><tt>admin_overview_right($discard)</tt></em> [1.2.9]<br />
Called at the bottom of the right column on the admin overview page.</li>
<li><em>setupTheme ($theme)</em> [1.2.7]<br />
Called just after the current theme is determined. Use this filter to redirect to a different theme.</li>
<li><em>album_reefresh ($album_object)</em> [1.2.7]<br />
Invoked just after Zenphoto saves an album object during a metadate refresh.</li>
<li><em>image_refresh  ($image_object)</em> [1.2.5]<br />
Invoked just after Zenphoto saves an image object during a metadate refresh.</li>
<li><em>Image HTML handling filters</em> [1.2.7]<br />
These filters are called passing the <em>img src</em> HTML so that custom processing can be done. <em><tt>reflection_custom_images</tt></em> passes an additional parameter describing if the image is to be considered a <em>thumbnail</em></p>
<ul>
<li><em><tt>reflection_std_images</tt></em></li>
<li><em><tt>reflection_custom_images</tt></em></li>
<li><em><tt>reflection_std_image_thumbs</tt></em></li>
<li><em><tt><em><tt>reflection_std_album_thumbs</tt></em></tt></em></li>
<li><em><tt>reflection_custom_album_thumbs</tt></em></li>
</ul>
</li>
<li><em>check_upload_quota($current_error, $filepath)</em> [1.3.0]</li>
<li><em>get_upload_limit()</em> [1.3.0]</li>
<li><em>get_upload_header_text($default_text)</em> [1.3.0]</li>
<li><em>upload_helper_js($defaultJS)</em> [1.3.0]</li>
<li><em>upload_filetypes($types)</em> [1.3.0]<br />
These filters are used by the admin-upload scripts to implement a file size quota system.</li>
<li><em>load_theme_script($path)</em> [1.3.0]<br />
Called just before a theme page is loaded.</li>
<li><em>isMyItem($no)</em> [1.3.0]</li>
<li><em>checkForGuest($auth)</em> [1.3.0]<br />
These filters are used for password protection of zenphoto items.</li>
<li><em>load_request()</em> [1.3.0]<br />
This filter is called just befor processing a front-end page load</li>
<li><em>comment_form_data($data_and_disable)</em> [1.3.0]<br />
This filter is called prior to populating the comment form. <em>$data_and_disable </em>is a two dimensional array. Element <tt>data</tt> is an array containing the data which will be placed in the form. Element <tt>disabled</tt> is an array used for enabling and disabling of the form fields.</li>
<li><em>admin_managed_album_access($allow,$return)</em> [1.3.1]<br />
Called when access to an album is being denied.</li>
<li><em>admin_XSRF_access($discard,$access)</em> [1.3.1]</li>
<li>Called when a Cross Site Request Forgery has been intercepted.</li>
<li><em>admin_log_actions($file,$action)</em> [1.3.1]<br />
Called when a log has been deleted or reset.</li>
<li>texteditor_config($editorConfig, $mode) [1.3.1]<br />
Called to configure an external editor (e.g. TinyMCE) for use on the admin pages.</li>
<li>log_setup($success,$action,$details)[1.3.1]<br />
called to record setup actions that might be of interest.</li>
<li><em>theme_head</em> [1.3.2]<br />
Themes will invoke this filter just after they emit the &lt;head&gt; HTML tag.</li>
<li>theme_body_open [1.3.2]<br />
Themes will invoke this filter just after the &lt;body&gt; HTML tag.</li>
<li>theme_body_close [1.3.2]<br />
Themes will invoke this filter just before the &lt;/body&gt; HTML tag.</li>
</ul>
<p>You find some example or template filter plugins to build your own here:<br />
<a title="http://www.zenphoto.org/category/extensions/example-plugins/" href="http://www.zenphoto.org/category/extensions/example-plugins/">http://www.zenphoto.org/category/extensions/example-plugins/</a></p>
<h4><a name="plugin-options"></a>Plugin options</h4>
<p>Plugins may choose to have options that modify their behavior. These options are implemented through the options interface object. To support options, the plugin must declare a class which contains at least the following interface functions:</p>
<ul>
<li><tt>getOptionsSupported()</tt></li>
<li><tt>handleOptions()</tt></li>
</ul>
<p>Additionally, the class instantiation function should make calls on <tt>setOptionDefault()</tt> to initialize default values for all the options the plugin uses.</p>
<p><strong><tt>getOptionsSupported ()</tt></strong> is called from admin Options tab. It returns an array of the option names the theme supports.</p>
<p>The array is indexed by the option name. The value for each option is an array of elements for each option. Each element contains the option <tt>key</tt>, <tt>option type</tt>, <tt>multi-lingual</tt> and <tt>texteditor</tt> <em>flags</em>, and <tt>option description</tt>. (the <tt>multi-lingual</tt> flag is used only for options of type <em>text</em>, see bellow.) For the option names to be translatable, the key for the array element should be a &#8220;gettext()&#8221; call with a parameter of the display value of the option name. Also the description should be enclosed in a &#8220;gettext()&#8221; call. An example of an option array element is:<br />
<code><br />
gettext('My Option') =&gt; array('key' =&gt; 'my_option_key', 'type' =&gt; OPTION_TYPE_RADIO<br />
'buttons' =&gt; array(gettext(«button text») =&gt; «button value»,...),<br />
'selections' =&gt; array(gettext(«selector text») =&gt; «selector value»,...),<br />
'multilingual' =&gt; 1,<br />
'texteditor' =&gt; 1,<br />
'desc' =&gt; gettext('descripton telling what this options is about.'))<br />
</code><br />
The values for the type are:</p>
<ul>
<li><tt>'type' =&gt; OPTION_TYPE_TEXTBOX</tt> says for admin to use a standard textbox for the option</li>
<li><tt>'type' =&gt; OPTION_TYPE_CHECKBOX</tt> says for admin to use a standard checkbox for the option</li>
<li><tt>'type' =&gt; OPTION_TYPE_CUSTOM</tt> will cause admin to call handleOption() to generate the HTML for the option</li>
<li><tt>'type' =&gt; OPTION_TYPE_TEXTAREA</tt> will cause admin to use a standard textarea for the option (version 1.2.1)</li>
<li><tt>'type' =&gt; OPTION_TYPE_RADIO</tt> will cause admin to use radio buttons for the option (version 1.2.1)</li>
<li><tt>'type' =&gt; OPTION_TYPE_SELECTOR</tt> will cause admin to use a standard selector for the option (version 1.2.1)</li>
<li><tt>'type' =&gt; OPTION_TYPE_CHECKBOX_ARRAY</tt> will produce an array of checkboxeds (version 1.2.3)</li>
<li><tt>'type' =&gt; OPTION_TYPE_CHECKBOX_UL</tt> will produce an unorder  list of checkboxs (version 1.2.3)</li>
<li><tt>'type' =&gt; OPTION_TYPE_COLOR_PICKER</tt> will produce a Color picker (version 1.2.4)</li>
<li><tt>'type' =&gt; OPTION_TYPE_CLEARTEXT </tt>is like OPTION_TYPE_TEXTBOX but the POST processing does not &#8220;cleanse&#8221; the posted value. (version 1.2.7)</li>
</ul>
<p>For <span style="font-family: Courier New;">textarea</span> and for a <tt>textbox</tt> where the <tt>'multilingual'</tt> element in the array has a value of 1 these fields will be presented as <em>multi-lingual</em> input fields. That is, there will be a <tt>textbox/textarea</tt> for each of zenphoto&#8217;s supported languages. (This does assume that the global <tt>multi-lingual </tt>option has been selected.) When this option is displayed in a theme, <tt>get_language_string()</tt> must be used to isolate the appropriate language string for display. <tt>'texteditor'</tt> can be associated with type &#8216;3&#8242; options. If set it will attempt to attach a text editor to the textarea. (This is a version 1.2.2 feature and requires also that a texteditor be configured.) <tt>'buttons'</tt> is the set of radio buttons to display. <tt>'selector'</tt> is the list of options for the selection. <tt>'buttons'</tt> and <tt>'selector'</tt> are required only for type OPTION_TYPE_RADIO and type OPTION_TYPE_SELECTOR options respectively. For types OPTION_TYPE_CHECKBOX_ARRAY and OPTION_TYPE_CHECKBOX_UL <tt>'checkboxes'</tt> is the list of checkboxes.</p>
<p><strong><tt>handleOption($option, $currentValue)</tt></strong> is called when the &#8216;type&#8217; value of an option is &#8216;2&#8242; and must generate the HTML for the option user interface.</p>
<ul>
<li><tt>$option</tt> is the key name of the option being processed</li>
<li><tt>$currentValue</tt> is the &#8220;before&#8221; value of the option</li>
</ul>
<h4><a name="plugin-translation"></a>Separate plugin translations</h4>
<p>If you provide a theme as a third party, it&#8217;s translation is naturally not included with Zenphoto&#8217;s general translation file. But with Zenphoto 1.2 you can have an independent translation file for your plugin. Zenphoto uses gettext for translations. Please visit our<a title="translating tutorial" href="http://www.zenphoto.org/2008/05/translating-tutorial/"> translating tutorial</a> for more detailed information about that.</p>
<p>To set up your plugin for separate gettext translation, you just need to place the following function on top of the plugin file or on each file if you plugin consists of several files:</p>
<p><tt>&lt;?php setPluginDomain("&lt;plugin name&gt;"); ?&gt;</tt></p>
<p>This function tells Zenphoto that this plugin uses it&#8217;s own translation.</p>
<p>If your plugin consists of just one single file &lt;plugin name&gt;.php, you have to create an additional folder of the same name next to the plugin file. Use exact this folder setup:</p>
<p><code>/plugins/&lt;plugin name&gt;/locale/<br />
/plugins/&lt;plugin name&gt;/<tt>locale/</tt><tt>&lt;language locale&gt;/LC_MESSAGES/<br />
/plugins/&lt;plugin name&gt;/</tt><tt>locale/</tt><tt>&lt;language locale&gt;/LC_MESSAGES/</tt><tt>&lt;plugin name&gt;.po</tt><tt>/plugins/&lt;plugin name&gt;/</tt><tt>locale/</tt><tt>&lt;language locale&gt;/LC_MESSAGES/</tt><tt>&lt;plugin name&gt;.mo</tt></code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.zenphoto.org/2010/08/zenphoto-plugin-architecture/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Theming Tutorial</title>
		<link>http://www.zenphoto.org/2010/08/theming-tutorial/</link>
		<comments>http://www.zenphoto.org/2010/08/theming-tutorial/#comments</comments>
		<pubDate>Sat, 14 Aug 2010 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>
<p>The already mentioned template functions generate predefined HTML output for your convenience. These are the functions that generally beginn with <em>&#8220;print</em>&#8220;. You can style that via CSS to your needs. These function generate code that follows the XHTML 1.1 transitional standard.</p>
<p>Of course for advanced users it is also possible to get the pure data to setup your own html output using custom functions for more flexibility. You can read an introduction on this later in this tutorial.</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 zp_apply_filter('theme_head); ?&gt;
&lt;?php zp_apply_filter('theme_body_open); ?&gt;
&lt;?php zp_apply_filter('theme_body_close); ?&gt;</pre>
<p>The Zenphoto template functions and many plugins require certain HTML entries in the HTML &#8221;head&#8221; section of your theme script files. Place &#8221;theme_head&#8221; line the above just after the &lt;head&gt; directive in your script. This replaces the call on zenJavascript() of Zenphoto releases prior to v1.3.2. That function is now deprecated.</p>
<p>Likewise, some plugins will need to place their code either at the beginning or at the end of the HTML &#8220;body&#8221;. Place the &#8220;theme_body_open&#8221; line just after the &lt;body&gt; directive and the &#8220;theme_body_close&#8221; line just before the &lt;/body&gt; directive.</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.</p>
<p>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/2010/08/theming-tutorial/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<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>
<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). A project page on code hosting services like Google Code, Github or the like is of course fine.</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 via backend
Yes


Multifile upload
Yes, including .zip files containing supported [...]]]></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>
<table rules="rows">
<tbody>
<tr>
<td><strong>Upload via backend</strong></td>
<td>Yes</td>
</tr>
<tr>
<td><strong>Multifile upload</strong></td>
<td>Yes, including .zip files containing supported file types</td>
</tr>
<tr>
<td><strong>Upload images and folders via FTP</strong></td>
<td>Yes</td>
</tr>
<tr>
<td><strong>Automatically generated sized images</strong></td>
<td>Yes</td>
</tr>
<tr>
<td><strong>Automatically generated thumbnails</strong></td>
<td>Yes (for recognized image files)</td>
</tr>
<tr>
<td><strong>Custom thumb crops possible</strong></td>
<td>Yes (for recognized image files)</td>
</tr>
<tr>
<td><strong>EXIF/IPTC metadata support</strong></td>
<td>Yes</td>
</tr>
<tr>
<td><strong>Drag &amp; Drop sorting of albums and images</strong></td>
<td>Yes</td>
</tr>
<tr>
<td><strong>Moving, copying, renaming of albums and images</strong></td>
<td>Yes</td>
</tr>
<tr>
<td><strong>Google maps</strong></td>
<td>Yes*</td>
</tr>
<tr>
<td><strong>Image and album rating</strong></td>
<td>Yes*</td>
</tr>
<tr>
<td><strong>Slideshow</strong></td>
<td>Yes*</td>
</tr>
<tr>
<td><strong>Comments</strong></td>
<td>Yes*</td>
</tr>
<tr>
<td><strong>Comment spam filter support</strong></td>
<td>Yes*</td>
</tr>
<tr>
<td><strong>Front-end editing<br />
</strong></td>
<td>Yes, partly</td>
</tr>
<tr>
<td><strong>Tags</strong></td>
<td>Yes</td>
</tr>
<tr>
<td><strong>RSS</strong></td>
<td>Yes</td>
</tr>
<tr>
<td><strong>Password protection</strong></td>
<td>Yes***</td>
</tr>
<tr>
<td><strong>Multiple user management with varying rights</strong></td>
<td>Yes</td>
</tr>
<tr>
<td><strong>Watermark</strong></td>
<td>Yes</td>
</tr>
<tr>
<td><strong>Image or album number limit</strong></td>
<td>No, only limited by your server&#8217;s space and power</td>
</tr>
</tbody>
</table>
<h4>CMS management (via the official Zenpage CMS plugin)</h4>
<table rules="rows">
<tbody>
<tr>
<td><strong>Custom pages management incl. subpages</strong></td>
<td>Yes</td>
</tr>
<tr>
<td><strong>Drag &amp; drop page sorting</strong></td>
<td>Yes</td>
</tr>
<tr>
<td><strong>News section (blog) with categories</strong></td>
<td>Yes</td>
</tr>
<tr>
<td><strong>Automatic post of new gallery items in news section (blog)</strong></td>
<td>Yes, bascially, using the CombiNews<br />
mode</td>
</tr>
<tr>
<td><strong>Scheduled news publishing</strong></td>
<td>Yes</td>
</tr>
<tr>
<td><strong>RSS for news articles</strong></td>
<td>Yes</td>
</tr>
<tr>
<td><strong>Tags for pages and news</strong></td>
<td>Yes</td>
</tr>
<tr>
<td><strong>Comments on news articles and pages</strong></td>
<td>Yes</td>
</tr>
<tr>
<td><strong>Password protection for pages and news categories</strong></td>
<td>Yes</td>
</tr>
<tr>
<td><strong>Possibility to use gallery images in news articles or pages</strong></td>
<td>Yes, via the TinyMCE plugin tinyZenpage manually</td>
</tr>
<tr>
<td><strong>File manager for none gallery files</strong></td>
<td>Yes</td>
</tr>
</tbody>
</table>
<h4>Supported media formats</h4>
<table rules="rows">
<tbody>
<tr>
<td><strong>Image formats</strong></td>
<td>.jpg, .gif, .png (all formats your server&#8217;s graphics libary supports)</td>
</tr>
<tr>
<td><strong>Video formats</strong></td>
<td>.mp4*, .flv*, .mov**, .3gp**</td>
</tr>
<tr>
<td><strong>Audio formats</strong></td>
<td>.mp3*</td>
</tr>
<tr>
<td><strong>Other formats</strong></td>
<td>.txt*,.html*</td>
</tr>
</tbody>
</table>
<h4>Internationalization/localization</h4>
<table rules="rows">
<tbody>
<tr>
<td><strong>Admin backend translatable</strong></td>
<td>Yes (gettext server support required)</td>
</tr>
<tr>
<td><strong>Multilingual sites</strong></td>
<td>Yes</td>
</tr>
</tbody>
</table>
<h4>Theming/Templates</h4>
<table rules="rows">
<tbody>
<tr>
<td><strong>Highly customizable theme engine</strong></td>
<td>Yes, XHTML transitional (XHTML, CSS, PHP knowledge required)</td>
</tr>
<tr>
<td><strong>Predefined themes available</strong></td>
<td>Yes. Four standard themes included in the release, more 3rd party ones available</td>
</tr>
<tr>
<td><strong>Object model framework for advanced theming and  flexibility<br />
</strong></td>
<td>Yes (Advanced PHP knowledge required)</td>
</tr>
<tr>
<td><strong>Album themes</strong></td>
<td>Yes, each top level album can be assigned to a different theme</td>
</tr>
</tbody>
</table>
<h4>More general features</h4>
<table rules="rows">
<tbody>
<tr>
<td><strong>Extendable via plugin system</strong></td>
<td>Yes. Many plugins included and more 3rd party ones available</td>
</tr>
<tr>
<td><strong>SEO sitemap</strong></td>
<td>Yes*</td>
</tr>
<tr>
<td><strong>SEO friendly urls with mod_rewrite</strong></td>
<td>Yes</td>
</tr>
<tr>
<td><strong>Static HTML cache</strong></td>
<td>Yes*</td>
</tr>
<tr>
<td><strong>Contact form</strong></td>
<td>Yes*</td>
</tr>
<tr>
<td><strong>Custom menus</strong></td>
<td>Yes*</td>
</tr>
<tr>
<td><strong>Site search with boolean expressions</strong></td>
<td>Yes</td>
</tr>
<tr>
<td><strong>Dynamic albums based on search queries</strong></td>
<td>Yes</td>
</tr>
<tr>
<td><strong>Default inline text editor for descriptions etc.</strong></td>
<td>Yes, TinyMCE*</td>
</tr>
<tr>
<td><strong>Gallery statistics</strong></td>
<td>Yes</td>
</tr>
<tr>
<td><strong>Wordpress import</strong></td>
<td>Yes, partly</td>
</tr>
</tbody>
</table>
<p><em>* via official plugins; extendable via custom plugins<br />
**  handled by your browser if available<br />
*** to protect your full images uploaded themselves manual .htaccess additions are<br />
needed. Password protection protects only the page display.</em></p>
<p>Zenphoto uses:</p>
<ul>
<li><a href="http://jquery.com/">jQuery and jQuery UI</a></li>
<li><a href="http://tinymce.moxiecode.com/index.php">TinyMCE text editor</a> with <a href="http://www.phpletter.com/Demo/Ajax-File--Manager/">Ajax File Manager</a></li>
<li><a href="http://www.famfamfam.com/lab/icons/silk/">FamFamFam silk icons</a></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/integrating-zenphoto-into-wordpress-tutorials/</link>
		<comments>http://www.zenphoto.org/2009/11/integrating-zenphoto-into-wordpress-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[A collection of various third party tutorials:

This tutorial is already from 2006 but still applicable:
http://www.ruzee.com/blog/2006/06/integrating-zenphoto-into-wordpress 
Einar Regilsson also provided some premade files based on the tutorial above here: http://tech.einaregilsson.com/2007/08/06/integrating-zenphoto-into-wordpress/
A Zenphoto theme tutorial with the Wordpress navigation:
http://www.natenewz.com/2009/10/13/integrating-zenphoto-and-wordpress/
http://www.sparkhunt.co.uk/2009/11/a-basic-wordpress-and-zenphoto-integration/
http://www.sparkhunt.co.uk/2009/11/404-errors-when-integrating-zenphoto-with-wordpress/
http://www.strangerpixel.com/2007/06/integrating-zenphoto-with-wordpress-on-iis/
http://www.rektproductions.com/adding-a-zenphoto-gallery-to-your-wordpress/

Take also a look at Zenphoto as a &#8220;plugin&#8221; (not working with current Wordpress versions anymore)
]]></description>
			<content:encoded><![CDATA[<p>A collection of various third party tutorials:</p>
<ul>
<li>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></li>
<li>Einar Regilsson also provided some premade files based on the tutorial above 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></li>
<li>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></li>
<li><a href="http://www.sparkhunt.co.uk/2009/11/a-basic-wordpress-and-zenphoto-integration/">http://www.sparkhunt.co.uk/2009/11/a-basic-wordpress-and-zenphoto-integration/</a></li>
<li><a href="http://www.sparkhunt.co.uk/2009/11/404-errors-when-integrating-zenphoto-with-wordpress/">http://www.sparkhunt.co.uk/2009/11/404-errors-when-integrating-zenphoto-with-wordpress/</a></li>
<li><a href="http://www.strangerpixel.com/2007/06/integrating-zenphoto-with-wordpress-on-iis/">http://www.strangerpixel.com/2007/06/integrating-zenphoto-with-wordpress-on-iis/</a></li>
<li><a href="http://www.rektproductions.com/adding-a-zenphoto-gallery-to-your-wordpress/">http://www.rektproductions.com/adding-a-zenphoto-gallery-to-your-wordpress/</a></li>
</ul>
<p><span style="text-decoration: line-through;">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></span> (not working with current Wordpress versions anymore)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.zenphoto.org/2009/11/integrating-zenphoto-into-wordpress-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>1</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>Zenphoto&#8217;s search engine also includes articles and pages. If it does not work and you are using none of the standard themes it might not be implemented in your theme. See the <a title="http://www.zenphoto.org/2009/03/theming-tutorial/" href="../2009/03/theming-tutorial/">theming  tutorial</a> how to implement this.</p>
<h4><a name="15"></a>Can I use tags from Zenphoto on my news articles?</h4>
<p>Yes, Zenpage supports tags for news articles as well as pages.</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.</p>
</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>, a default plugin to the by default enabled text editor TinyMCE<em>,</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>.</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>Note since news articles are only sorted by date the CombiNews might lead to unexpected results if you set the image sortorder to &#8220;id&#8221;. Try using &#8220;date&#8221; or &#8220;mtime&#8221;.</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>
<li><a title="http://www.zenphoto.org/zp/theme/zpGalleriffic/subpages.jpg.php" href="http://www.zenphoto.org/zp/theme/zpGalleriffic/subpages.jpg.php"> zpGalleriffic</a> (third party)</li>
<li><a title="http://www.zenphoto.org/zp/theme/zinenaboxpacity/zinenaboxpacity-page.jpg.php" href="http://www.zenphoto.org/zp/theme/zinenaboxpacity/zinenaboxpacity-page.jpg.php">zinenaboxpacity</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>
	</channel>
</rss>
