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
stringfix_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_gallery()
initializes the gallery.
zp_load_gallery() : mixed
zp_load_search()
Loads the search object.
zp_load_search() : mixed
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
objectload_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
objectzp_load_request()
Figures out what is being accessed and calls the appropriate load function
zp_load_request() : bool
Return values
boolprepareIndexPage()
sets up for loading the index page
prepareIndexPage() : string
Return values
stringprepareAlbumPage()
sets up for loading an album page
prepareAlbumPage() : mixed
prepareImagePage()
sets up for loading an image page
prepareImagePage() : string
Return values
stringprepareCustomPage()
sets up for loading p=page pages
prepareCustomPage() : string
Return values
stringredirectionHandler()
Handles redirections via filter hook "redirection_handler".
redirectionHandler() : mixed
It is meant to perform redirections of pages that have been removed or renamed.