ZenphotoCMS 1.6.2

template-functions.php

Functions used to display content in themes.

Table of Contents

Constants

SEO_FULLWEBPATH  = \FULLWEBPATH
SEO_WEBPATH  = \WEBPATH

Functions

getVersion()  : mixed
Returns the zenphoto version string
printVersion()  : mixed
Prints the zenphoto version string
printZenJavascripts()  : mixed
Print any Javascript required by zenphoto.
adminToolbox()  : mixed
Prints the clickable drop down toolbox on any theme page with generic admin helpers
getGalleryTitle()  : string
Returns the raw title of the gallery.
getBareGalleryTitle()  : string
Returns a text-only title of the gallery.
printGalleryTitle()  : mixed
Prints the title of the gallery.
printBareGalleryTitle()  : mixed
getHeadTitle()  : mixed
Function to create the page title to be used within the html <head> <title></title> element.
printHeadTitle()  : mixed
Function to print the html <title>title</title> within the <head> of a html page based on the current theme page Usefull if you use one header.php for the header of all theme pages instead of individual ones on the theme pages It prints the title and site name including the <title> tag in reversed breadcrumb order: <title><title of current page> | <parent item if present> | <gallery title></title> It supports standard gallery pages as well a custom and Zenpage news articles, categories and pages.
getGalleryDesc()  : string
Returns the raw description of the gallery.
getBareGalleryDesc()  : string
Returns a text-only description of the gallery.
printGalleryDesc()  : mixed
Prints the description of the gallery.
printBareGalleryDesc()  : mixed
getParentSiteTitle()  : string
Returns the name of the parent website as set by the "Website Title" option on the gallery options tab. Use this if Zenphoto is only a part of your website.
getParentSiteURL()  : string
Returns the URL of the main website as set by the "Website URL" option on the gallery options tab. Use this if Zenphoto is only a part of your website.
getMainSiteName()  : string
getMainSiteURL()  : string
getGalleryIndexURL()  : string
Returns the URL of the main gallery index page. If a custom index page is set this returns that page.
getStandardGalleryIndexURL()  : string
Returns the url to the standard gallery index.php page
getCustomGalleryIndexURL()  : string
Gets the custom gallery index url if one is set, otherwise false
getCustomGalleryIndexPage()  : string
Returns the name to the individual custom gallery index page name if set, otherwise returns generic custom gallery page "gallery.php" that is widely supported by themes If you need to check if there is an indovidual custom_index_page set use `getOption('custom_index_page')` or `getCustomGalleryIndexURL()`
printGalleryIndexURL()  : mixed
If a custom gallery index page is set this first prints a link to the actual site index (home page = index.php) followed by the gallery index page link. Otherwise just the gallery index link
getSiteHomeURL()  : string
Returns the home page link (WEBPATH) to the Zenphoto theme index.php page Use in breadcrumbs if the theme uses a custom gallery index page so the gallery is not the site's home page
printSiteHomeURL()  : mixed
Prints the home page link (WEBPATH with trailing slash) to a Zenphoto theme index.php page Use in breadcrumbs if the theme uses a custom gallery index page so the gallery is not the site's home page
printPrivacyPageLink()  : mixed
If the privacy page url option is set this prints a link to it
getNumAlbums()  : int
Returns the number of albums.
getCurrentTheme()  : string
Returns the name of the currently active theme
next_album()  : bool
WHILE next_album(): context switches to Album.
getCurrentPage()  : int
Returns the number of the current page without printing it.
getAllAccessibleAlbums()  : mixed
Gets an array of the album ids of all accessible albums (publich or user dependend)
getTotalPages()  : int
Returns the number of pages for the current object
getPageNumURL()  : int
Returns the URL of the page number passed as a parameter
hasNextPage()  : bool
Returns true if there is a next page
getNextPageURL()  : string
Returns the URL of the next page. Use within If or while loops for pagination.
printNextPageURL()  : mixed
Prints the URL of the next page.
hasPrevPage()  : bool
Returns TRUE if there is a previous page. Use within If or while loops for pagination.
getPrevPageURL()  : string
Returns the URL of the previous page.
printPrevPageURL()  : mixed
Returns the URL of the previous page.
printPageNav()  : mixed
Prints a page navigation including previous and next page links
printPageList()  : mixed
Prints a list of all pages.
getPageNavList()  : mixed
returns a page nav list.
printPageListWithNav()  : mixed
Prints a full page navigation including previous and next page links with a list of all pages in between.
makeAlbumCurrent()  : mixed
Sets the album passed as the current album
getAlbumTitle()  : string
Returns the raw title of the current album.
getBareAlbumTitle()  : string
Returns a text-only title of the current album.
getAnnotatedAlbumTitle()  : string
Returns an album title taged with of Not visible or password protected status
printAnnotatedAlbumTitle()  : mixed
printAlbumTitle()  : mixed
Prints an encapsulated title of the current album.
printBareAlbumTitle()  : mixed
albumNumber()  : int
Gets the 'n' for n of m albums
getParentAlbums()  : array<string|int, mixed>
Returns an array of the names of the parents of the current album.
getAlbumBreadcrumb()  : array<string|int, mixed>
returns the breadcrumb item for the current images's album
printAlbumBreadcrumb()  : mixed
prints the breadcrumb item for the current images's album
printSearchBreadcrumb()  : mixed
Prints the "breadcrumb" for a search page if the search was for a data range, the breadcrumb is "Archive" otherwise it is "Search"
getParentBreadcrumb()  : array<string|int, mixed>
returns the breadcrumb navigation for album, gallery and image view.
printParentBreadcrumb()  : mixed
Prints the breadcrumb navigation for album, gallery and image view.
printHomeLink()  : mixed
Prints a link to the 'main website', not the Zenphoto site home page! Only prints the link if the url is not empty and does not point back the gallery page
getAlbumDate()  : string
Returns the formatted date field of the album
printAlbumDate()  : mixed
Prints the date of the current album
getAlbumLocation()  : string
Returns the Location of the album.
printAlbumLocation()  : mixed
Prints the location of the album
getAlbumDesc()  : string
Returns the raw description of the current album.
getBareAlbumDesc()  : string
Returns a text-only description of the current album.
printAlbumDesc()  : mixed
Prints description of the current album
printBareAlbumDesc()  : mixed
getAlbumCustomData()  : string
Returns the custom_data field of the current album
printAlbumCustomData()  : mixed
Prints the custom_data field of the current album.
getAlbumData()  : string
A composit for getting album data
printAlbumData()  : mixed
Prints arbitrary data from the album object
getAlbumPage()  : int
Returns the album page number of the current image
getAlbumURL()  : string
Returns the album link url of the current album.
printAlbumURL()  : mixed
Prints the album link url of the current album.
getAlbumThumb()  : string
Returns the name of the defined album thumbnail image.
getPasswordProtectImage()  : string
Returns an <img> element of the password protect thumb substitute
getPasswordProtectedImage()  : string
Gets the URL to the password protected images
printPasswordProtectedImage()  : mixed
Prints an image element with the password protected image.
printAlbumThumbImage()  : mixed
Prints the album thumbnail image.
getCustomAlbumThumb()  : string
Returns a link to a custom sized thumbnail of the current album
printCustomAlbumThumbImage()  : string
Prints a link to a custom sized thumbnail of the current album
getMaxSpaceContainer()  : mixed
Called by ***MaxSpace functions to compute the parameters to be passed to xxCustomyyy functions.
getCustomAlbumThumbMaxSpace()  : string
Returns a link to a un-cropped custom sized version of the current album thumb within the given height and width dimensions.
printCustomAlbumThumbMaxSpace()  : mixed
Prints a un-cropped custom sized album thumb within the given height and width dimensions.
getNextAlbum()  : object
Returns the next album
getNextAlbumURL()  : string
Get the URL of the next album in the gallery.
getPrevAlbum()  : object
Returns the previous album
getPrevAlbumURL()  : string
Get the URL of the previous album in the gallery.
isImagePage()  : bool
Returns true if this page has image thumbs on it
isAlbumPage()  : bool
Returns true if this page has album thumbs on it
getNumImages()  : int
Returns the number of images in the album.
getFirstPageImages()  : type
next_image()  : bool
Returns the next image on a page.
makeImageCurrent()  : mixed
Sets the image passed as the current image
getImageTitle()  : string
Returns the raw title of the current image.
getBareImageTitle()  : string
Returns a text-only title of the current image.
getAnnotatedImageTitle()  : string
Returns the image title taged with not visible annotation.
printAnnotatedImageTitle()  : mixed
printImageTitle()  : mixed
Prints title of the current image
printBareImageTitle()  : mixed
imageNumber()  : int
Returns the 'n' of n of m images
getImageDate()  : string
Returns the image date of the current image in yyyy-mm-dd hh:mm:ss format.
printImageDate()  : mixed
Prints the date of the current album
getImageLocation()  : string
Returns the Location field of the current image
getImageCity()  : string
Returns the City field of the current image
getImageState()  : string
Returns the State field of the current image
getImageCountry()  : string
Returns the Country field of the current image
getImageDesc()  : string
Returns the raw description of the current image.
getBareImageDesc()  : string
Returns a text-only description of the current image.
printImageDesc()  : mixed
Prints the description of the current image.
printBareImageDesc()  : mixed
getImageData()  : string
A composit for getting image data
getImageCustomData()  : string
Returns the custom_data field of the current image
printImageCustomData()  : string
Prints the custom_data field of the current image.
printImageData()  : mixed
Prints arbitrary data from the image object
getFullImageFilesize()  : int
Returns the file size of the full original image
hasNextImage()  : bool
True if there is a next image
hasPrevImage()  : bool
True if there is a previous image
getNextImageURL()  : string
Returns the url of the next image.
getPrevImageURL()  : string
Returns the url of the previous image.
getPrevImageThumb()  : string
Returns the thumbnail of the previous image.
getNextImageThumb()  : string
Returns the thumbnail of the next image.
getImageURL()  : string
Returns the url of the current image.
printImageURL()  : mixed
Prints the link to the current image.
getImageMetaData()  : array<string|int, mixed>
Returns the Metadata infromation from the current image
printImageMetadata()  : mixed
Prints the Metadata data of the current image
getSizeCustomImage()  : array<string|int, mixed>
Returns an array with the height & width
getSizeDefaultImage()  : array<string|int, mixed>
Returns an array [width, height] of the default-sized image.
getSizeFullImage()  : array<string|int, mixed>
Returns an array [width, height] of the original image.
getDefaultWidth()  : int
The width of the default-sized image (in printDefaultSizedImage)
getDefaultHeight()  : int
Returns the height of the default-sized image (in printDefaultSizedImage)
getFullWidth()  : int
Returns the width of the original image
getFullHeight()  : int
Returns the height of the original image
isLandscape()  : bool
Returns true if the image is landscape-oriented (width is greater than height) or - kept here for backwards compatibility - square (equal widht and height)
getDefaultSizedImage()  : string
Returns the url to the default sized image.
printDefaultSizedImage()  : mixed
Show video player with video loaded or display the image.
getImageThumb()  : string
Returns the url to the thumbnail of the current image.
printImageThumb()  : mixed
getSizeDefaultThumb()  : aray
Gets the width and height of a default thumb for the <img> tag height/width
getFullImageURL()  : string
Returns the url to original image.
getUnprotectedImageURL()  : string
Returns the "raw" url to the image in the albums folder
getProtectedImageURL()  : string
Returns an url to the password protected/watermarked current image
getSizedImageURL()  : mixed
Returns a link to the current image custom sized to $size
getCustomImageURL()  : string
Returns the url to the image with the dimensions you define with this function.
printCustomSizedImage()  : mixed
Print normal video or custom sized images.
getCustomSizedImageMaxSpace()  : string
Returns a link to a un-cropped custom sized version of the current image within the given height and width dimensions.
getCustomSizedImageThumbMaxSpace()  : string
Returns a link to a un-cropped custom sized version of the current image within the given height and width dimensions.
printCustomSizedImageThumbMaxSpace()  : mixed
Creates image thumbnails which will fit un-cropped within the width & height parameters given
printCustomSizedImageMaxSpace()  : mixed
Print normal video or un-cropped within the given height and width dimensions. Use for sized images or thumbnails in an album.
printSizedImageURL()  : mixed
Prints link to an image of specific size
getTags()  : string
Returns a list of tags for context of the page called where called
printTags()  : mixed
Prints a list of tags, editable by admin
printAllTagsAs()  : mixed
Either prints all of the galleries tgs as a UL list or a cloud
getAllDates()  : array<string|int, mixed>
Retrieves a list of all unique years & months from the images in the gallery
printAllDates()  : mixed
Prints a compendum of dates and links to a search page that will show results of the date
getCustomPageURL()  : string
Produces the url to a custom page (e.g. one that is not album.php, image.php, or index.php)
printCustomPageURL()  : mixed
Prints the url to a custom page (e.g. one that is not album.php, image.php, or index.php)
isArchive()  : bool
tests if a search page is an "archive" page
getSearchURL()  : string
Returns a search URL
printSearchForm()  : mixed
Prints the search form
getSearchWords()  : string
Returns the a sanitized version of the search string
getSearchDate()  : string
Returns the date of the search
checkForGuest()  : string
returns the auth type of a guest login
checkAccess()  : bool
Checks to see if a password is needed
getPageRedirect()  : string
Returns a redirection link for the password form
printPasswordForm()  : mixed
Prints the album password form
printZenphotoLink()  : mixed
prints the zenphoto logo and link
exposeZenPhotoInformations()  : mixed
Expose some informations in a HTML comment
getCodeblock()  : string
Gets the content of a codeblock for an image, album or Zenpage newsarticle or page.
printCodeblock()  : string
Prints the content of a codeblock for an image, album or Zenpage newsarticle or page.
checkPageValidity()  : bool
Checks for URL page out-of-bounds for "standard" themes Note: This function assumes that an "index" page will display albums and the pagination be determined by them. Any other "index" page strategy needs to be handled by the theme itself.
print404status()  : mixed
getOwnerAuthor()  : bool
Gets current item's owner (gallery images and albums) or author (Zenpage articles and pages)
printOwnerAuthor()  : mixed
Prints current item's owner (gallery images and albums) or author (Zenpage articles and pages)
getOwnerAuthorURL()  : type
Returns the search url for items the current item's owner (gallery) or author (Zenpage) is assigned to
printOwnerAuthorURL()  : mixed
Prints the link to the search engine for results of all items the current item's owner (gallery) or author (Zenpage) is assigned to
getUserURL()  : string|null
Returns a an url for the search engine for results of all items the user with $username is assigned to either as owner (gallery) or author (Zenpage) Note there is no check if the user name is actually a vaild user account name, owner or author! Use the *OwerAuthor() function for that instead
printUserURL()  : mixed
Prints the link to the search engine for results of all items $username is assigned to either as owner (gallery) or author (Zenpage) Note there is no check if the user name is actually a vaild user account name, owner or author! Use the *OwerAuthor() function for that instead
printCopyrightNotice()  : mixed
Display the site or image copyright notice if defined and display is enabled
printGalleryCopyrightNotice()  : mixed
Display the site copyright notice if defined and display is enabled
printImageCopyrightNotice()  : mixed
Display the image copyright notice if defined and display iss enabled
getCurrentPageAppendix()  : string
Gets the current page number if it is larger than 1 for use on paginated pages for SEO reason to avoid duplicate titles
printCurrentPageAppendix()  : mixed
Prints the current page number if it is larger than 1 for use on paginated pages for SEO reason to avoid duplicate titles

Constants

Functions

printZenJavascripts()

Print any Javascript required by zenphoto.

printZenJavascripts() : mixed

adminToolbox()

Prints the clickable drop down toolbox on any theme page with generic admin helpers

adminToolbox() : mixed

getGalleryTitle()

Returns the raw title of the gallery.

getGalleryTitle() : string
Return values
string

getBareGalleryTitle()

Returns a text-only title of the gallery.

getBareGalleryTitle() : string
Return values
string

printGalleryTitle()

Prints the title of the gallery.

printGalleryTitle() : mixed

getHeadTitle()

Function to create the page title to be used within the html <head> <title></title> element.

getHeadTitle([string $separator = ' | ' ][, bool $listparentalbums = false ][, mixed $listparentpages = false ]) : mixed

Usefull if you use one header.php for the header of all theme pages instead of individual ones on the theme pages It returns the title and site name in reversed breadcrumb order:

<title of current page> | | It supports standard gallery pages as well a custom and Zenpage news articles, categories and pages.
Parameters
$separator : string = ' | '

How you wish the parts to be separated

$listparentalbums : bool = false

If the parent albums should be printed in reversed order before the current

$listparentpages : mixed = false

printHeadTitle()

Function to print the html <title>title</title> within the <head> of a html page based on the current theme page Usefull if you use one header.php for the header of all theme pages instead of individual ones on the theme pages It prints the title and site name including the <title> tag in reversed breadcrumb order: <title><title of current page> | <parent item if present> | <gallery title></title> It supports standard gallery pages as well a custom and Zenpage news articles, categories and pages.

printHeadTitle([string $separator = ' | ' ][, bool $listparentalbums = true ][, mixed $listparentpages = false ]) : mixed
Parameters
$separator : string = ' | '

How you wish the parts to be separated

$listparentalbums : bool = true

If the parent albums should be printed in reversed order before the current

$listparentpages : mixed = false

getGalleryDesc()

Returns the raw description of the gallery.

getGalleryDesc() : string
Return values
string

getBareGalleryDesc()

Returns a text-only description of the gallery.

getBareGalleryDesc() : string
Return values
string

printGalleryDesc()

Prints the description of the gallery.

printGalleryDesc() : mixed

getParentSiteTitle()

Returns the name of the parent website as set by the "Website Title" option on the gallery options tab. Use this if Zenphoto is only a part of your website.

getParentSiteTitle() : string
Tags
since
1.6
Return values
string

getParentSiteURL()

Returns the URL of the main website as set by the "Website URL" option on the gallery options tab. Use this if Zenphoto is only a part of your website.

getParentSiteURL() : string
Tags
since
1.6
Return values
string

getMainSiteName()

getMainSiteName() : string
Tags
deprecated
2.0:

Use getParentSiteTitle() instead

Return values
string

getMainSiteURL()

getMainSiteURL() : string
Tags
deprecated
2.0:

Use getParentSiteURL() instead

Return values
string

getGalleryIndexURL()

Returns the URL of the main gallery index page. If a custom index page is set this returns that page.

getGalleryIndexURL() : string

So this is not necessarily the home page of the site!

Return values
string

getStandardGalleryIndexURL()

Returns the url to the standard gallery index.php page

getStandardGalleryIndexURL([int $page = 1 ][, bool $webpath = null ]) : string
Parameters
$page : int = 1

Pagenumber to append

$webpath : bool = null

host path to be prefixed. If "false" is passed you will get a localized "WEBPATH"

Tags
see
getGalleryIndexURL()
Return values
string

getCustomGalleryIndexURL()

Gets the custom gallery index url if one is set, otherwise false

getCustomGalleryIndexURL([int $page = 1 ][, bool $webpath = null ]) : string
Parameters
$page : int = 1

Pagenumber for pagination

$webpath : bool = null

host path to be prefixed. If "false" is passed you will get a localized "WEBPATH"

Tags
see
getGalleryIndexURL()
global

array $_zp_conf_vars

Return values
string

getCustomGalleryIndexPage()

Returns the name to the individual custom gallery index page name if set, otherwise returns generic custom gallery page "gallery.php" that is widely supported by themes If you need to check if there is an indovidual custom_index_page set use `getOption('custom_index_page')` or `getCustomGalleryIndexURL()`

getCustomGalleryIndexPage() : string
Return values
string

printGalleryIndexURL()

If a custom gallery index page is set this first prints a link to the actual site index (home page = index.php) followed by the gallery index page link. Otherwise just the gallery index link

printGalleryIndexURL([string $after = NULL ][, string $text = NULL ][, bool $printHomeURL = true ]) : mixed
Parameters
$after : string = NULL

Text to append after and outside the link for breadcrumbs

$text : string = NULL

Name of the link, if NULL "Gallery" is used

$printHomeURL : bool = true

In case of a custom gallery index, display breadcrumb with home link (default is true)

Tags
since
1.4.9

getSiteHomeURL()

Returns the home page link (WEBPATH) to the Zenphoto theme index.php page Use in breadcrumbs if the theme uses a custom gallery index page so the gallery is not the site's home page

getSiteHomeURL() : string
Tags
since
1.4.9
global

string $_zp_gallery_page

Return values
string

printSiteHomeURL()

Prints the home page link (WEBPATH with trailing slash) to a Zenphoto theme index.php page Use in breadcrumbs if the theme uses a custom gallery index page so the gallery is not the site's home page

printSiteHomeURL([string $after = NULL ][, string $text = NULL ]) : mixed
Parameters
$after : string = NULL

Text after and outside the link for breadcrumbs

$text : string = NULL

Text of the link, if NULL "Home"

If the privacy page url option is set this prints a link to it

printPrivacyPageLink([string $before = null ][, string $after = null ]) : mixed
Parameters
$before : string = null

To print before the link

$after : string = null

To print after the link

getNumAlbums()

Returns the number of albums.

getNumAlbums() : int
Return values
int

getCurrentTheme()

Returns the name of the currently active theme

getCurrentTheme() : string
Return values
string

next_album()

WHILE next_album(): context switches to Album.

next_album([bool $all = false ][, bool $mine = NULL ]) : bool

If we're already in the album context, this is a sub-albums loop, which, quite simply, changes the source of the album list. Switch back to the previous context when there are no more albums.

Returns true if there are albums, false if none

Parameters
$all : bool = false

true to go through all the albums

$mine : bool = NULL

override the password checks

Tags
since
0.6
Return values
bool

getCurrentPage()

Returns the number of the current page without printing it.

getCurrentPage() : int
Return values
int

getAllAccessibleAlbums()

Gets an array of the album ids of all accessible albums (publich or user dependend)

getAllAccessibleAlbums(object $obj, array<string|int, mixed> &$albumlist, bool $scan) : mixed
Parameters
$obj : object

from whence to get the albums

$albumlist : array<string|int, mixed>

collects the list

$scan : bool

force scan for new images in the album folder

getTotalPages()

Returns the number of pages for the current object

getTotalPages([bool $one_image_page = false ]) : int
Parameters
$one_image_page : bool = false

set to true if your theme collapses all image thumbs or their equivalent to one page. This is typical with flash viewer themes

Return values
int

getPageNumURL()

Returns the URL of the page number passed as a parameter

getPageNumURL(int $page[, int $total = null ]) : int
Parameters
$page : int

Which page is desired

$total : int = null

How many pages there are.

Return values
int

hasNextPage()

Returns true if there is a next page

hasNextPage() : bool
Return values
bool

getNextPageURL()

Returns the URL of the next page. Use within If or while loops for pagination.

getNextPageURL() : string
Return values
string

printNextPageURL()

Prints the URL of the next page.

printNextPageURL(string $text[, string $title = NULL ][, string $class = NULL ][, string $id = NULL ]) : mixed
Parameters
$text : string

text for the URL

$title : string = NULL

Text for the HTML title

$class : string = NULL

Text for the HTML class

$id : string = NULL

Text for the HTML id

hasPrevPage()

Returns TRUE if there is a previous page. Use within If or while loops for pagination.

hasPrevPage() : bool
Return values
bool

getPrevPageURL()

Returns the URL of the previous page.

getPrevPageURL() : string
Return values
string

printPrevPageURL()

Returns the URL of the previous page.

printPrevPageURL(string $text[, string $title = NULL ][, string $class = NULL ][, string $id = NULL ]) : mixed
Parameters
$text : string

The linktext that should be printed as a link

$title : string = NULL

The text the html-tag "title" should contain

$class : string = NULL

Insert here the CSS-class name you want to style the link with

$id : string = NULL

Insert here the CSS-ID name you want to style the link with

printPageNav()

Prints a page navigation including previous and next page links

printPageNav(string $prevtext, string $separator, string $nexttext[, string $class = 'pagenav' ][, string $id = NULL ]) : mixed
Parameters
$prevtext : string

Insert here the linktext like 'previous page'

$separator : string

Insert here what you like to be shown between the prev and next links

$nexttext : string

Insert here the linktext like "next page"

$class : string = 'pagenav'

Insert here the CSS-class name you want to style the link with (default is "pagelist")

$id : string = NULL

Insert here the CSS-ID name if you want to style the link with this

printPageList()

Prints a list of all pages.

printPageList([string $class = 'pagelist' ][, string $id = NULL ][, int $navlen = 9 ]) : mixed
Parameters
$class : string = 'pagelist'

the css class to use, "pagelist" by default

$id : string = NULL

the css id to use

$navlen : int = 9

Number of navigation links to show (0 for all pages). Works best if the number is odd.

getPageNavList()

returns a page nav list.

getPageNavList(bool $_zp_one_image_page, int $navlen, bool $firstlast, int $current, int $total) : mixed
Parameters
$_zp_one_image_page : bool

set to true if there is only one image page as, for instance, in flash themes

$navlen : int

Number of navigation links to show (0 for all pages). Works best if the number is odd.

$firstlast : bool

Add links to the first and last pages of you gallery

$current : int

the current page

$total : int

total number of pages

printPageListWithNav()

Prints a full page navigation including previous and next page links with a list of all pages in between.

printPageListWithNav(string $prevtext, string $nexttext[, bool $_zp_one_image_page = false ][, string $nextprev = true ][, string $class = 'pagelist' ][, string $id = NULL ][, bool $firstlast = true ][, int $navlen = 9 ]) : mixed
Parameters
$prevtext : string

Insert here the linktext like 'previous page'

$nexttext : string

Insert here the linktext like 'next page'

$_zp_one_image_page : bool = false

set to true if there is only one image page as, for instance, in flash themes

$nextprev : string = true

set to true to get the 'next' and 'prev' links printed

$class : string = 'pagelist'

Insert here the CSS-class name you want to style the link with (default is "pagelist")

$id : string = NULL

Insert here the CSS-ID name if you want to style the link with this

$firstlast : bool = true

Add links to the first and last pages of you gallery

$navlen : int = 9

Number of navigation links to show (0 for all pages). Works best if the number is odd.

makeAlbumCurrent()

Sets the album passed as the current album

makeAlbumCurrent(object $album) : mixed
Parameters
$album : object

the album to be made current

getAlbumTitle()

Returns the raw title of the current album.

getAlbumTitle() : string
Return values
string

getBareAlbumTitle()

Returns a text-only title of the current album.

getBareAlbumTitle() : string
Return values
string

getAnnotatedAlbumTitle()

Returns an album title taged with of Not visible or password protected status

getAnnotatedAlbumTitle() : string
Return values
string

printAlbumTitle()

Prints an encapsulated title of the current album.

printAlbumTitle() : mixed

If you are logged in you can click on this to modify the title on the fly.

Tags
author

Ozh

albumNumber()

Gets the 'n' for n of m albums

albumNumber() : int
Return values
int

getParentAlbums()

Returns an array of the names of the parents of the current album.

getParentAlbums([object $album = null ]) : array<string|int, mixed>
Parameters
$album : object = null

optional album object to use inseted of the current album

Return values
array<string|int, mixed>

getAlbumBreadcrumb()

returns the breadcrumb item for the current images's album

getAlbumBreadcrumb([string $title = NULL ]) : array<string|int, mixed>
Parameters
$title : string = NULL

Text to be used as the URL title tag

Return values
array<string|int, mixed>

printAlbumBreadcrumb()

prints the breadcrumb item for the current images's album

printAlbumBreadcrumb([string $before = '' ][, string $after = '' ][, string $title = NULL ]) : mixed
Parameters
$before : string = ''

Text to place before the breadcrumb

$after : string = ''

Text to place after the breadcrumb

$title : string = NULL

Text to be used as the URL title attribute and text link

printSearchBreadcrumb()

Prints the "breadcrumb" for a search page if the search was for a data range, the breadcrumb is "Archive" otherwise it is "Search"

printSearchBreadcrumb([string $between = NULL ][, string $class = NULL ][, string $search = NULL ][, string $archive = NULL ][, string $format = 'F Y' ]) : mixed
Parameters
$between : string = NULL

Insert here the text to be printed between the links

$class : string = NULL

is the class for the link (if present)

$search : string = NULL

text for a search page title

$archive : string = NULL

text for an archive page title

$format : string = 'F Y'

data format for archive page breadcrumb - A datetime format, if using localized dates an ICU dateformat

getParentBreadcrumb()

returns the breadcrumb navigation for album, gallery and image view.

getParentBreadcrumb() : array<string|int, mixed>
Return values
array<string|int, mixed>

printParentBreadcrumb()

Prints the breadcrumb navigation for album, gallery and image view.

printParentBreadcrumb([string $before = NULL ][, string $between = NULL ][, string $after = NULL ][, mixed $truncate = NULL ][, string $elipsis = NULL ]) : mixed
Parameters
$before : string = NULL

Insert here the text to be printed before the links

$between : string = NULL

Insert here the text to be printed between the links

$after : string = NULL

Insert here the text to be printed after the links

$truncate : mixed = NULL

if not empty, the max lenght of the description.

$elipsis : string = NULL

the text to append to the truncated description

Prints a link to the 'main website', not the Zenphoto site home page! Only prints the link if the url is not empty and does not point back the gallery page

printHomeLink([string $before = '' ][, string $after = '' ][, string $title = NULL ][, string $class = NULL ][, string $id = NULL ]) : mixed
Parameters
$before : string = ''

text to precede the link

$after : string = ''

text to follow the link

$title : string = NULL

Title text

$class : string = NULL

optional css class

$id : string = NULL

optional css id

getAlbumDate()

Returns the formatted date field of the album

getAlbumDate([string $format = null ]) : string
Parameters
$format : string = null

optional format string for the date - A datetime format, if using localized dates an ICU dateformat

Return values
string

printAlbumDate()

Prints the date of the current album

printAlbumDate([string $before = '' ][, string $format = NULL ]) : mixed
Parameters
$before : string = ''

Insert here the text to be printed before the date.

$format : string = NULL

A datetime format, if using localized dates an ICU dateformat

getAlbumLocation()

Returns the Location of the album.

getAlbumLocation() : string
Return values
string

printAlbumLocation()

Prints the location of the album

printAlbumLocation() : mixed
Tags
author

Ozh

getAlbumDesc()

Returns the raw description of the current album.

getAlbumDesc() : string
Return values
string

getBareAlbumDesc()

Returns a text-only description of the current album.

getBareAlbumDesc() : string
Return values
string

printAlbumDesc()

Prints description of the current album

printAlbumDesc() : mixed
Tags
author

Ozh

getAlbumCustomData()

Returns the custom_data field of the current album

getAlbumCustomData() : string
Return values
string

printAlbumCustomData()

Prints the custom_data field of the current album.

printAlbumCustomData() : mixed

Converts and displays line break in the admin field as
.

Tags
author

Ozh

getAlbumData()

A composit for getting album data

getAlbumData(string $field) : string
Parameters
$field : string

which field you want

Return values
string

printAlbumData()

Prints arbitrary data from the album object

printAlbumData(string $field[, string $label = '' ]) : mixed
Parameters
$field : string

the field name of the data desired

$label : string = ''

text to label the field

Tags
author

Ozh

getAlbumPage()

Returns the album page number of the current image

getAlbumPage([object $album = NULL ]) : int
Parameters
$album : object = NULL

optional album object

Return values
int

getAlbumURL()

Returns the album link url of the current album.

getAlbumURL([object $album = NULL ]) : string
Parameters
$album : object = NULL

optional album object

Return values
string

printAlbumURL()

Prints the album link url of the current album.

printAlbumURL(string $text, string $title[, string $class = NULL ][, string $id = NULL ]) : mixed
Parameters
$text : string

Insert the link text here.

$title : string

Insert the title text here.

$class : string = NULL

Insert here the CSS-class name with with you want to style the link.

$id : string = NULL

Insert here the CSS-id name with with you want to style the link.

getAlbumThumb()

Returns the name of the defined album thumbnail image.

getAlbumThumb() : string
Return values
string

getPasswordProtectImage()

Returns an <img> element of the password protect thumb substitute

getPasswordProtectImage([string $extra = '' ]) : string
Parameters
$extra : string = ''

extra stuff to put in the HTML

Tags
deprecated
2.0

Use printPasswordProtectedImage() instead

Return values
string

getPasswordProtectedImage()

Gets the URL to the password protected images

getPasswordProtectedImage() : string
Tags
since
1.6.1
global

string $_zp_themeroot

Return values
string

printPasswordProtectedImage()

Prints an image element with the password protected image.

printPasswordProtectedImage([string $extra = '' ]) : mixed
Parameters
$extra : string = ''

extra attributes, trailing space required. Do not pass the width/height as it is taken from the image itself

Tags
since
1.6.1

Replaces getPasswordProtectImage()

printAlbumThumbImage()

Prints the album thumbnail image.

printAlbumThumbImage([string $alt = '' ][, string $class = '' ][, string $id = '' ][, string $title = '' ]) : mixed
Parameters
$alt : string = ''

Insert the text for the alternate image name here.

$class : string = ''

Insert here the CSS-class name with with you want to style the link.

$id : string = ''

Insert here the CSS-id name with with you want to style the link.

$title : string = ''

option title attribute

getCustomAlbumThumb()

Returns a link to a custom sized thumbnail of the current album

