0byt3m1n1
Path:
/
data
/
applications
/
aps.bak
/
coppermine
/
1.5.12-0
/
standard
/
htdocs
/
docs
/
se
/
[
Home
]
File: theme_theme_php.htm
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" dir="ltr"> <head> <title>theme.php - Coppermine Photo Gallery - Documentation & Manual</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta name="language" content="en" /> <meta name="copyright" content="Coppermine dev team" /> <meta name="description" content="Coppermine comes with a powerful engine that allows you to create your own theme, giving your gallery a unique look that matches the overall layout of your entire site. To make sure your custom theme does not get overwritten when upgrading, you should start with a custom theme name." /> <meta http-equiv="Content-Style-Type" content="text/css" /> <meta name="MSSmartTagsPreventParsing" content="true" /> <meta http-equiv="imagetoolbar" content="no" /> <!-- SVN version info: Coppermine version: 1.5.12 $HeadURL: https://coppermine.svn.sourceforge.net/svnroot/coppermine/trunk/cpg1.5.x/docs/se/theme_theme_php.htm $ $Revision: 8154 $ --> <link rel="stylesheet" type="text/css" href="../style/style.css" media="all" /> <link rel="stylesheet" type="text/css" href="../style/screen.css" media="screen" /> <link rel="stylesheet" type="text/css" href="../style/print.css" media="print" /> <link rel="shortcut icon" href="../favicon.ico" /> <script src="../js/jquery.js" type="text/javascript"></script> <script src="../js/jquery.treeview.js" type="text/javascript"></script> <script src="script.js" type="text/javascript"></script> </head> <body> <h1 id="docheader">Coppermine Photo Gallery v1.5.x: Documentation and Manual</h1> <div id="toc"> <a href="toc.htm">Table of Contents</a> </div> <div id="doc_en_only">No translation available</div> <a name="theme_php"></a><h1>Editing theme.php<a href="#theme_php" title="Link to this section"><img src="images/anchor.gif" width="15" height="9" border="0" alt="" /></a></h1> <p>Every theme comes with the file theme.php. However, for most themes, the file is nearly empty. The reason for that is that only things that <strong>differ</strong> from Coppermine's default behaviour needs to be described in theme.php. Things that are suppossed to work "the usual Coppermine way" are being defined in the core code - your custom theme's theme.php contains the variables and function definitions that override the identical items in the default core.</p> <p>The "<strong>theme.php</strong>" file contains all the HTML templates used by the script. You can edit them, as well. When making modifications to these templates, be careful that you do not alter the lines that start with <tt class="code"><!-- BEGIN xxx --></tt> and <tt class="code"><!-- END xxx --></tt>. These lines are often used to identify the start and end of specific code blocks that the script will use to display your gallery.</p> <a name="theme_php_types"></a><h2>Item types<a href="#theme_php_types" title="Link to this section"><img src="images/anchor.gif" width="15" height="9" border="0" alt="" /></a></h2> <p>Basically, there can be three types of content in theme.php (from a PHP-coder's point of view). Don't worry though - you don't have to be a coder to be capable to change your theme</p> <ul> <li><strong>Definitions of constants</strong><br /> Think of constants as general switches that can be set once while the script is run <div class="cpg_example"> <tt class="code">define('THEME_HAS_RATING_GRAPHICS',1);</tt></div> The constant definition always uses the PHP command <a href="http://www.php.net/manual/en/function.define.php" rel="external" class="phpnet"><tt class="code">define(...)</tt></a> and is thus easy to spot. As a coding convention, the name of constants used in Coppermine are always written in all-uppercase.</li> <li><strong>Definition of variables</strong><br /> Variables can be manipulated (i.e. changed) during runtime. The vast majority of items that can reside in theme.php are variables. Variable names always start with a $-sign. <div class="cpg_example"> <tt class="code">$template_sys_menu = <<<EOT<br /> {BUTTONS}<br />EOT;</tt></div></li> <li><strong>Definition of functions</strong><br /> Functions are the most powerfull mechanisms that can reside in theme.php, as they allow great flexibility and are re-usable. They start with the word <tt class="code">function</tt>, followed by the function name and the parameters in brackets and a curly bracket that actually determines the start of the function. The function definition usually contains several lines of code and ends with a closing curly bracket. <div class="cpg_example"> <tt class="code">function endtable()<br /> {<br /> echo <<<EOT<br /> </table><br /> <!-- End standard table --><br /> <br /> EOT;<br /> }</tt></div></li> </ul> <a name="theme_php_types_end"></a> <a name="theme_sample"></a><h2>The sample theme - a template to copy from<a href="#theme_sample" title="Link to this section"><img src="images/anchor.gif" width="15" height="9" border="0" alt="" /></a></h2> <p>Your Coppermine installation also includes a "sample" theme directory. The "sample" theme includes each of these files but does not show up in the user selectable list of themes in your Coppermine display. Sample's theme.php also holds a copy of every themeable function and template for your reference. If you opt to use the "sample" theme to begin creating your own theme, you should follow the theme.php instructions in the "<a href="theme_upgrade_14x-15x.htm">theme upgrade documentation</a>" and begin with a blank theme.php.</p> <p class="cpg_message_error">To clarify: you <strong>mustn't</strong> edit the sample theme (as it will not be displayed), but copy the sections you want to see changed from it into your custom theme. Do <strong>not</strong> copy the whole content from themes/sample/theme.php into your custom theme, as this will only clutter your custom theme and will make upgrading very hard in the future. Instead, only copy the sections you want to modify from <tt class="code">themes/sample/theme.php</tt> into <tt class="code">themes/yourtheme/theme.php</tt>.</p> <p>This being said: you mustn't start your custom theme by copying the sample theme - start with a vanilla (i.e. empty!) theme.php instead. Only use themes/sample/theme.php to copy individual sections that you want to modify into your custom theme and then modify it.</p> <p>Newbies often have issues to understand what a "section" is that they need to copy from the sample theme - if you don't know much about PHP, it's sometimes hard to understand where a function definition starts and where it ends. That's why we have "wrapped" the individual sections that contain more than one line into comment blocks that try to catch your attention: a section starts with the block <pre>/****************************************************************************** ** Section <<<section_name>>> - START ******************************************************************************/</pre> and ends with <pre>/****************************************************************************** ** Section <<<section_name>>> - END ******************************************************************************/</pre> where the name of the section (<tt class="code">section_name</tt> in above example) is identical both in the start-block as well as the end-block.</p> <p>The place where you insert the section you copied from the sample theme in your custom theme doesn't matter as long as you take care not to paste it within another section, but before or after a section that exists in your custom theme. As a rule of thumb, you can savely paste a section into a new line before <tt class="code">?></tt> in your custom theme (<tt class="code">themes/yourtheme/theme.php</tt>)</p> <a name="theme_sample_end"></a> <a name="theme_php_method"></a><h2>Method<a href="#theme_php_method" title="Link to this section"><img src="images/anchor.gif" width="15" height="9" border="0" alt="" /></a></h2> <p>The method behind all theme.php editing is really quite easy - just follow these simple steps:</p> <ul> <li><strong>Determine what section needs to be edited</strong><br /> There are many different ways how to find that out: <ul> <li>You found a corresponding posting on the Coppermine support board</li> <li>You figured out by looking at the table "<a href="theme_php_list">List of items in theme.php</a>"</li> <li>Another part of this documentation says so</li> <li>A friend told you so</li> <li>...</li> </ul> </li> <li><strong>Find out if that section already exists in your custom theme:</strong><br /> (Your favorite <a href="dev_tools.htm#dev_tools_editor">plain-text editor</a> should have a search function. Notepad.exe has got one as well) <ul> <li>If yes, edit themes/yourtheme/theme.php. No copying from the sample theme needed</li> <li>If no, open themes/sample/theme.php with a <a href="dev_tools.htm#dev_tools_editor">plain-text editor</a>, find the section that needs editing, highlight and copy it, then paste it into a new line before <tt class="code">?></tt> of <tt class="code">themes/yourtheme/theme.php</tt>. Then edit the stuff you pasted in as you see fit.</li> </ul> </li> </ul> <a name="theme_php_scope"></a><h2>Scope<a href="#theme_php_scope" title="Link to this section"><img src="images/anchor.gif" width="15" height="9" border="0" alt="" /></a></h2> <p>So, what can actually be accomplished by editing theme.php? Well, the sky is the limit: only your imagination can be limited, but the scope of possible edits in theme.php is endless. However, users usually ask for the same five or six features or changes all the time. That's why we have created a page with <a href="theme_examples.htm#theme_examples">theme examples</a> where the most common edits to theme.php are being explained - make sure to have read those examples thoroughly before starting another request on the coppermine support board where you might just be told that you should read the docs...</p> <p class="cpg_message_success">We're really trying to focus your attention to this block: please read the <a href="theme_examples.htm#theme_examples">theme examples</a> page after having read this page.</p> <a name="theme_php_list"></a><h2>List of items in theme.php<a href="#theme_php_list" title="Link to this section"><img src="images/anchor.gif" width="15" height="9" border="0" alt="" /></a></h2> <table border="0" cellspacing="0" cellpadding="0" class="cpg_zebra"> <tr> <th valign="top" align="left">Item</th> <th valign="top" align="left">Type</th> <th valign="top" align="left">Description</th> <th valign="top" align="left">Dependancies</th> </tr> <tr> <td valign="top"><a name="theme_create_theme_progress"></a>define('<strong>THEME_HAS_PROGRESS_GRAPHICS</strong>',1);<a href="#theme_create_theme_progress" title="Link to this section"><img src="images/anchor.gif" width="15" height="9" border="0" alt="" /></a></td> <td valign="top">constant</td> <td valign="top">Coppermine displays a "loading"-icon when the upload form is being submit to indicate that there must be no user interaction while the script is busy uplading. When this constant is set, the script will fetch the "loading"-icon from the theme's images folder (themes/yourtheme/images/loader.gif). If the constant is not set, the default loader image will be used, taken from the generic images folder. When designing a theme of your own, make sure that the loader image actually exists when setting this constant.</td> <td valign="top">If defined, a file named <tt class="code">loader.gif</tt> needs to reside in the theme's images folder.</td> </tr> <tr> <td valign="top"><a name="theme_create_theme_rating_graphic"></a>define('<strong>THEME_HAS_RATING_GRAPHICS</strong>',1);<a href="#theme_create_theme_rating_graphic" title="Link to this section"><img src="images/anchor.gif" width="15" height="9" border="0" alt="" /></a></td> <td valign="top">constant</td> <td valign="top">The location for the ratings graphics. When the constant is set, the script will be directed to the theme's images folder, i.e. themes/yourtheme/images/ and look for the rating images there. If not defined (default), the rating images will be taken from the images-folder that resides in Coppermine's root folder.</td> <td valign="top"> <a href="theme_graphics.htm#theme_graphics_rating">Graphic resources in themes → Rating images</a> </td> </tr> <tr> <td valign="top"><a name="theme_create_theme_menu_icon"></a>define('<strong>THEME_HAS_MENU_ICONS</strong>',16);<a href="#theme_create_theme_menu_icon" title="Link to this section"><img src="images/anchor.gif" width="15" height="9" border="0" alt="" /></a></td> <td valign="top">constant</td> <td valign="top">The location for the menu icon graphics that are being displayed if the config option "<a href="configuration.htm#admin_enable_menu_icons">Enable menu icons</a>" has been turned on. When the constant is set, the script will be directed to the theme's images folder, subfolder 'icons', i.e. <tt class="code">themes/yourtheme/images/icons/</tt> and look for the menu icon images there. If not defined (default), the menu icon images will be taken from <tt class="code">images/icons/</tt>. Unlike most other custom theme constants, the value you assign to the constant <em>does</em> matter in this case: set it to the size (in pixels) that your custom icons have. The custom icons (as well as the default icons) need to be square in shape.<br />If you decide to use your own set of menu icons for your custom theme, it's advisable to copy the folder <tt class="code">images/icons/</tt> into <tt class="code">themes/yourtheme/images/</tt> to have a set of defaults and then start modifying your custom menu items one by one.</td> <td valign="top"></td> </tr> <tr> <td valign="top"><a name="theme_create_theme_navbar_graphic"></a>define('<strong>THEME_HAS_NAVBAR_GRAPHICS</strong>',1);<a href="#theme_create_theme_navbar_graphic" title="Link to this section"><img src="images/anchor.gif" width="15" height="9" border="0" alt="" /></a></td> <td valign="top">constant</td> <td valign="top">The location for the navbar graphics ("ecard", "slideshow", "previous"/"next"). When the constant is set, the script will be directed to the theme's images folder, i.e. themes/yourtheme/images/ and look for the navbar images there. If not defined (default), the navbar images will be taken from the images-folder that resides in Coppermine's root folder.</td> <td valign="top"> <a href="theme_graphics.htm#theme_graphics_nav_bar">Graphic resources in themes → Image Navigation bar</a> </td> </tr> <tr> <td valign="top"><a name="theme_create_theme_filmstrip_graphic"></a>define('<strong>THEME_HAS_FILM_STRIP_GRAPHIC</strong>',1);<a href="#theme_create_theme_filmstrip_graphic" title="Link to this section"><img src="images/anchor.gif" width="15" height="9" border="0" alt="" /></a></td> <td valign="top">constant</td> <td valign="top">The location for the film strip graphics. When the constant is set, the script will be directed to the theme's images folder, i.e. themes/yourtheme/images/ and look for the film strip images (tile.gif) there. If not defined (default), the film strip images will be taken from the images-folder that resides in Coppermine's root folder.</td> <td valign="top"> If defined, a file named <tt class="code">tile.gif</tt> needs to reside in the theme's images folder. [<a href="theme_graphics.htm#theme_graphics_film_strip">Details</a>] </td> </tr> <tr> <td valign="top"><a name="theme_create_theme_filmstrip_graphics"></a>define('<strong>THEME_HAS_FILM_STRIP_GRAPHICS</strong>',1);<a href="#theme_create_theme_filmstrip_graphics" title="Link to this section"><img src="images/anchor.gif" width="15" height="9" border="0" alt="" /></a><br />(Mind the trailing <em>S</em> that makes the only difference to the above constant <a href="#theme_create_theme_filmstrip_graphic">THEME_HAS_FILM_STRIP_GRAPHIC</a>)</td> <td valign="top">constant</td> <td valign="top">The location for the film strip graphics. When the constant is set, the script will be directed to the theme's images folder, i.e. themes/yourtheme/images/ and look for the film strip images (tile1.gif for the top tile and tile2.gif for the bottom tile) there. If not defined (default), the film strip images will be taken from the images-folder that resides in Coppermine's root folder.</td> <td valign="top"> If defined, a file named <tt class="code">tile1.gif</tt> and a file named <tt class="code">tile2.gif</tt> need to reside in the theme's images folder. [<a href="theme_graphics.htm#theme_graphics_film_strip">Details</a>] </td> </tr> <tr> <td valign="top"><a name="theme_create_theme_no_sysmenu"></a>define('<strong>THEME_HAS_NO_SYS_MENU_BUTTONS</strong>',1);<a href="#theme_create_theme_no_sysmenu" title="Link to this section"><img src="images/anchor.gif" width="15" height="9" border="0" alt="" /></a></td> <td valign="top">constant</td> <td valign="top">When present the system won't attempt to replace {BUTTONS} in the SYS_MENU template</td> <td valign="top"></td> </tr> <tr> <td valign="top"><a name="theme_create_theme_no_submenu"></a>define('<strong>THEME_HAS_NO_SUB_MENU_BUTTONS</strong>',1);<a href="#theme_create_theme_no_submenu" title="Link to this section"><img src="images/anchor.gif" width="15" height="9" border="0" alt="" /></a></td> <td valign="top">constant</td> <td valign="top">When present the system won't attempt to replace {BUTTONS} in the SUB_MENU template</td> <td valign="top"></td> </tr> <tr> <td valign="top"><a name="theme_create_theme_assemble_button"></a>function <strong>assemble_template_buttons</strong>(<em>$template_buttons,$buttons</em>)<a href="#theme_create_theme_assemble_button" title="Link to this section"><img src="images/anchor.gif" width="15" height="9" border="0" alt="" /></a></td> <td valign="top">function</td> <td valign="top">Creates buttons from a template using an array of tokens this function is used in this file it needs to be declared before being called.</td> <td valign="top"></td> </tr> <tr> <td valign="top"><a name="theme_create_theme_addbutton"></a>function <strong>addbutton</strong>(<em>&$menu,$href_lnk,$href_title,$href_tgt,$block_id,$spacer</em>)<a href="#theme_create_theme_addbutton" title="Link to this section"><img src="images/anchor.gif" width="15" height="9" border="0" alt="" /></a></td> <td valign="top">function</td> <td valign="top">Creates an array of tokens to be used with function assemble_template_buttons this function is used in this file it needs to be declared before being called.</td> <td valign="top"></td> </tr> <tr> <td valign="top"><a name="theme_create_theme_pageheader"></a>function <strong>pageheader</strong>(<em>$section, $meta = ''</em>)<a href="#theme_create_theme_pageheader" title="Link to this section"><img src="images/anchor.gif" width="15" height="9" border="0" alt="" /></a></td> <td valign="top">function</td> <td valign="top">Function for writing a pageheader. The first parameter <em>$section</em> should not be touched. The second parameter <em>$meta</em> can be used to add your custom dynamic meta tags. To add static meta tags, edit <a href="theme_template.htm#theme_template_html">template.html</a></td> <td valign="top"></td> </tr> <tr> <td valign="top"><a name="theme_create_theme_pagefooter"></a>function <strong>pagefooter</strong>()<a href="#theme_create_theme_pagefooter" title="Link to this section"><img src="images/anchor.gif" width="15" height="9" border="0" alt="" /></a></td> <td valign="top">function</td> <td valign="top">Function for writing a pagefooter</td> <td valign="top"></td> </tr> <tr> <td valign="top"><a name="theme_create_theme_javascript_head"></a>function <strong>theme_javascript_head</strong>()<a href="#theme_create_theme_javascript_head" title="Link to this section"><img src="images/anchor.gif" width="15" height="9" border="0" alt="" /></a></td> <td valign="top">function</td> <td valign="top">Function for the JavaScript inside the <tt class="code"><head></tt>-section</td> <td valign="top"></td> </tr> <tr> <td valign="top"><a name="theme_create_theme_credits"></a>function <strong>theme_credits</strong>()<a href="#theme_create_theme_credits" title="Link to this section"><img src="images/anchor.gif" width="15" height="9" border="0" alt="" /></a></td> <td valign="top">function</td> <td valign="top">Function for the <a href="theme_copyright.htm#theme_copyright">credits-section</a></td> <td valign="top"></td> </tr> <tr> <td valign="top"><a name="theme_create_theme_starttable"></a>function <strong>starttable</strong>($width = '-1', $title = '', $title_colspan = '1')<a href="#theme_create_theme_starttable" title="Link to this section"><img src="images/anchor.gif" width="15" height="9" border="0" alt="" /></a></td> <td valign="top">function</td> <td valign="top">Function to start a 'standard' table</td> <td valign="top"></td> </tr> <tr> <td valign="top"><a name="theme_create_theme_endtable"></a>function <strong>endtable</strong>()<a href="#theme_create_theme_endtable" title="Link to this section"><img src="images/anchor.gif" width="15" height="9" border="0" alt="" /></a></td> <td valign="top">function</td> <td valign="top">End standard table</td> <td valign="top"><a href="#theme_create_theme_starttable">function starttable()</a></td> </tr> <tr> <td valign="top"><a name="theme_create_theme_mainmenu"></a>function <strong>theme_main_menu</strong>(<em>$which</em>)<a href="#theme_create_theme_mainmenu" title="Link to this section"><img src="images/anchor.gif" width="15" height="9" border="0" alt="" /></a></td> <td valign="top">function</td> <td valign="top"></td> <td valign="top"></td> </tr> <tr> <td valign="top"><a name="theme_create_theme_admin_menu"></a>function <strong>theme_admin_mode_menu</strong>()<a href="#theme_create_theme_admin_menu" title="Link to this section"><img src="images/anchor.gif" width="15" height="9" border="0" alt="" /></a></td> <td valign="top">function</td> <td valign="top"></td> <td valign="top"></td> </tr> <tr> <td valign="top"><a name="theme_create_theme_display_message_block"></a>function <strong>theme_display_message_block</strong>()<a href="#theme_create_theme_display_message_block" title="Link to this section"><img src="images/anchor.gif" width="15" height="9" border="0" alt="" /></a></td> <td valign="top">function</td> <td valign="top">Function for the theme_display_message_block. The message block (not to be confused with the admin menu) will display message carried over from one page to the other and an RSS feed from the coppermine project page for the admin. It's advisable not to change it unless you really know what you're doing. This function composes the individual sections of the block.</td> <td valign="top"></td> </tr> <tr> <td valign="top"><a name="theme_create_theme_display_cat_list"></a>function <strong>theme_display_cat_list</strong>(<em>$breadcrumb, &$cat_data, $statistics</em>)<a href="#theme_create_theme_display_cat_list" title="Link to this section"><img src="images/anchor.gif" width="15" height="9" border="0" alt="" /></a></td> <td valign="top">function</td> <td valign="top">Function to display the category list on the index page. Contains part of the core logic and hardly ever needs editing.</td> <td valign="top"></td> </tr> <tr> <td valign="top"><a name="theme_create_theme_display_breadcrumb"></a>function <strong>theme_display_breadcrumb</strong>(<em>$breadcrumb, &$cat_data</em>)<a href="#theme_create_theme_display_breadcrumb" title="Link to this section"><img src="images/anchor.gif" width="15" height="9" border="0" alt="" /></a></td> <td valign="top">function</td> <td valign="top">Function to display the breadcrumb navigation trail (often refered to as "rootline menu") that displays to the visitor in which sub structure (gallery root → category → sub-category → album) he/she is in.</td> <td valign="top"></td> </tr> <tr> <td valign="top"><a name="theme_create_theme_display_album_list"></a>function <strong>theme_display_album_list</strong>(<em>&$alb_list, $nbAlb, $cat, $page, $total_pages</em>)<a href="#theme_create_theme_display_album_list" title="Link to this section"><img src="images/anchor.gif" width="15" height="9" border="0" alt="" /></a></td> <td valign="top">function</td> <td valign="top">Function to display the album list on the index page. Contains part of the core logic and hardly ever needs editing.</td> <td valign="top"></td> </tr> <tr> <td valign="top"><a name="theme_create_theme_display_album_list_cat"></a>function <strong>theme_display_album_list_cat</strong>(<em>&$alb_list, $nbAlb, $cat, $page, $total_pages</em>)<a href="#theme_create_theme_display_album_list_cat" title="Link to this section"><img src="images/anchor.gif" width="15" height="9" border="0" alt="" /></a></td> <td valign="top">function</td> <td valign="top">Function to display first level Albums of a category</td> <td valign="top"></td> </tr> <tr> <td valign="top"><a name="theme_create_theme_display_thumbnails"></a>function <strong>theme_display_thumbnails</strong>(<em>&$thumb_list, $nbThumb, $album_name, $aid, $cat, $page, $total_pages, $sort_options, $display_tabs, $mode = 'thumb', $date=''</em>)<a href="#theme_create_theme_display_thumbnails" title="Link to this section"><img src="images/anchor.gif" width="15" height="9" border="0" alt="" /></a></td> <td valign="top">function</td> <td valign="top">Function to display thumbnails both in album view as well as category view and meta albums</td> <td valign="top"></td> </tr> <tr> <td valign="top"><a name="theme_create_theme_display_film_strip"></a>function <strong>theme_display_film_strip</strong>(<em>&$thumb_list, $nbThumb, $album_name, $aid, $cat, $pos, $sort_options, $mode = 'thumb', $date=''</em>)<a href="#theme_create_theme_display_film_strip" title="Link to this section"><img src="images/anchor.gif" width="15" height="9" border="0" alt="" /></a></td> <td valign="top">function</td> <td valign="top">Display film strip</td> <td valign="top">Only taken into account if <a href="configuration.htm#admin_image_comment_filmstrip_toggle">Show film strip</a> is enabled in config.</td> </tr> <tr> <td valign="top"><a name="theme_create_theme_function_no_img_to_display"></a>function <strong>theme_no_img_to_display</strong>(<em>$album_name</em>)<a href="#theme_create_theme_function_no_img_to_display" title="Link to this section"><img src="images/anchor.gif" width="15" height="9" border="0" alt="" /></a></td> <td valign="top">function</td> <td valign="top">Function that composes the output if an album is empty or a particular item is inaccessible for whatever reason (doesn't exist or missing permissions)</td> <td valign="top"></td> </tr> <tr> <td valign="top"><a name="theme_create_theme_display_image"></a>function <strong>theme_display_image</strong>(<em>$nav_menu, $picture, $votes, $pic_info, $comments, $film_strip</em>)<a href="#theme_create_theme_display_image" title="Link to this section"><img src="images/anchor.gif" width="15" height="9" border="0" alt="" /></a></td> <td valign="top">function</td> <td valign="top">Core layout of the intermediate image display screen (displayimage.php).</td> <td valign="top"></td> </tr> <tr> <td valign="top"><a name="theme_create_theme_html_picinfo"></a>function <strong>theme_html_picinfo</strong>(<em>&$info</em>)<a href="#theme_create_theme_html_picinfo" title="Link to this section"><img src="images/anchor.gif" width="15" height="9" border="0" alt="" /></a></td> <td valign="top">function</td> <td valign="top">Template to compose the individual lines of the pic info table underneath the intermediate image</td> <td valign="top">Pic info section needs to be expanded</td> </tr> <tr> <td valign="top"><a name="theme_create_theme_html_picture"></a>function <strong>theme_html_picture</strong>()<a href="#theme_create_theme_html_picture" title="Link to this section"><img src="images/anchor.gif" width="15" height="9" border="0" alt="" /></a></td> <td valign="top">function</td> <td valign="top">Displays a picture or any other record that resides in coppermine's database for individual view.</td> <td valign="top"></td> </tr> <tr> <td valign="top"><a name="theme_create_theme_html_img_nav_menu"></a>function <strong>theme_html_img_nav_menu</strong>()<a href="#theme_create_theme_html_img_nav_menu" title="Link to this section"><img src="images/anchor.gif" width="15" height="9" border="0" alt="" /></a></td> <td valign="top">function</td> <td valign="top"></td> <td valign="top"></td> </tr> <tr> <td valign="top"><a name="theme_create_theme_html_rating_box"></a>function <strong>theme_html_rating_box</strong>()<a href="#theme_create_theme_html_rating_box" title="Link to this section"><img src="images/anchor.gif" width="15" height="9" border="0" alt="" /></a></td> <td valign="top">function</td> <td valign="top"></td> <td valign="top"></td> </tr> <tr> <td valign="top"><a name="theme_create_theme_html_comments"></a>function <strong>theme_html_comments</strong>(<em>$pid</em>)<a href="#theme_create_theme_html_comments" title="Link to this section"><img src="images/anchor.gif" width="15" height="9" border="0" alt="" /></a></td> <td valign="top">function</td> <td valign="top">Displays comments for a specific picture</td> <td valign="top"></td> </tr> <tr> <td valign="top"><a name="theme_create_theme_slideshow"></a>function <strong>theme_slideshow</strong>()<a href="#theme_create_theme_slideshow" title="Link to this section"><img src="images/anchor.gif" width="15" height="9" border="0" alt="" /></a></td> <td valign="top">function</td> <td valign="top"></td> <td valign="top"></td> </tr> <tr> <td valign="top"><a name="theme_create_theme_function_display_fullsize_pic"></a>function <strong>theme_display_fullsize_pic</strong>()<a href="#theme_create_theme_function_display_fullsize_pic" title="Link to this section"><img src="images/anchor.gif" width="15" height="9" border="0" alt="" /></a></td> <td valign="top">function</td> <td valign="top">Display the full size image</td> <td valign="top"></td> </tr> <tr> <td valign="top"><a name="theme_create_theme_vanity"></a>function <strong>theme_vanity</strong>()<a href="#theme_create_theme_vanity" title="Link to this section"><img src="images/anchor.gif" width="15" height="9" border="0" alt="" /></a></td> <td valign="top">function</td> <td valign="top"></td> <td valign="top"></td> </tr> <tr> <td valign="top"><a name="theme_create_theme_display_bar"></a>function <strong>theme_display_bar</strong>(<em>$actualValue = 0, maxValue = '100', maxBarSizeInPixels = '400', textColor = 'black', textShadowColor = '', textUnit = '', leftBar = 'red', rightBar = ''</em>)<a href="#theme_create_theme_display_bar" title="Link to this section"><img src="images/anchor.gif" width="15" height="9" border="0" alt="" /></a></td> <td valign="top">function</td> <td valign="top">Display a bar graph</td> <td valign="top"></td> </tr> <tr> <td valign="top"><a name="theme_create_theme_page_title"></a>function <strong>theme_page_title</strong>(<em>$section</em>)<a href="#theme_create_theme_page_title" title="Link to this section"><img src="images/anchor.gif" width="15" height="9" border="0" alt="" /></a></td> <td valign="top">function</td> <td valign="top">Creates the title tag for each page. For the sake of search engine friendliness, the dynamic part $section should come first</td> <td valign="top"></td> </tr> <tr> <td valign="top"><a name="theme_create_theme_var_sys_menu"></a><strong>$template_sys_menu</strong><a href="#theme_create_theme_var_sys_menu" title="Link to this section"><img src="images/anchor.gif" width="15" height="9" border="0" alt="" /></a></td> <td valign="top">variable</td> <td valign="top">Template for sys_menu</td> <td valign="top"></td> </tr> <tr> <td valign="top"><a name="theme_create_theme_var_sub_menu"></a><strong>$template_sub_menu</strong><a href="#theme_create_theme_var_sub_menu" title="Link to this section"><img src="images/anchor.gif" width="15" height="9" border="0" alt="" /></a></td> <td valign="top">variable</td> <td valign="top">Template for sub_menu</td> <td valign="top"></td> </tr> <tr> <td valign="top"><a name="theme_create_theme_sys_menu_spacer"></a><strong>$template_sys_menu_spacer</strong><a href="#theme_create_theme_sys_menu_spacer" title="Link to this section"><img src="images/anchor.gif" width="15" height="9" border="0" alt="" /></a></td> <td valign="top">variable</td> <td valign="top">Delimiter between sys menu items (in many themes, <tt class="code">::</tt> is being used)</td> <td valign="top"></td> </tr> <tr> <td valign="top"><a name="theme_create_theme_sys_menu_button"></a><strong>$template_sys_menu_button</strong><a href="#theme_create_theme_sys_menu_button" title="Link to this section"><img src="images/anchor.gif" width="15" height="9" border="0" alt="" /></a></td> <td valign="top">variable</td> <td valign="top">Edit this to add/change CSS classes for the sys-menu links.<br /> Default content is<pre class="cpg_code code"> <!-- BEGIN {BLOCK_ID} --> <a href="{HREF_TGT}" title="{HREF_TITLE}">{HREF_LNK}</a> {SPACER} <!-- END {BLOCK_ID} --></pre></td> <td valign="top"></td> </tr> <tr> <td valign="top"><a name="theme_create_theme_sub_menu_spacer"></a><strong>$template_sub_menu_spacer</strong><a href="#theme_create_theme_sub_menu_spacer" title="Link to this section"><img src="images/anchor.gif" width="15" height="9" border="0" alt="" /></a></td> <td valign="top">variable</td> <td valign="top">Delimiter between sub menu items. By default, it's the same delimiter that is being used for the sys menu.</td> <td valign="top"></td> </tr> <tr> <td valign="top"><a name="theme_create_theme_sub_menu_button"></a><strong>$template_sub_menu_button</strong><a href="#theme_create_theme_sub_menu_button" title="Link to this section"><img src="images/anchor.gif" width="15" height="9" border="0" alt="" /></a></td> <td valign="top">variable</td> <td valign="top">Edit this to add/change CSS classes for the menu-menu links. By default, the definition for the sys-menu is being taken into account.</td> <td valign="top"></td> </tr> <tr> <td valign="top"><a name="theme_create_theme_gallery_admin_menu"></a><strong>$template_gallery_admin_menu</strong><a href="#theme_create_theme_gallery_admin_menu" title="Link to this section"><img src="images/anchor.gif" width="15" height="9" border="0" alt="" /></a></td> <td valign="top">variable</td> <td valign="top">HTML template for gallery admin menu</td> <td valign="top"></td> </tr> <tr> <td valign="top"><a name="theme_create_theme_user_admin_menu"></a><strong>$template_user_admin_menu</strong><a href="#theme_create_theme_user_admin_menu" title="Link to this section"><img src="images/anchor.gif" width="15" height="9" border="0" alt="" /></a></td> <td valign="top">variable</td> <td valign="top">HTML template for user admin menu, i.e. the additional menu the non-admin user sees if he is logged in and allowed to have a personal gallery (permission for this is being assigned on the <a href="groups.htm#group_cp">groups control panel</a>).</td> <td valign="top"></td> </tr> <tr> <td valign="top"><a name="theme_create_theme_var_cat_list"></a><strong>$template_cat_list</strong><a href="#theme_create_theme_var_cat_list" title="Link to this section"><img src="images/anchor.gif" width="15" height="9" border="0" alt="" /></a></td> <td valign="top">variable</td> <td valign="top">HTML template for the category list</td> <td valign="top"></td> </tr> <tr> <td valign="top"><a name="theme_create_theme_breadcrumb"></a><strong>$template_breadcrumb</strong><a href="#theme_create_theme_breadcrumb" title="Link to this section"><img src="images/anchor.gif" width="15" height="9" border="0" alt="" /></a></td> <td valign="top">variable</td> <td valign="top">HTML template for the breadcrumb (i.e. the path that indicates where the visitor actually is in terms of the logical category/album structure)</td> <td valign="top"></td> </tr> <tr> <td valign="top"><a name="theme_create_theme_var_album_list"></a><strong>$template_album_list</strong><a href="#theme_create_theme_var_album_list" title="Link to this section"><img src="images/anchor.gif" width="15" height="9" border="0" alt="" /></a></td> <td valign="top">variable</td> <td valign="top">HTML template for the album list</td> <td valign="top"></td> </tr> <tr> <td valign="top"><a name="theme_create_theme_var_film_strip"></a><strong>$template_film_strip</strong><a href="#theme_create_theme_var_film_strip" title="Link to this section"><img src="images/anchor.gif" width="15" height="9" border="0" alt="" /></a></td> <td valign="top">variable</td> <td valign="top">HTML template for filmstrip display on the intermediate image page (displayimage.php)</td> <td valign="top"></td> </tr> <tr> <td valign="top"><a name="theme_create_theme_var_album_list_cat"></a><strong>$template_album_list_cat</strong><a href="#theme_create_theme_var_album_list_cat" title="Link to this section"><img src="images/anchor.gif" width="15" height="9" border="0" alt="" /></a></td> <td valign="top">variable</td> <td valign="top">HTML template for the album list</td> <td valign="top"></td> </tr> <tr> <td valign="top"><a name="theme_create_theme_album_admin_menu"></a><strong>$template_album_admin_menu</strong><a href="#theme_create_theme_album_admin_menu" title="Link to this section"><img src="images/anchor.gif" width="15" height="9" border="0" alt="" /></a></td> <td valign="top">variable</td> <td valign="top">HTML template for the ALBUM admin menu displayed in the album list, i.e. the menu items (buttons) that are being displayed next to each album thumbnail if the logged in user is the owner of that album. Usually, this is the case for the admin.</td> <td valign="top"></td> </tr> <tr> <td valign="top"><a name="theme_create_theme_thumb_view_title_row"></a><strong>$template_thumb_view_title_row</strong><a href="#theme_create_theme_thumb_view_title_row" title="Link to this section"><img src="images/anchor.gif" width="15" height="9" border="0" alt="" /></a></td> <td valign="top">variable</td> <td valign="top">HTML template for title row of the thumbnail view (album title + sort options). This is the place to remove the sort options if you don't want them displayed.</td> <td valign="top"></td> </tr> <tr> <td valign="top"><a name="theme_create_theme_fav_thumb_view_title_row"></a><strong>$template_fav_thumb_view_title_row</strong><a href="#theme_create_theme_fav_thumb_view_title_row" title="Link to this section"><img src="images/anchor.gif" width="15" height="9" border="0" alt="" /></a></td> <td valign="top">variable</td> <td valign="top">HTML template for title row of the fav thumbnail view (album title + download).</td> <td valign="top"></td> </tr> <tr> <td valign="top"><a name="theme_create_theme_thumbnail_view"></a><strong>$template_thumbnail_view</strong><a href="#theme_create_theme_thumbnail_view" title="Link to this section"><img src="images/anchor.gif" width="15" height="9" border="0" alt="" /></a></td> <td valign="top">variable</td> <td valign="top">HTML template for thumbnails display</td> <td valign="top">function <a href="#theme_create_theme_display_thumbnails">theme_display_thumbnails</a> uses variable and defines placeholder tokens <tt class="code">{THUMB}</tt>, <tt class="code">{CAPTION}</tt>, <tt class="code">{ADMIN_MENU}</tt> and <tt class="code">{TABS}</tt></td> </tr> <tr> <td valign="top"><a name="theme_create_theme_var_no_img_to_display"></a><strong>$template_no_img_to_display</strong><a href="#theme_create_theme_var_no_img_to_display" title="Link to this section"><img src="images/anchor.gif" width="15" height="9" border="0" alt="" /></a></td> <td valign="top">variable</td> <td valign="top">HTML template for the thumbnail view when there is no picture to show. If your gallery <a href="configuration.htm#admin_allow_unlogged_access">requires visitors to log in</a> to actually view the pictures, you may encourage them to do so by coming up with custom content within this theme section.</td> <td valign="top">Placeholder token <tt class="code">{TEXT}</tt> being populated and variable used in function <a href="#theme_create_theme_function_no_img_to_display">theme_no_img_to_display</a></td> </tr> <tr> <td valign="top"><a name="theme_create_theme_user_list_info_box"></a><strong>$template_user_list_info_box</strong><a href="#theme_create_theme_user_list_info_box" title="Link to this section"><img src="images/anchor.gif" width="15" height="9" border="0" alt="" /></a></td> <td valign="top">variable</td> <td valign="top">HTML template for the USER info box in the user list view</td> <td valign="top"></td> </tr> <tr> <td valign="top"><a name="theme_create_theme_var_img_navbar"></a><strong>$template_img_navbar</strong><a href="#theme_create_theme_var_img_navbar" title="Link to this section"><img src="images/anchor.gif" width="15" height="9" border="0" alt="" /></a></td> <td valign="top">variable</td> <td valign="top">HTML template for the image navigation bar: the navigation at the top of the intermediate image view that let's you go to the thumbnail view, expands/collapses the pic info section, starts the slideshow, contains links to ecard, allows you to report a file to the admin and displays the link to the previous and next image in the album the visitor is currently in.</td> <td valign="top"></td> </tr> <tr> <td valign="top"><a name="theme_create_theme_var_display_media"></a><strong>$template_display_media</strong><a href="#theme_create_theme_var_display_media" title="Link to this section"><img src="images/anchor.gif" width="15" height="9" border="0" alt="" /></a></td> <td valign="top">variable</td> <td valign="top">HTML template for intermediate image display. This is the place where layout changes of the intermediate image in relation to the title and description should be added.</td> <td valign="top">function theme_html_picture populates the placeholder tokens <tt class="code">{IMAGE}</tt>, <tt class="code">{ADMIN_MENU}</tt>, <tt class="code">{TITLE}</tt> and <tt class="code">{CAPTION}</tt> and uses the variable</td> </tr> <tr> <td valign="top"><a name="theme_create_theme_var_image_rating"></a><strong>$template_image_rating</strong><a href="#theme_create_theme_var_image_rating" title="Link to this section"><img src="images/anchor.gif" width="15" height="9" border="0" alt="" /></a></td> <td valign="top">variable</td> <td valign="top">HTML template for the image rating box</td> <td valign="top"></td> </tr> <tr> <td valign="top"><a name="theme_create_theme_var_image_comments"></a><strong>$template_image_comments</strong><a href="#theme_create_theme_var_image_comments" title="Link to this section"><img src="images/anchor.gif" width="15" height="9" border="0" alt="" /></a></td> <td valign="top">variable</td> <td valign="top">HTML template for the display of comments</td> <td valign="top"></td> </tr> <tr> <td valign="top"><a name="theme_create_theme_add_your_comment"></a><strong>$template_add_your_comment</strong><a href="#theme_create_theme_add_your_comment" title="Link to this section"><img src="images/anchor.gif" width="15" height="9" border="0" alt="" /></a></td> <td valign="top">variable</td> <td valign="top">HTML template for the input form for comments</td> <td valign="top"></td> </tr> <tr> <td valign="top"><a name="theme_create_theme_var_cpg_die"></a><strong>$template_cpg_die</strong><a href="#theme_create_theme_var_cpg_die" title="Link to this section"><img src="images/anchor.gif" width="15" height="9" border="0" alt="" /></a></td> <td valign="top">variable</td> <td valign="top">HTML template used by the cpg_die function, used to display error messages of any kind to the visitor</td> <td valign="top"></td> </tr> <tr> <td valign="top"><a name="theme_create_theme_var_msg_box"></a><strong>$template_msg_box</strong><a href="#theme_create_theme_var_msg_box" title="Link to this section"><img src="images/anchor.gif" width="15" height="9" border="0" alt="" /></a></td> <td valign="top">variable</td> <td valign="top">HTML template used by the msg_box function that displays messages to the visitor at the top of the screen (usually giving feedback for actions that the visitor has made on a previous screen).</td> <td valign="top"></td> </tr> <tr> <td valign="top"><a name="theme_create_theme_var_ecard"></a><strong>$template_ecard</strong><a href="#theme_create_theme_var_ecard" title="Link to this section"><img src="images/anchor.gif" width="15" height="9" border="0" alt="" /></a></td> <td valign="top">variable</td> <td valign="top">HTML template for e-cards</td> <td valign="top"></td> </tr> <tr> <td valign="top"><a name="theme_create_theme_var_ecard_plaintext"></a><strong>$template_ecard_plaintext</strong><a href="#theme_create_theme_var_ecard_plaintext" title="Link to this section"><img src="images/anchor.gif" width="15" height="9" border="0" alt="" /></a></td> <td valign="top">variable</td> <td valign="top">plain-text template for e-cards (as fallback for clients that can't display html-formatted mails)</td> <td valign="top"></td> </tr> <tr> <td valign="top"><a name="theme_create_theme_var_report"></a><strong>$template_report</strong><a href="#theme_create_theme_var_report" title="Link to this section"><img src="images/anchor.gif" width="15" height="9" border="0" alt="" /></a></td> <td valign="top">variable</td> <td valign="top">HTML template for report</td> <td valign="top"></td> </tr> <tr> <td valign="top"><a name="theme_create_theme_var_report_plaintext"></a><strong>$template_report_plaintext</strong><a href="#theme_create_theme_var_report_plaintext" title="Link to this section"><img src="images/anchor.gif" width="15" height="9" border="0" alt="" /></a></td> <td valign="top">variable</td> <td valign="top">plain-text template for reports (as fallback for clients that can't display html-formatted mails)</td> <td valign="top"></td> </tr> <tr> <td valign="top"><a name="theme_create_theme_var_report_comment"></a><strong>$template_report_comment</strong><a href="#theme_create_theme_var_report_comment" title="Link to this section"><img src="images/anchor.gif" width="15" height="9" border="0" alt="" /></a></td> <td valign="top">variable</td> <td valign="top">HTML template for displaying a reported comment</td> <td valign="top"></td> </tr> <tr> <td valign="top"><a name="theme_create_theme_var_report_comment_email"></a><strong>$template_report_comment_email</strong><a href="#theme_create_theme_var_report_comment_email" title="Link to this section"><img src="images/anchor.gif" width="15" height="9" border="0" alt="" /></a></td> <td valign="top">variable</td> <td valign="top">plain-text template for reports (as fallback for clients that can't display html-formatted mails)</td> <td valign="top"></td> </tr> <tr> <td valign="top"><a name="theme_create_theme_tab_display"></a><strong>$template_tab_display</strong><a href="#theme_create_theme_tab_display" title="Link to this section"><img src="images/anchor.gif" width="15" height="9" border="0" alt="" /></a></td> <td valign="top">variable</td> <td valign="top">Template used for tabbed display</td> <td valign="top"></td> </tr> <tr> <td valign="top"><a name="theme_create_theme_var_vanity"></a><strong>$template_vanity</strong><a href="#theme_create_theme_var_vanity" title="Link to this section"><img src="images/anchor.gif" width="15" height="9" border="0" alt="" /></a></td> <td valign="top">variable</td> <td valign="top">Template used for <a href="configuration.htm#vanity_block">Vanity Footer</a></td> <td valign="top"></td> </tr> <tr> <td valign="top"><a name="theme_create_theme_var_sidebar"></a><strong>$template_sidebar</strong><a href="#theme_create_theme_var_sidebar" title="Link to this section"><img src="images/anchor.gif" width="15" height="9" border="0" alt="" /></a></td> <td valign="top">variable</td> <td valign="top">HTML template for sidebar</td> <td valign="top"></td> </tr> <tr> <td valign="top"><a name="theme_create_theme_var_zipfile_plaintext"></a><strong>$template_zipfile_plaintext</strong><a href="#theme_create_theme_var_zipfile_plaintext" title="Link to this section"><img src="images/anchor.gif" width="15" height="9" border="0" alt="" /></a></td> <td valign="top">variable</td> <td valign="top">plain-text template for optional readme text file to be added to archives when using the zip download of favorites</td> <td valign="top"></td> </tr> </table> <a name="theme_php_examples"></a><h2>Examples<a href="#theme_php_examples" title="Link to this section"><img src="images/anchor.gif" width="15" height="9" border="0" alt="" /></a></h2> <p>A list of modification examples that are often requested can be found in the section <a href="theme_examples.htm#theme_examples">theme examples</a>.</p> <a name="theme_php_summary"></a><h2>Summary<a href="#theme_php_summary" title="Link to this section"><img src="images/anchor.gif" width="15" height="9" border="0" alt="" /></a></h2> <p>Understanding the process to edit theme.php is really important if you want to create a custom theme, so it's mandatory to be familar with what has been explained on this page:</p> <p class="cpg_message_success">To edit a particular functionality of a theme, take a look at <tt class="code">themes/yourtheme/theme.php</tt> and search for the section that you want to see changed. If that section exists, edit it as you see fit. If that section does not exist in your custom theme, copy the corresponding section (and only that section) from <tt class="code">themes/sample/theme.php</tt> into a new line before <tt class="code">?></tt> of the file <tt class="code">themes/yourtheme/theme.php</tt>. Then start editing the code you just pasted in.</p> <div id="doc_footer"> <div class="doc_info_wrapper"> <span id="doc_last_changed">$LastChangedDate: 2011-01-02 20:44:22 +0100 (So, 02 Jan 2011) $</span> <span id="doc_revision">$Revision: 8154 $</span> </div> </div> </body> </html>