ZenphotoCMS 1.6.5

functions-controller.php

Common functions used in the controller for getting/setting current classes, redirecting URLs, and working with the context.

Table of Contents

Functions

zpRewriteURL()  : string
Creates a "REWRITE" url given the query parameters that represent the link
fix_path_redirect()  : mixed
Checks to see if the current URL is a query string url when mod_rewrite is active.
zp_load_page()  : mixed
zp_load_gallery()  : mixed
initializes the gallery.
zp_load_search()  : mixed
Loads the search object.
zp_load_album()  : the
zp_load_album - loads the album given by the folder name $folder into the global context, and sets the context appropriately.
zp_load_image()  : the
zp_load_image - loads the image given by the $folder and $filename into the global context, and sets the context appropriately.
load_zenpage_pages()  : object
Loads a zenpage pages page Sets up $_zp_current_zenpage_page and returns it as the function result.
load_zenpage_news()  : object
Loads a zenpage news article Sets up $_zp_current_zenpage_news and returns it as the function result.
zp_load_request()  : bool
Figures out what is being accessed and calls the appropriate load function
prepareIndexPage()  : string
sets up for loading the index page
prepareAlbumPage()  : mixed
sets up for loading an album page
prepareImagePage()  : string
sets up for loading an image page
prepareCustomPage()  : string
sets up for loading p=page pages
redirectionHandler()  : mixed
Handles redirections via filter hook "redirection_handler".

Functions

zpRewriteURL()

Creates a "REWRITE" url given the query parameters that represent the link

zpRewriteURL(type $query) : string
Parameters
$query : type
Return values
string

fix_path_redirect()

Checks to see if the current URL is a query string url when mod_rewrite is active.

fix_path_redirect() : mixed

If so it will redirects to the rewritten URL with a 301 Moved Permanently.

zp_load_page()

zp_load_page([mixed $pagenum = NULL ]) : mixed
Parameters
$pagenum : mixed = NULL

zp_load_album()

zp_load_album - loads the album given by the folder name $folder into the global context, and sets the context appropriately.

zp_load_album( $folder[, mixed $force_nocache = false ]) : the
Parameters
$folder :

the folder name of the album to load. Ex: 'testalbum', 'test/subalbum', etc.

$force_nocache : mixed = false
Return values
the

loaded album object on success, or (===false) on failure.

zp_load_image()

zp_load_image - loads the image given by the $folder and $filename into the global context, and sets the context appropriately.

zp_load_image( $folder,  $filename) : the
Parameters
$folder :

is the folder name of the album this image is in. Ex: 'testalbum'

$filename :

is the filename of the image to load.

Return values
the

loaded album object on success, or (===false) on failure.

load_zenpage_pages()

Loads a zenpage pages page Sets up $_zp_current_zenpage_page and returns it as the function result.

load_zenpage_pages( $titlelink) : object
Parameters
$titlelink :

the titlelink of a zenpage page to setup a page object directly. Used for custom page scripts based on a zenpage page.

Return values
object

load_zenpage_news()

Loads a zenpage news article Sets up $_zp_current_zenpage_news and returns it as the function result.

load_zenpage_news(array<string|int, mixed> $request) : object
Parameters
$request : array<string|int, mixed>

an array with one member: the key is "date", "category", or "title" and specifies what you want loaded. The value is the date or title of the article wanted

Return values
object

zp_load_request()

Figures out what is being accessed and calls the appropriate load function

zp_load_request() : bool
Return values
bool

prepareIndexPage()

sets up for loading the index page

prepareIndexPage() : string
Return values
string

prepareImagePage()

sets up for loading an image page

prepareImagePage() : string
Return values
string

prepareCustomPage()

sets up for loading p=page pages

prepareCustomPage() : string
Return values
string

redirectionHandler()

Handles redirections via filter hook "redirection_handler".

redirectionHandler() : mixed

It is meant to perform redirections of pages that have been removed or renamed.

Tags
since
1.5.2

        
On this page

Search results