getCustomAlbumThumb([int $size = null ][, int $width = NULL ][, int $height = NULL ][, int $cropw = NULL ][, int $croph = NULL ][, int $cropx = NULL ][, int $cropy = null ][, bool $effects = NULL ]) : string
Parameters
$size : int = null

the size of the image to have

$width : int = NULL

width

$height : int = NULL

height

$cropw : int = NULL

crop width

$croph : int = NULL

crop height

$cropx : int = NULL

crop part x axis

$cropy : int = null

crop part y axis

$effects : bool = NULL

image effects (e.g. set 'gray' to force grayscale)

Return values
string

printCustomAlbumThumbImage()

Prints a link to a custom sized thumbnail of the current album

printCustomAlbumThumbImage([string $alt = '' ][, int $size = null ][, int $width = NULL ][, int $height = NULL ][, int $cropw = NULL ][, int $croph = NULL ][, int $cropx = NULL ][, int $cropy = null ][, string $class = NULL ][, string $id = NULL ][, string $title = null ][, bool $maxspace = false ]) : string

See getCustomImageURL() for details.

Parameters
$alt : string = ''

Alt atribute text

$size : int = null

size

$width : int = NULL

width

$height : int = NULL

height

$cropw : int = NULL

cropwidth

$croph : int = NULL

crop height

$cropx : int = NULL

crop part x axis

$cropy : int = null

crop part y axis

$class : string = NULL

css class

$id : string = NULL

css id

$title : string = null

title attribute

$maxspace : bool = false

true for maxspace image, false is default

Return values
string

getMaxSpaceContainer()

Called by ***MaxSpace functions to compute the parameters to be passed to xxCustomyyy functions.

getMaxSpaceContainer(int &$width, int &$height, object $image[, bool $thumb = false ]) : mixed
Parameters
$width : int

maxspace width

$height : int

maxspace height

$image : object

the image in question

$thumb : bool = false

true if for a thumbnail

getCustomAlbumThumbMaxSpace()

Returns a link to a un-cropped custom sized version of the current album thumb within the given height and width dimensions.

getCustomAlbumThumbMaxSpace(int $width, int $height) : string
Parameters
$width : int

width

$height : int

height

Return values
string

printCustomAlbumThumbMaxSpace()

Prints a un-cropped custom sized album thumb within the given height and width dimensions.

printCustomAlbumThumbMaxSpace([string $alt = '' ][, int $width = null ][, int $height = null ][, string $class = NULL ][, string $id = NULL ][, string $title = null ]) : mixed

Note: a class of 'not_visible' or 'password_protected' will be added as appropriate

Parameters
$alt : string = ''

Alt text for the url

$width : int = null

width

$height : int = null

height

$class : string = NULL

Optional style class

$id : string = NULL

Optional style id

$title : string = null

Optional title attribute

getNextAlbum()

Returns the next album

getNextAlbum() : object
Return values
object

getNextAlbumURL()

Get the URL of the next album in the gallery.

getNextAlbumURL() : string
Return values
string

getPrevAlbum()

Returns the previous album

getPrevAlbum() : object
Return values
object

getPrevAlbumURL()

Get the URL of the previous album in the gallery.

getPrevAlbumURL() : string
Return values
string

isImagePage()

Returns true if this page has image thumbs on it

isImagePage() : bool
Return values
bool

isAlbumPage()

Returns true if this page has album thumbs on it

isAlbumPage() : bool
Return values
bool

getNumImages()

Returns the number of images in the album.

getNumImages() : int
Return values
int

getFirstPageImages()

getFirstPageImages([type $one_image_page = false ]) : type
Parameters
$one_image_page : type = false
Tags
since
1.6
global

obj $_zp_current_album

global

type $_zp_current_search

Return values
type

next_image()

Returns the next image on a page.

next_image([bool $all = false ][, int $firstPageCount = NULL ][, bool $mine = NULL ]) : bool

sets $_zp_current_image to the next image in the album.

Returns true if there is an image to be shown

Parameters
$all : bool = false

set to true disable pagination

$firstPageCount : int = NULL

the number of images which can go on the page that transitions between albums and images Normally this parameter should be NULL so as to use the default computations.

$mine : bool = NULL

overridePassword the password check

Return values
bool

makeImageCurrent()

Sets the image passed as the current image

makeImageCurrent(object $image) : mixed
Parameters
$image : object

the image to become current

getImageTitle()

Returns the raw title of the current image.

getImageTitle() : string
Return values
string

getBareImageTitle()

Returns a text-only title of the current image.

getBareImageTitle() : string
Return values
string

getAnnotatedImageTitle()

Returns the image title taged with not visible annotation.

getAnnotatedImageTitle() : string
Return values
string

printImageTitle()

Prints title of the current image

printImageTitle() : mixed
Tags
author

Ozh

imageNumber()

Returns the 'n' of n of m images

imageNumber() : int
Return values
int

getImageDate()

Returns the image date of the current image in yyyy-mm-dd hh:mm:ss format.

getImageDate([string $format = null ]) : string

Pass it a date format string for custom formatting

Parameters
$format : string = null

A datetime format, if using localized dates an ICU dateformat

Return values
string

printImageDate()

Prints the date of the current album

printImageDate([string $before = '' ][, string $format = null ]) : mixed
Parameters
$before : string = ''

Insert here the text to be printed before the date.

$format : string = null

A datetime format, if using localized dates an ICU dateformat

getImageLocation()

Returns the Location field of the current image

getImageLocation() : string
Return values
string

getImageCity()

Returns the City field of the current image

getImageCity() : string
Return values
string

getImageState()

Returns the State field of the current image

getImageState() : string
Return values
string

getImageCountry()

Returns the Country field of the current image

getImageCountry() : string
Return values
string

getImageDesc()

Returns the raw description of the current image.

getImageDesc() : string

new lines are replaced with
tags

Return values
string

getBareImageDesc()

Returns a text-only description of the current image.

getBareImageDesc() : string
Return values
string

printImageDesc()

Prints the description of the current image.

printImageDesc() : mixed

Converts and displays line breaks set in the admin field as
.

getImageData()

A composit for getting image data

getImageData(string $field) : string
Parameters
$field : string

which field you want

Return values
string

getImageCustomData()

Returns the custom_data field of the current image

getImageCustomData() : string
Return values
string

printImageCustomData()

Prints the custom_data field of the current image.

printImageCustomData() : string

Converts and displays line breaks set in the admin field as
.

Return values
string

printImageData()

Prints arbitrary data from the image object

printImageData(string $field[, string $label = '' ]) : mixed
Parameters
$field : string

the field name of the data desired

$label : string = ''

text to label the field.

Tags
author

Ozh

getFullImageFilesize()

Returns the file size of the full original image

getFullImageFilesize() : int
Tags
since
1.5.2
global

obj $_zp_current_image

Return values
int

hasNextImage()

True if there is a next image

hasNextImage() : bool
Return values
bool

hasPrevImage()

True if there is a previous image

hasPrevImage() : bool
Return values
bool

getNextImageURL()

Returns the url of the next image.

getNextImageURL() : string
Return values
string

getPrevImageURL()

Returns the url of the previous image.

getPrevImageURL() : string
Return values
string

getPrevImageThumb()

Returns the thumbnail of the previous image.

getPrevImageThumb() : string
Return values
string

getNextImageThumb()

Returns the thumbnail of the next image.

getNextImageThumb() : string
Return values
string

getImageURL()

Returns the url of the current image.

getImageURL() : string
Return values
string

printImageURL()

Prints the link to the current image.

printImageURL(string $text, string $title[, string $class = NULL ][, string $id = NULL ]) : mixed
Parameters
$text : string

text for the link

$title : string

title tag for the link

$class : string = NULL

optional style class for the link

$id : string = NULL

optional style id for the link

getImageMetaData()

Returns the Metadata infromation from the current image

getImageMetaData([ $image = NULL ][, string $displayonly = true ]) : array<string|int, mixed>
Parameters
$image : = NULL

optional image object

$displayonly : string = true

set to true to return only the items selected for display

Return values
array<string|int, mixed>

printImageMetadata()

Prints the Metadata data of the current image

printImageMetadata([string $title = NULL ][, bool $toggle = true ][, string $id = 'imagemetadata' ][, string $class = null ][, mixed $span = NULL ]) : mixed
Parameters
$title : string = NULL

title tag for the class

$toggle : bool = true

set to true to get a javascript toggle on the display of the data

$id : string = 'imagemetadata'

style class id

$class : string = null

style class

$span : mixed = NULL
Tags
author

Ozh

getSizeCustomImage()

