PhotoStack Docs

Templates

Basics

Every template is stored in the templates directory in the root of your install. The template for your site is chosen by editing your config.php, either directly or through the admin control panel and changing the dropdown from default to the name of the folder of the template you want to use. This is located in the Basic section.

To create a new template, simply duplicate the default folder and begin editing the contents as you like. ...

Files

  • index.php controls the logic of the templating.
  • image.php is displayed when you are viewing an image.
  • album.php is displayed when you are in an album (full of images).
  • gallery.php is displayed when you are in a gallery (full of albums).
  • template.ini sets thumbnail specifics for the template.

In the default template there are also some other files to aid in design construction.

  • header.php goes above all content on every page and is called by index.tpl.php.
  • footer.php goes below all content on every page and is called by index.tpl.php.
  • main.css is a stylesheet used for this design.

The Loop

Instantiation Files

Photostack all starts with an instantiation file. In other words, you have to “turn on” PhotoStack from a file. Usually your webserver has index.php setup to be a default document type. In this file, there are a few lines, one of them turns on PhotoStack.

$ps = new photostack();

the other line passes photostack off to the correct template.

include $ps→config→pathto_current_template.”index.php”;

You WILL NOT NORMALLY NEED TO EDIT index.php.

Caching

Template Functions

General Functions

page_title()

Displays the page title separating it with your separator set in config.php.

is_image()

Returns false if this is an image.

is_album()

Returns true if this is an album page.

is_gallery()

Returns true if this is a gallery page.

crumbline()

Similar to page_title(), but returns dir names.

crumb_links()

Like crumline() but with links;

nav_links()

To be used in the <head> of the document, produces <link> elements for navigation purposes.

Gallery Functions

gallery_id_encoded()

Returns the gallery id, but encoded.

gallery_contents()

Returns the count of the galleries contents (whatever they may be).

gallery_url()

Returns the URL to the current gallery.

gallery_name()

Returns the name of the current gallery.

gallery_desc()

Returns the description for the gallery.

gallery_desc_long()

Returns the long description for the gallery.

gallery_date($before, $after, $format)

Returns the gallery date using ‘F j, Y’ as the default date format. http://php.net/date/ $before will be placed before and $after will be placed after.

gallery_count()

Returns the count of the gallery.

gallery_count_text()

Returns formated text of gallery_count().

gallery_has_sub()

Returns true if gallery has sub galleries.

gallery_thumbnail_linked()

Returns a linked version of the gallery thumbnail.

gallery_thumbnail($extrahtml)

Returns the gallery thumbnail without a link, inserting $extrahtml in to the $img tag.

gallery_showing($text, $before, $after)

Returns gallery count, using ‘Showing’ as the default $text. $before will be placed before and $after will be placed after.

gallery_page_count()

Returns the number of pages in the album, based on the value set in template.ini.

gallery_parent_link($text, $separator)

Returns a link to the parent gallery, $text defaults to “Up” and $separator to “|”

gallery_has_next()

Returns true if current pages has another page.

gallery_has_prev()

Returns true if current page has a previous page.

gallery_has_pages()

Returns true if the gallery has pages.

gallery_rss_url()

Returns the RSS url to the current gallery.

gallery_next_url()

Returns the URL to the previous page.

gallery_next_link()

Returns a link to the previous page.

gallery_prev_url()

Returns the URL to the previous page.

gallery_prev_link()

Returns a link to the previous page.

Image Functions

image()

Returns the current image (or the image in the loop).

image_url()

Returns the url to the image (if cropped, it will be to that image)

image_page_url()

Returns the gallery url to the image.

image_real_url()

Returns the url to the real full-size image.

image_name($index)

Returns the current image name.

image_desc($index, $before, $after)

Returns the current image description, placing $before before the description and $after after it.

image_desc_long()

Returns the current image long description, placing $before before the description and $after after it.

image_date($index, $before, $after, $format)

Returns the current image date, using ‘F j, Y’ as the default $format, placing $before before the date and $after after it.

image_preview_thumbs()

Returns preview thumbnails for navigation.

 
start.txt · Last modified: 2008/05/23 22:37 by 82.67.107.214
 
Recent changes RSS feed Creative Commons License Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki