ZenphotoCMS 1.6.5

rewrite

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".
rewriteHandler()  : mixed
"Rewrite" handling for Zenphoto

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

rewriteHandler()

"Rewrite" handling for Zenphoto

rewriteHandler() : mixed

The basic rules are found in the rewrite-rules.txt file. Additional rules can be provided by plugins. But for the plugin to load in time for the rules to be seen it must be either a CLASS_PLUGIN or a FEATURE_PLUGIN. Plugins add rules by inserting them into the $_zp_conf_vars['special_pages'] array. Each "rule" is an array of three elements: define, rewrite, and (optionally) rule.

Elemments which have a define and no rule are processed by rewrite rules in the rewrite-rules.txt file and the define is used internally to Zenphoto to reference the rewrite text when building links.

Elements with a rule defined are processed after Search, Pages, and News rewrite rules and before Image and album rewrite rules. The tag %REWRITE% in the rule is replaced with the rewrite text before processing the rule. Thus rewrite is the token that should appear in the acutal URL.

It makes no sense to have an element without either a define or a rule as nothing will happen.

At present all rules are presumed to to stop processing the rule set. Historically that is what all our rules have done, but I suppose we could change that. The "R" flag may be used to cause a header status to be sent. However, we do not redirect back to index.php, so the "R" flag is only useful if the target is a different script.


        
On this page

Search results