Returns an array with the height & width

getSizeCustomImage([int $size = null ][, int $width = NULL ][, int $height = NULL ][, int $cw = NULL ][, int $ch = NULL ][, int $cx = NULL ][, int $cy = NULL ][, obj $image = NULL ][, string $type = 'image' ]) : array<string|int, mixed>
Parameters
$size : int = null

size

$width : int = NULL

width

$height : int = NULL

height

$cw : int = NULL

crop width

$ch : int = NULL

crop height

$cx : int = NULL

crop x axis

$cy : int = NULL

crop y axis

$image : obj = NULL

The image object for which the size is desired. NULL means the current image

$type : string = 'image'

"image" (sizedimage) (default), "thumb" (thumbnail) required for using option settings for uncropped images

Return values
array<string|int, mixed>

getSizeDefaultImage()

Returns an array [width, height] of the default-sized image.

getSizeDefaultImage([int $size = NULL ][,  $image = NULL ]) : array<string|int, mixed>
Parameters
$size : int = NULL

override the 'image_zize' option

$image : = NULL

object the image for which the size is desired. NULL means the current image

Return values
array<string|int, mixed>

getSizeFullImage()

Returns an array [width, height] of the original image.

getSizeFullImage([ $image = NULL ]) : array<string|int, mixed>
Parameters
$image : = NULL

object the image for which the size is desired. NULL means the current image

Return values
array<string|int, mixed>

getDefaultWidth()

The width of the default-sized image (in printDefaultSizedImage)

getDefaultWidth([mixed $size = NULL ][,  $image = NULL ]) : int
Parameters
$size : mixed = NULL
$image : = NULL

object the image for which the size is desired. NULL means the current image

Return values
int

getDefaultHeight()

Returns the height of the default-sized image (in printDefaultSizedImage)

getDefaultHeight([mixed $size = NULL ][,  $image = NULL ]) : int
Parameters
$size : mixed = NULL
$image : = NULL

object the image for which the size is desired. NULL means the current image

Return values
int

getFullWidth()

Returns the width of the original image

getFullWidth([ $image = NULL ]) : int
Parameters
$image : = NULL

object the image for which the size is desired. NULL means the current image

Return values
int

getFullHeight()

Returns the height of the original image

getFullHeight([ $image = NULL ]) : int
Parameters
$image : = NULL

object the image for which the size is desired. NULL means the current image

Return values
int

isLandscape()

Returns true if the image is landscape-oriented (width is greater than height) or - kept here for backwards compatibility - square (equal widht and height)

isLandscape([ $image = NULL ]) : bool
Parameters
$image : = NULL

object the image for which the size is desired. NULL means the current image

Return values
bool

getDefaultSizedImage()

Returns the url to the default sized image.

getDefaultSizedImage([ $image = NULL ]) : string
Parameters
$image : = NULL

object the image for which the size is desired. NULL means the current image

Return values
string

printDefaultSizedImage()

Show video player with video loaded or display the image.

printDefaultSizedImage(string $alt[, string $class = null ][, string $id = null ][, string $title = null ][, obj $image = null ]) : mixed
Parameters
$alt : string

Alt text

$class : string = null

Optional style class

$id : string = null

Optional style id

$title : string = null

Optional title attribute

$image : obj = null

optional image object, null means current image

getImageThumb()

Returns the url to the thumbnail of the current image.

getImageThumb() : string
Return values
string

printImageThumb()

printImageThumb(string $alt[, string $class = null ][, string $id = null ][, string $title = null ][, obj $image = null ]) : mixed
Parameters
$alt : string

Alt text

$class : string = null

optional class attribute

$id : string = null

optional id attribute

$title : string = null

optional title attribute

$image : obj = null

optional image object, null means current image

getSizeDefaultThumb()

Gets the width and height of a default thumb for the <img> tag height/width

getSizeDefaultThumb([obj $image = NULL ]) : aray
Parameters
$image : obj = NULL

Image object, if NULL the current image is used

Tags
global

type $_zp_current_image

Return values
aray

getFullImageURL()

Returns the url to original image.

getFullImageURL([ $image = NULL ]) : string

It will return a protected image is the option "protect_full_image" is set

Parameters
$image : = NULL

optional image object

Return values
string

getUnprotectedImageURL()

Returns the "raw" url to the image in the albums folder

getUnprotectedImageURL([ $image = NULL ]) : string
Parameters
$image : = NULL

optional image object

Return values
string

getProtectedImageURL()

Returns an url to the password protected/watermarked current image

getProtectedImageURL([object $image = NULL ][, string $disposal = NULL ]) : string
Parameters
$image : object = NULL

optional image object overrides the current image

$disposal : string = NULL

set to override the 'protect_full_image' option. 'protected', "download", "unprotected" or "no-access"

Return values
string

getSizedImageURL()

Returns a link to the current image custom sized to $size

getSizedImageURL(int $size) : mixed
Parameters
$size : int

The size the image is to be

getCustomImageURL()

Returns the url to the image with the dimensions you define with this function.

getCustomImageURL(int $size[, int $width = NULL ][, int $height = NULL ][, int $cropw = NULL ][, int $croph = NULL ][, int $cropx = NULL ][, int $cropy = NULL ][, bool $thumbStandin = false ][, bool $effects = NULL ][, obj $image = null ]) : string
Parameters
$size : int

the size of the image to have

$width : int = NULL

width

$height : int = NULL

height

$cropw : int = NULL

crop width

$croph : int = NULL

crop height

$cropx : int = NULL

crop part x axis

$cropy : int = NULL

crop part y axis

$thumbStandin : bool = false

set true to inhibit watermarking

$effects : bool = NULL

image effects (e.g. set gray to force to grayscale)

$image : obj = null

optional image object, null means current image

Return values
string

$size, $width, and $height are used in determining the final image size. At least one of these must be provided. If $size is provided, $width and $height are ignored. If both $width and $height are provided, the image will have those dimensions regardless of the original image height/width ratio. (Yes, this means that the image may be distorted!)

The $crop* parameters determine the portion of the original image that will be incorporated into the final image.

$cropw and $croph "sizes" are typically proportional. That is you can set them to values that reflect the ratio of width to height that you want for the final image. Typically you would set them to the final height and width. These values will always be adjusted so that they are not larger than the original image dimensions.

The $cropx and $cropy values represent the offset of the crop from the top left corner of the image. If these values are provided, the $croph and $cropw parameters are treated as absolute pixels not proportions of the image. If cropx and cropy are not provided, the crop will be "centered" in the image.

When $cropx and $cropy are not provided the crop is offset from the top left proportionally to the ratio of the final image size and the crop size.

Some typical croppings:

$size=200, $width=NULL, $height=NULL, $cropw=200, $croph=100, $cropx=NULL, $cropy=NULL produces an image cropped to a 2x1 ratio which will fit in a 200x200 pixel frame.

$size=NULL, $width=200, $height=NULL, $cropw=200, $croph=100, $cropx=100, $cropy=10 will will take a 200x100 pixel slice from (10,100) of the picture and create a 200x100 image

$size=NULL, $width=200, $height=100, $cropw=200, $croph=120, $cropx=NULL, $cropy=NULL will produce a (distorted) image 200x100 pixels from a 1x0.6 crop of the image.

$size=NULL, $width=200, $height=NULL, $cropw=180, $croph=120, $cropx=NULL, $cropy=NULL will produce an image that is 200x133 from a 1.5x1 crop that is 5% from the left and 15% from the top of the image.

printCustomSizedImage()

Print normal video or custom sized images.

printCustomSizedImage([string $alt = '' ][, int $size = null ][, int $width = NULL ][, int $height = NULL ][, int $cropw = NULL ][, int $croph = NULL ][, int $cropx = NULL ][, int $cropy = NULL ][, string $class = NULL ][, string $id = NULL ][, bool $thumbStandin = false ][, bool $effects = NULL ][, string $title = null ][, string $type = 'image' ][, obj $image = null ][, bool $maxspace = false ]) : mixed

Note: a class of 'not_visible' or 'password_protected' will be added as appropriate

Notes on cropping:

The $crop* parameters determine the portion of the original image that will be incorporated into the final image. The w and h "sizes" are typically proportional. That is you can set them to values that reflect the ratio of width to height that you want for the final image. Typically you would set them to the fincal height and width.

Parameters
$alt : string = ''

Alt text for the url

$size : int = null

size

$width : int = NULL

width

$height : int = NULL

height

$cropw : int = NULL

crop width

$croph : int = NULL

crop height

$cropx : int = NULL

crop x axis

$cropy : int = NULL

crop y axis

$class : string = NULL

Optional style class

$id : string = NULL

Optional style id

$thumbStandin : bool = false

set to true to treat as thumbnail

$effects : bool = NULL

image effects (e.g. set gray to force grayscale)

$title : string = null

Optional title attribute

$type : string = 'image'

"image" (sizedimage) (default), "thumb" (thumbnail) required for using option settings for uncropped images

$image : obj = null

optional image object, null means current image

$maxspace : bool = false

true for maxspace, false default

getCustomSizedImageMaxSpace()

Returns a link to a un-cropped custom sized version of the current image within the given height and width dimensions.

getCustomSizedImageMaxSpace(int $width, int $height) : string

Use for sized images.

Parameters
$width : int

width

$height : int

height

Return values
string

getCustomSizedImageThumbMaxSpace()

Returns a link to a un-cropped custom sized version of the current image within the given height and width dimensions.

getCustomSizedImageThumbMaxSpace(int $width, int $height) : string

Use for sized thumbnails.

Parameters
$width : int

width

$height : int

height

Return values
string

printCustomSizedImageThumbMaxSpace()

Creates image thumbnails which will fit un-cropped within the width & height parameters given

printCustomSizedImageThumbMaxSpace([string $alt = '' ][, int $width = null ][, int $height = null ][, string $class = NULL ][, string $id = NULL ][, string $title = null ][, obj $image = null ]) : mixed
Parameters
$alt : string = ''

Alt text for the url

$width : int = null

width

$height : int = null

height

$class : string = NULL

Optional style class

$id : string = NULL

Optional style id

$title : string = null

optional title attribute

$image : obj = null

optional image object, null means current image

printCustomSizedImageMaxSpace()

Print normal video or un-cropped within the given height and width dimensions. Use for sized images or thumbnails in an album.

printCustomSizedImageMaxSpace([string $alt = '' ][, int $width = null ][, int $height = null ][, string $class = NULL ][, string $id = NULL ][, mixed $thumb = false ][, string $title = null ][, obj $image = null ]) : mixed

Note: a class of 'not_visible' or 'password_protected' will be added as appropriate

Parameters
$alt : string = ''

Alt text for the url

$width : int = null

width

$height : int = null

height

$class : string = NULL

Optional style class

$id : string = NULL

Optional style id

$thumb : mixed = false
$title : string = null

optional title attribute

$image : obj = null

optional image object, null means current image

printSizedImageURL()

Prints link to an image of specific size

printSizedImageURL(int $size, string $text, string $title[, string $class = NULL ][, string $id = NULL ]) : mixed
Parameters
$size : int

how big

$text : string

URL text

$title : string

URL title

$class : string = NULL

optional URL class

$id : string = NULL

optional URL id

getTags()

Returns a list of tags for context of the page called where called

getTags() : string
Tags
since
1.1
Return values
string

printTags()

Prints a list of tags, editable by admin

printTags([string $option = 'links' ][, string $preText = NULL ][, string $class = NULL ][, string $separator = ', ' ]) : mixed
Parameters
$option : string = 'links'

links by default, if anything else the tags will not link to all other images with the same tag

$preText : string = NULL

text to go before the printed tags

$class : string = NULL

css class to apply to the div surrounding the UL list

$separator : string = ', '

what charactor shall separate the tags

Tags
since
1.1

printAllTagsAs()

Either prints all of the galleries tgs as a UL list or a cloud

printAllTagsAs(string $option[, string $class = '' ][, string $sort = NULL ][, bool $counter = FALSE ][, bool $links = TRUE ][, int $maxfontsize = 2 ][, int $maxcount = 50 ][, int $mincount = 1 ][, int $limit = NULL ][, int $minfontsize = 0.8 ][, bool $exclude_unassigned = true ][, bool $checkaccess = false ]) : mixed
Parameters
$option : string

"cloud" for tag cloud, "list" for simple list

$class : string = ''

CSS class

$sort : string = NULL

"results" for relevance list, "random" for random ordering, otherwise the list is alphabetical

$counter : bool = FALSE

TRUE if you want the tag count within brackets behind the tag

$links : bool = TRUE

set to TRUE to have tag search links included with the tag.

$maxfontsize : int = 2

largest font size the cloud should display

$maxcount : int = 50

the floor count for setting the cloud font size to $maxfontsize

$mincount : int = 1

the minimum count for a tag to appear in the output

$limit : int = NULL

set to limit the number of tags displayed to the top $numtags

$minfontsize : int = 0.8

minimum font size the cloud should display

$exclude_unassigned : bool = true

True or false if you wish to exclude tags that are not assigne to any item (default: true)

$checkaccess : bool = false

True or false (default: false) if you wish to exclude tags that are assigned to items (or are not assigned at all) the visitor is not allowed to see Beware that this may cause overhead on large sites. Usage of the static_html_cache is strongely recommended then.

Tags
since
1.1

getAllDates()

Retrieves a list of all unique years & months from the images in the gallery

getAllDates([string $order = 'asc' ]) : array<string|int, mixed>
Parameters
$order : string = 'asc'

set to 'desc' for the list to be in descending order

Return values
array<string|int, mixed>

printAllDates()

Prints a compendum of dates and links to a search page that will show results of the date

printAllDates([string $class = 'archive' ][, string $yearid = 'year' ][, string $monthid = 'month' ][, string $order = 'desc' ]) : mixed
Parameters
$class : string = 'archive'

optional class

$yearid : string = 'year'

optional class for "year"

$monthid : string = 'month'

optional class for "month"

$order : string = 'desc'

set to 'desc' for the list to be in descending order

getCustomPageURL()

Produces the url to a custom page (e.g. one that is not album.php, image.php, or index.php)

getCustomPageURL(string $page[, string $q = '' ][, bool $webpath = null ]) : string
Parameters
$page : string

page name to include in URL

$q : string = ''

query string to add to url

$webpath : bool = null

host path to be prefixed. If "false" is passed you will get a localized "WEBPATH"

Return values
string

printCustomPageURL()

Prints the url to a custom page (e.g. one that is not album.php, image.php, or index.php)

printCustomPageURL(string $linktext, string $page[, string $q = '' ][, string $prev = '' ][, string $next = '' ][, string $class = NULL ]) : mixed
Parameters
$linktext : string

Text for the URL

$page : string

page name to include in URL

$q : string = ''

query string to add to url

$prev : string = ''

text to insert before the URL

$next : string = ''

text to follow the URL

$class : string = NULL

optional class

isArchive()

tests if a search page is an "archive" page

isArchive() : bool
Return values
bool

getSearchURL()

Returns a search URL

getSearchURL(mixed $words, mixed $dates, mixed $fields, int $page[, array<string|int, mixed> $object_list = NULL ]) : string
Parameters
$words : mixed

the search words target

$dates : mixed

the dates that limit the search

$fields : mixed

the fields on which to search

$page : int

the page number for the URL

$object_list : array<string|int, mixed> = NULL

the list of objects to search

Tags
since
1.1.3
deprecated
2.0
  • Use SearchEngine::getSearchURL() instead
Return values
string

printSearchForm()

Prints the search form

printSearchForm([string $prevtext = NULL ][, string $id = 'search' ][, string $buttonSource = '' ][, string $buttontext = '' ][, string $iconsource = NULL ][, array<string|int, mixed> $query_fields = NULL ][, mixed $object_list = NULL ][, string $within = NULL ][, bool $enable_fieldselector = null ]) : mixed

Search works on a list of tokens entered into the search form.

Tokens may be part of boolean expressions using &, |, !, and parens. (Comma is retained as a synonom of | for backwords compatibility.)

Tokens may be enclosed in quotation marks to create exact pattern matches or to include the boolean operators and parens as part of the tag..

Parameters
$prevtext : string = NULL

text to go before the search form

$id : string = 'search'

css id for the search form, default is 'search'

$buttonSource : string = ''

optional path to the image for the button or if not a path to an image, this will be the button hint

$buttontext : string = ''

optional text for the button ("Search" will be the default text)

$iconsource : string = NULL

optional theme based icon for the search fields toggle

$query_fields : array<string|int, mixed> = NULL

override selection for enabled fields with this list

$object_list : mixed = NULL
$within : string = NULL

set to true to search within current results, false to search fresh

$enable_fieldselector : bool = null

True|false to enable/disable the search fields selector. Default null to use the option as set

Tags
since
1.1.3

getSearchWords()

Returns the a sanitized version of the search string

getSearchWords() : string
Tags
since
1.1
Return values
string

getSearchDate()

Returns the date of the search

getSearchDate([string $format = 'F Y' ]) : string
Parameters
$format : string = 'F Y'

A datetime format, if using localized dates an ICU dateformat

Tags
since
1.1
Return values
string

checkForGuest()

returns the auth type of a guest login

checkForGuest([string &$hint = NULL ][, string &$show = NULL ]) : string
Parameters
$hint : string = NULL
$show : string = NULL
Return values
string

checkAccess()

Checks to see if a password is needed

checkAccess([string &$hint = NULL ][, bool &$show = NULL ]) : bool

Returns true if access is allowed

The password protection is hereditary. This normally only impacts direct url access to an object since if you are going down the tree you will be stopped at the first place a password is required.

Parameters
$hint : string = NULL

the password hint

$show : bool = NULL

whether there is a user associated with the password.

Tags
since
1.1.3
Return values
bool

getPageRedirect()

Returns a redirection link for the password form

getPageRedirect() : string
Return values
string

printPasswordForm()

Prints the album password form

printPasswordForm(mixed $_password_hint[, mixed $_password_showuser = NULL ][, mixed $_password_showProtected = true ][, mixed $_password_redirect = NULL ]) : mixed
Parameters
$_password_hint : mixed
$_password_showuser : mixed = NULL
$_password_showProtected : mixed = true
$_password_redirect : mixed = NULL
Tags
since
1.1.3

prints the zenphoto logo and link

printZenphotoLink() : mixed

exposeZenPhotoInformations()

Expose some informations in a HTML comment

exposeZenPhotoInformations([string $obj = '' ][, array<string|int, mixed> $plugins = '' ][, string $theme = '' ]) : mixed
Parameters
$obj : string = ''

the path to the page being loaded

$plugins : array<string|int, mixed> = ''

list of activated plugins

$theme : string = ''

The theme being used

getCodeblock()

Gets the content of a codeblock for an image, album or Zenpage newsarticle or page.

getCodeblock([int $number = 1 ][, mixed $object = NULL ]) : string

The priority for codeblocks will be (based on context) 1: articles 2: pages 3: images 4: albums 5: gallery.

This means, for instance, if we are in ZP_ZENPAGE_NEWS_ARTICLE context we will use the news article codeblock even if others are available.

Note: Echoing this array's content does not execute it. Also no special chars will be escaped. Use printCodeblock() if you need to execute script code.

Parameters
$number : int = 1

The codeblock you want to get

$object : mixed = NULL
Return values
string

printCodeblock()

Prints the content of a codeblock for an image, album or Zenpage newsarticle or page.

printCodeblock([int $number = 1 ][, mixed $what = NULL ]) : string
Parameters
$number : int = 1

The codeblock you want to get

$what : mixed = NULL

optonal object for which you want the codeblock

Return values
string

checkPageValidity()

Checks for URL page out-of-bounds for "standard" themes Note: This function assumes that an "index" page will display albums and the pagination be determined by them. Any other "index" page strategy needs to be handled by the theme itself.

checkPageValidity(bool $request, string $gallery_page, int $page) : bool
Parameters
$request : bool
$gallery_page : string
$page : int
Return values
bool

will be true if all is well, false if a 404 error should occur

print404status()

print404status(mixed $album, mixed $image, mixed $obj) : mixed
Parameters
$album : mixed
$image : mixed
$obj : mixed

getOwnerAuthor()

Gets current item's owner (gallery images and albums) or author (Zenpage articles and pages)

getOwnerAuthor([bool $fullname = false ]) : bool
Parameters
$fullname : bool = false

If the owner/author has a real user account and there is a full name set it is returned

Tags
since
1.5.2
global

obj $_zp_current_album

global

obj $_zp_current_image

global

obj $_zp_current_zenpage_page

global

obj $_zp_current_zenpage_news

Return values
bool

printOwnerAuthor()

Prints current item's owner (gallery images and albums) or author (Zenpage articles and pages)

printOwnerAuthor([type $fullname = false ]) : mixed
Parameters
$fullname : type = false
Tags
since
1.5.2

getOwnerAuthorURL()

Returns the search url for items the current item's owner (gallery) or author (Zenpage) is assigned to

getOwnerAuthorURL() : type

This eventually may return the url to an actual user profile page in the future.

Tags
since
1.5.2
Return values
type

printOwnerAuthorURL()

Prints the link to the search engine for results of all items the current item's owner (gallery) or author (Zenpage) is assigned to

printOwnerAuthorURL([type $fullname = false ][, type $resulttype = 'all' ][, type $class = null ][, type $id = null ][, type $title = null ]) : mixed

This eventually may return the url to an actual user profile page in the future.

Parameters
$fullname : type = false
$resulttype : type = 'all'
$class : type = null
$id : type = null
$title : type = null
Tags
since
1.5.2

getUserURL()

Returns a an url for the search engine for results of all items the user with $username is assigned to either as owner (gallery) or author (Zenpage) Note there is no check if the user name is actually a vaild user account name, owner or author! Use the *OwerAuthor() function for that instead

getUserURL(string $username[, string $resulttype = 'all' ]) : string|null

This eventually may return the url to an actual user profile page in the future.

Parameters
$username : string

The user name of a user. Note there is no check if the user name is actually valid!

$resulttype : string = 'all'

'all' for owner and author, 'gallery' for owner of images/albums only, 'zenpage' for author of news articles and pages

Tags
since
1.5.2
Return values
string|null

printUserURL()

Prints the link to the search engine for results of all items $username is assigned to either as owner (gallery) or author (Zenpage) Note there is no check if the user name is actually a vaild user account name, owner or author! Use the *OwerAuthor() function for that instead

printUserURL(string $username[, string $resulttype = 'all' ][, string $linktext = null ][, string $class = null ][, type $id = null ][, type $title = null ]) : mixed

This eventually may point to an actual user profile page in the future.

Parameters
$username : string

The user name of a user.

$resulttype : string = 'all'

'all' for owner and author, 'gallery' for owner of images/albums only, 'zenpage' for author of news articles and pages

$linktext : string = null

The link text. If null the user name will be used

$class : string = null

The CSS class to attach, default null.

$id : type = null

The CSS id to attach, default null.

$title : type = null

The title attribute to attach, default null so the user name is used

Tags
since
1.5.2

printCopyrightNotice()

Display the site or image copyright notice if defined and display is enabled

printCopyrightNotice([string $before = '' ][, string $after = '' ][, mixed $linked = true ][, mixed $type = 'gallery' ]) : mixed
Parameters
$before : string = ''

Text to print before it

$after : string = ''

Text to print after it œparam bool $linked Default true to use the copyright URL if defined

$linked : mixed = true
$type : mixed = 'gallery'
Tags
since
1.5.8
since
1.6

Also handles the image copyright notice

global

obj $_zp_gallery

printGalleryCopyrightNotice()

Display the site copyright notice if defined and display is enabled

printGalleryCopyrightNotice([string $before = '' ][, string $after = '' ][, mixed $linked = true ]) : mixed
Parameters
$before : string = ''

Text to print before it

$after : string = ''

Text to print after it œparam bool $linked Default true to use the copyright URL if defined

$linked : mixed = true
Tags
since
1.6
  • Added as shortcut to the general printCopyRightNotice

printImageCopyrightNotice()

Display the image copyright notice if defined and display iss enabled

printImageCopyrightNotice([string $before = '' ][, string $after = '' ][, mixed $linked = true ]) : mixed
Parameters
$before : string = ''

Text to print before it

$after : string = ''

Text to print after it œparam bool $linked Default true to use the copyright URL if defined

$linked : mixed = true
Tags
since
1.6
  • Added as shortcut to the general printCopyRightNotice

getCurrentPageAppendix()

Gets the current page number if it is larger than 1 for use on paginated pages for SEO reason to avoid duplicate titles

getCurrentPageAppendix([string $before = ' (' ][, string $after = ')' ]) : string
Parameters
$before : string = ' ('

Text to add before the page number. Default ' (';

$after : string = ')'

Text to add ager the page number. Default ')';

Tags
since
1.6
Return values
string

printCurrentPageAppendix()

Prints the current page number if it is larger than 1 for use on paginated pages for SEO reason to avoid duplicate titles

printCurrentPageAppendix([string $before = ' (' ][, string $after = ')' ]) : mixed
Parameters
$before : string = ' ('

Text to add before the page number. Default ' (';

$after : string = ')'

Text to add ager the page number. Default ')';

Tags
since
1.6

        
On this page

Search results