Album
extends AlbumBase
in package
Album Class
Table of Contents
Properties
- $comments : mixed
- $exists : mixed
- $images : mixed
- $linkname : mixed
- $loaded : mixed
- $localpath : mixed
- $manage_rights : mixed
- $manage_some_rights : mixed
- $name : mixed
- $parent : mixed
- $parentalbum : mixed
- $parentalbums : mixed
- $sidecars : mixed
- $table : mixed
- $transient : mixed
- $urparentalbum : mixed
- $view_rights : mixed
- $albumthumbnail : mixed
- $firstpageimages : mixed
- $firstpageimages_oneimagepage : mixed
- $id : mixed
- $index : mixed
- $is_protected : mixed
- $is_public : mixed
- $lastimagesort : mixed
- $lastsubalbumsort : mixed
- $num_allalbums : mixed
- $num_allimages : mixed
- $subalbums : mixed
- $subrights : mixed
- $cache_by : mixed
- $commentcount : mixed
- $data : mixed
- $tempdata : mixed
- $unique_set : mixed
- $updates : mixed
- $use_cache : mixed
Methods
- __construct() : Album
- Constructor for albums
- __toString() : string
- "Magic" function to return a string identifying the object when it is treated as a string
- addComment() : object
- Adds comments to the album assumes data is coming straight from GET or POST
- albumSubRights() : mixed
- returns the mitigated album rights.
- checkAccess() : mixed
- Checks if viewing of object is allowed by rights or protection status
- checkChanges() : bool
- By default the object is saved if there are any updates within the property `$updates` no matter if these are actual changes to existing data.
- checkforGuest() : mixed
- Checks if guest is loggedin for the album
- checkForGuest() : mixed
- Checks if the item is password protected and if the password has been entered
- checkPublishDates() : bool
- Checks if the item is either expired or needs to be scheduled published
- checkScheduledPublishing() : int
- Checks if the item has expired or is in scheduled publishing
- clearCache() : mixed
- Clears the object cache by setting it to an empty array completely or a specific object (class name) cache.
- clearCacheFolder() : mixed
- Removes cache image files from this album's folder but not any subalbums or their cache files
- clearObjectCache() : mixed
- Shortcut to clear the cache of the current object class only
- copy() : int
- Copy this album to the location specified by $newfolder, copying all metadata, subalbums, and subalbums' metadata with it.
- copyCacheFolder() : bool
- Copies the cache folder of the album
- countHit() : mixed
- counts visits to the object
- garbageCollect() : mixed
- For every image in the album, look for its file. Delete from the database if the file does not exist. Same for each sub-directory/album.
- get() : mixed
- Get the value of a variable. If $current is false, return the value as of the last save of this object.
- getAlbums() : array<string|int, mixed>
- Returns all folder names for all the subdirectories.
- getAlbumSortKey() : string
- Returns the DB key associated with the subalbum sort type
- getAlbumsPerPage() : int
- Gets the albums per page value
- getAlbumTheme() : string
- Returns the theme for the album
- getAlbumThumbImage() : Image
- Gets the album's set thumbnail image from the database if one exists, otherwise, finds the first image in the album or sub-album and returns it as an Image object.
- getCacheFolder() : string
- Gets the SERVERPATH to the cache folder of the album with trailing slash Note that his does not check for existance!
- getCodeblock() : array<string|int, mixed>
- Returns the codeblocks as an serialized array
- getCommentCount() : int
- Returns the count of comments in the album. Ignores comments in moderation
- getComments() : array<string|int, mixed>
- Returns an array of comments for this album
- getCommentsAllowed() : bool
- Retuns true if comments are allowed
- getCustomData() : string
- returns the custom data field
- getData() : array<string|int, mixed>
- returns the database record of the object
- getDateTime() : int
- Returns the unformatted date
- getDesc() : string
- Returns the description
- getExpireDate() : string
- Returns the expired date if available,
- getFileName() : string
- Returns the folder on the filesystem
- getFirstPageImages() : int
- Gets the number of images if the thumb transintion page for sharing thunbs on the last album and the first image page
- getFolder() : string
- Returns the folder on the filesystem
- getGalleryPage() : int
- Returns the page number in the gallery or the parent album of this album
- getHitcounter() : int
- Returns the hitcount
- getID() : string
- Returns the id
- getImage() : int
- Returns an image from the album based on the index passed.
- getImages() : array<string|int, mixed>
- Returns a of a slice of the images for this album. They will also be sorted according to the sort type of this album, or by filename if none has been set.
- getImageSortKey() : string
- Returns the DB key associated with the image sort type
- getImagesPerPage() : mixed
- Gets the images per page value
- getLastChange() : string
- Returns the last change user
- getLastChangeUser() : string
- Returns the last change user
- getLevel() : int
- Gets the level based on the sort order if the theme object is hierachical. Otherwise returns 1 (top level)
- getLink() : string
- Returns an URL to the album, including the current page number
- getLocation() : string
- Returns the place data of an album
- getName() : string
- Returns the folder on the filesystem
- getNextAlbum() : object
- Returns the album following the current album
- getNumAlbumPages() : int|float
- Gets the number of album pages
- getNumAlbums() : int
- Returns the count of direct child subalbums
- getNumAllAlbums() : mixed
- Returns the count of all subalbums of all sublevels Note that dynamic albums are not counted
- getNumAllImages() : mixed
- Returns the number of images in this album and subalbums of all levels Note that dynamic albums are not counted.
- getNumImagePages() : int|float
- Gets the number of image pages
- getNumImages() : int
- Returns the number of images in this album (not counting its subalbums)
- getOwner() : string
- Gets the owner of the album respectively of a parent album if not set specifically
- getParent() : object|null
- Returns The parent Album of this Album. NULL if this is a top-level album.
- getParentID() : string
- Returns the partent id
- getParents() : array<string|int, mixed>
- Gets an array of parent album objects
- getPassword() : null
- Gets the password if set
- getPasswordHint() : string
- Returns the password hint
- getPrevAlbum() : object
- Returns the album prior to the current album
- getPublishDate() : string
- Returns the publish date
- getSearchEngine() : object
- Returns the search engine for a dynamic album
- getSearchParams() : string
- Returns the search parameters for a dynamic album
- getShow() : bool
- Returns true published
- getSortDirection() : string
- Returns either the subalbum sort direction or the image sort direction of the album
- getSortOrder() : string
- Returns the sort order
- getSortType() : string
- Returns the sort type of the album images Will return a parent sort type if the sort type for this album is empty
- getTags() : string
- Returns the tag data
- getThumb() : string
- Gets the thumbnail URL for the album thumbnail image as returned by $this->getAlbumThumbImage();
- getTitle() : string
- Returns the title
- getTotalPages() : int
- Gets the number of total pages of albums and images
- getUpdatedDate() : mixed
- Date at which the album last discovered an image
- getUrAlbum() : object
- Returns the oldest ancestor of an alubm;
- getUrParent() : object
- Returns the oldest ancestor of an album. Returns the object of the album itself if there is no urparent
- getUser() : string
- Returns the guest user
- getWatermark() : string
- returns the album watermark
- getWatermarkThumb() : bool
- Returns the album watermark thumb
- hasExpiration() : bool
- Returns true if the item will be automatically unpublished by a not yet reached future expire date
- hasExpired() : bool
- Returns true if the items has been unpublished after reaching the set expire date.
- hasExpireDate() : bool
- Returns true if the item has a proper expire date set no matter if it has expired already or will expire in the future
- hasFutureDate() : string
- Returns the future date (publishdate for gallery, date for Zenpage items) if set to the future only
- hasInactiveExpiration() : bool
- Returns true if a future expiredate is set but the item is unpublished
- hasInactivePublishSchedule() : bool
- Returns true if the item has a future date but is not published
- hasPublishSchedule() : bool
- Returns true if the item will be automatically published by a future date set
- hasTag() : bool
- Checks if an object has a tag assigned.
- instantiate() : bool
- }
- isAlbumClass() : bool
- Returns true if the object is a zenphoto 'album'
- isDynamic() : bool
- Returns true if the album is "dynamic"
- isMyItem() : mixed
- Checks basic access rights of an object
- isProtected() : bool
- Checks if the item is password protected. Checks if the password has been entered *
- isProtectedByParent() : bool
- Check if the item is not protected itself but protection is inherited by a parent. Checks if the password has been entered.
- isPublic() : bool
- Returns true if this object is published and does not inherit any unpublish status by a parent
- isPublished() : bool
- Returns true if the item itself is published
- isUnpublishedByParent() : bool
- Returns true if itself published but unpublished status is inheretited by a parent
- isValidMoveCopyDestination() : bool
- Checks is the destination is not a subfolder of the current folder itself
- isVisible() : bool
- Checks if the current item is visible (= listed) to the current visitor via rights, publish status or protection status
- move() : int
- Move this album to the location specified by $newfolder, copying all metadata, subalbums, and subalbums' metadata with it.
- moveCacheFolder() : bool
- Moves the cache folder of the album
- newAlbum() : Album
- Wrapper instantiation function for albums. Do not instantiate directly
- preLoad() : mixed
- Simply creates objects of all the images and sub-albums in this album to load accurate values into the database.
- remove() : bool
- Delete the entire album PERMANENTLY. Be careful! This is unrecoverable.
- removeCacheFolder() : mixed
- Removes the cache folder of the album including all contents
- rename() : bool
- Rename this album folder. Alias for move($newfoldername);
- renameCacheFolder() : bool
- Renames the cache folder of the album Alias of moveCacheFolder();
- save() : mixed
- Save the updates made to this object since the last update. Returns true if successful, false if not.
- set() : mixed
- Set a variable in this object. Does not persist to the database until save() is called. So, IMPORTANT: Call save() after set() to persist.
- setAlbumTheme() : mixed
- Sets the theme of the album
- setCodeblock() : mixed
- set the codeblocks as an serialized array
- setCommentsAllowed() : mixed
- Sets the comments allowed flag
- setCustomData() : mixed
- Sets the custom data field
- setDateTime() : mixed
- Stores the date
- setDesc() : mixed
- Stores the description
- setExpireDate() : mixed
- sets the expire date
- setLastChange() : mixed
- stores the current date in the format 'Y-m-d H:i:s' as the last change date
- setLastchangeUser() : mixed
- stores the last change user
- setLocation() : mixed
- Stores the album place
- setOwner() : mixed
- setParentID() : mixed
- Sets the ParentID field
- setPassword() : mixed
- Sets the encrypted password
- setPasswordHint() : mixed
- Sets the password hint
- setPublishDate() : mixed
- sets the publish date
- setPublished() : mixed
- Stores the published value
- setSearchParams() : mixed
- Sets the search parameters of a dynamic album
- setShow() : mixed
- Stores the published value
- setSortDirection() : mixed
- sets sort directions for the album
- setSortOrder() : mixed
- Stores the sort order
- setSortType() : mixed
- Stores the sort type for the album
- setTags() : mixed
- Stores tag information
- setThumb() : mixed
- Stores the thumbnail path for an album thumg
- setTitle() : mixed
- Stores the title
- setUpdatedDate() : mixed
- setUpdatedDateParents() : mixed
- Sets the current date to all parent albums of this album recursively
- setUser() : mixed
- Sets the guest user
- setWatermark() : mixed
- Sets the album watermark
- setWatermarkThumb() : mixed
- Sets the custom watermark usage
- _albumCheck() : bool
- album validity check
- _getAlbums() : array<string|int, mixed>
- Guts of fetching the subalbums
- _move() : int
- common album move code
- loadFileNames() : array<string|int, mixed>
- Load all of the filenames that are found in this Albums directory on disk.
- setDefaults() : bool
- Sets default values for a new album
- sortImageArray() : array<string|int, mixed>
- sortImageArray will sort an array of Images based on the given key. The key must be one of (filename, title, sort_order) at the moment.
- succeed() : mixed
- updateParent() : mixed
- changes the parent of an album for move/copy
- addToCache() : mixed
- add the entry to the cache
- getFromCache() : mixed
- check the cache for presence of the entry and return it if found
- load() : false
- Load the data array from the database, using the unique id set to get the unique record.
Properties
$comments
public
mixed
$comments
= \NULL
$exists
public
mixed
$exists
= \false
$images
public
mixed
$images
= \null
$linkname
public
mixed
$linkname
$loaded
public
mixed
$loaded
= \false
$localpath
public
mixed
$localpath
$manage_rights
public
mixed
$manage_rights
= \ADMIN_RIGHTS
$manage_some_rights
public
mixed
$manage_some_rights
= \ADMIN_RIGHTS
$name
public
mixed
$name
$parent
public
mixed
$parent
= \null
$parentalbum
public
mixed
$parentalbum
= \null
$parentalbums
public
mixed
$parentalbums
= \null
$sidecars
public
mixed
$sidecars
= array()
$table
public
mixed
$table
$transient
public
mixed
$transient
$urparentalbum
public
mixed
$urparentalbum
= \null
$view_rights
public
mixed
$view_rights
= \VIEW_ALL_RIGHTS
$albumthumbnail
protected
mixed
$albumthumbnail
= \NULL
$firstpageimages
protected
mixed
$firstpageimages
= \null
$firstpageimages_oneimagepage
protected
mixed
$firstpageimages_oneimagepage
= \null
$id
protected
mixed
$id
= 0
$index
protected
mixed
$index
$is_protected
protected
mixed
$is_protected
= \null
$is_public
protected
mixed
$is_public
= \null
$lastimagesort
protected
mixed
$lastimagesort
= \NULL
$lastsubalbumsort
protected
mixed
$lastsubalbumsort
= \NULL
$num_allalbums
protected
mixed
$num_allalbums
= \null
$num_allimages
protected
mixed
$num_allimages
= \null
$subalbums
protected
mixed
$subalbums
= \null
$subrights
protected
mixed
$subrights
= \NULL
$cache_by
private
mixed
$cache_by
$commentcount
private
mixed
$commentcount
$data
private
mixed
$data
= \NULL
$tempdata
private
mixed
$tempdata
= \NULL
$unique_set
private
mixed
$unique_set
= \NULL
$updates
private
mixed
$updates
= \NULL
$use_cache
private
mixed
$use_cache
= \false
Methods
__construct()
Constructor for albums
public
__construct(string $folder8[, bool $cache = true ][, mixed $quiet = false ]) : Album
Parameters
- $folder8 : string
-
folder name (UTF8) of the album
- $cache : bool = true
-
load from cache if present
- $quiet : mixed = false
Return values
Album__toString()
"Magic" function to return a string identifying the object when it is treated as a string
public
__toString() : string
Return values
stringaddComment()
Adds comments to the album assumes data is coming straight from GET or POST
public
addComment(string $name, string $email, string $website, string $comment, string $code, string $code_ok, string $ip, bool $private, bool $anon, string $customdata, bool $dataconfirmation) : object
Returns a comment object
Parameters
- $name : string
-
Comment author name
- $email : string
-
Comment author email
- $website : string
-
Comment author website
- $comment : string
-
body of the comment
- $code : string
-
CAPTCHA code entered
- $code_ok : string
-
CAPTCHA hash expected
- $ip : string
-
the IP address of the comment poster
- $private : bool
-
set to true if the comment is for the admin only
- $anon : bool
-
set to true if the poster wishes to remain anonymous
- $customdata : string
- $dataconfirmation : bool
-
true or false if data privacy confirmation was required
Return values
objectalbumSubRights()
returns the mitigated album rights.
public
albumSubRights() : mixed
returns NULL if not a managed album
checkAccess()
Checks if viewing of object is allowed by rights or protection status
public
checkAccess([string &$hint = NULL ][, string &$show = NULL ]) : mixed
Parameters
- $hint : string = NULL
- $show : string = NULL
checkChanges()
By default the object is saved if there are any updates within the property `$updates` no matter if these are actual changes to existing data.
public
checkChanges([bool $update = true ]) : bool
This checks that and internally updates the $updates
property with the actual changes obky so you optionally can skip unnecessary object saves.
Standard object fields lastchange
and lastchangeuser
are exclude because lastchange
always changes and both make no sense
if there is no actual content change at all.
This can be used before calling the save() method or enabled within the save() method optionally
Parameters
- $update : bool = true
-
True (default) to also update the $updates property with changes found or clear it. False to only check for changes.
Tags
Return values
boolcheckforGuest()
Checks if guest is loggedin for the album
public
checkforGuest([unknown_type &$hint = NULL ][, unknown_type &$show = NULL ]) : mixed
Parameters
- $hint : unknown_type = NULL
- $show : unknown_type = NULL
checkForGuest()
Checks if the item is password protected and if the password has been entered
public
checkForGuest([ &$hint = NULL ][, &$show = NULL ]) : mixed
Parameters
checkPublishDates()
Checks if the item is either expired or needs to be scheduled published
public
checkPublishDates() : bool
Unpublishes the item if expired (saves to db) or scheduled (temporary) and returns false if expired or scheduled.
Return values
boolcheckScheduledPublishing()
Checks if the item has expired or is in scheduled publishing
public
static checkScheduledPublishing(array<string|int, mixed> $row) : int
Returns 1 if expired, 2 if in scheduled future publishing
Parameters
- $row : array<string|int, mixed>
-
database row of the object
Tags
Return values
intclearCache()
Clears the object cache by setting it to an empty array completely or a specific object (class name) cache.
public
static clearCache([mixed $class = null ]) : mixed
Note: You normally never need to use this. But on certain occasions it may be necessary to avoid memory issues if you loop through a lot of object creations.
Parameters
- $class : mixed = null
Tags
clearCacheFolder()
Removes cache image files from this album's folder but not any subalbums or their cache files
public
clearCacheFolder() : mixed
Tags
clearObjectCache()
Shortcut to clear the cache of the current object class only
public
clearObjectCache() : mixed
Tags
copy()
Copy this album to the location specified by $newfolder, copying all metadata, subalbums, and subalbums' metadata with it.
public
copy( $newfolder) : int
Parameters
- $newfolder :
-
string the folder to copy to, including the name of the current folder (possibly renamed).
Return values
int —0 on success and error indicator on failure.
copyCacheFolder()
Copies the cache folder of the album
public
copyCacheFolder(string $newfolder) : bool
Parameters
- $newfolder : string
-
New folder path name
Tags
Return values
boolcountHit()
counts visits to the object
public
countHit() : mixed
garbageCollect()
For every image in the album, look for its file. Delete from the database if the file does not exist. Same for each sub-directory/album.
public
garbageCollect([bool $deep = false ]) : mixed
Parameters
- $deep : bool = false
-
set to true for a thorough cleansing
get()
Get the value of a variable. If $current is false, return the value as of the last save of this object.
public
get(mixed $var[, mixed $current = true ]) : mixed
Parameters
- $var : mixed
- $current : mixed = true
getAlbums()
Returns all folder names for all the subdirectories.
public
getAlbums([string $page = 0 ][, string $sorttype = null ][, string $sortdirection = null ][, bool $care = true ][, bool $mine = NULL ]) : array<string|int, mixed>
Parameters
- $page : string = 0
-
Which page of subalbums to display.
- $sorttype : string = null
-
The sort strategy
- $sortdirection : string = null
-
The direction of the sort
- $care : bool = true
-
set to false if the order does not matter
- $mine : bool = NULL
-
set true/false to override ownership
Return values
array<string|int, mixed>getAlbumSortKey()
Returns the DB key associated with the subalbum sort type
public
getAlbumSortKey([string $sorttype = null ]) : string
Parameters
- $sorttype : string = null
-
subalbum sort type
Return values
stringgetAlbumsPerPage()
Gets the albums per page value
public
getAlbumsPerPage() : int
Tags
Return values
intgetAlbumTheme()
Returns the theme for the album
public
getAlbumTheme() : string
Return values
stringgetAlbumThumbImage()
Gets the album's set thumbnail image from the database if one exists, otherwise, finds the first image in the album or sub-album and returns it as an Image object.
public
getAlbumThumbImage() : Image
Return values
ImagegetCacheFolder()
Gets the SERVERPATH to the cache folder of the album with trailing slash Note that his does not check for existance!
public
getCacheFolder() : string
Tags
Return values
stringgetCodeblock()
Returns the codeblocks as an serialized array
public
getCodeblock() : array<string|int, mixed>
Return values
array<string|int, mixed>getCommentCount()
Returns the count of comments in the album. Ignores comments in moderation
public
getCommentCount() : int
Return values
intgetComments()
Returns an array of comments for this album
public
getComments([bool $moderated = false ][, bool $private = false ][, bool $desc = false ]) : array<string|int, mixed>
Parameters
- $moderated : bool = false
-
if false, ignores comments marked for moderation
- $private : bool = false
-
if false ignores private comments
- $desc : bool = false
-
set to true for descending order
Return values
array<string|int, mixed>getCommentsAllowed()
Retuns true if comments are allowed
public
getCommentsAllowed() : bool
Return values
boolgetCustomData()
returns the custom data field
public
getCustomData([mixed $locale = NULL ]) : string
Parameters
- $locale : mixed = NULL
Return values
stringgetData()
returns the database record of the object
public
getData() : array<string|int, mixed>
Return values
array<string|int, mixed>getDateTime()
Returns the unformatted date
public
getDateTime() : int
Return values
intgetDesc()
Returns the description
public
getDesc([mixed $locale = NULL ]) : string
Parameters
- $locale : mixed = NULL
Return values
stringgetExpireDate()
Returns the expired date if available,
public
getExpireDate() : string
Tags
Return values
stringgetFileName()
Returns the folder on the filesystem
public
getFileName() : string
Tags
Return values
stringgetFirstPageImages()
Gets the number of images if the thumb transintion page for sharing thunbs on the last album and the first image page
public
getFirstPageImages([bool $one_image_page = false ]) : int
Parameters
- $one_image_page : bool = false
Tags
Return values
intgetFolder()
Returns the folder on the filesystem
public
getFolder() : string
Tags
Return values
stringgetGalleryPage()
Returns the page number in the gallery or the parent album of this album
public
getGalleryPage() : int
Return values
intgetHitcounter()
Returns the hitcount
public
getHitcounter() : int
Return values
intgetID()
Returns the id
public
getID() : string
Return values
stringgetImage()
Returns an image from the album based on the index passed.
public
getImage(int $index) : int
Parameters
- $index : int
Return values
intgetImages()
Returns a of a slice of the images for this album. They will also be sorted according to the sort type of this album, or by filename if none has been set.
public
getImages([int $page = 0 ][, int $firstPageCount = 0 ][, string $sorttype = null ][, string $sortdirection = null ][, bool $care = true ][, bool $mine = NULL ]) : array<string|int, mixed>
Parameters
- $page : int = 0
-
Which page of images should be returned. If zero, all images are returned.
- $firstPageCount : int = 0
-
count of images that go on the album/image transition page
- $sorttype : string = null
-
optional sort type
- $sortdirection : string = null
-
optional sort direction
- $care : bool = true
-
set to false if the order of the images does not matter
- $mine : bool = NULL
-
set true/false to override ownership
Return values
array<string|int, mixed>getImageSortKey()
Returns the DB key associated with the image sort type
public
getImageSortKey([string $sorttype = null ]) : string
Parameters
- $sorttype : string = null
-
the sort type
Return values
stringgetImagesPerPage()
Gets the images per page value
public
getImagesPerPage() : mixed
Tags
getLastChange()
Returns the last change user
public
getLastChange() : string
Return values
stringgetLastChangeUser()
Returns the last change user
public
getLastChangeUser() : string
Tags
Return values
stringgetLevel()
Gets the level based on the sort order if the theme object is hierachical. Otherwise returns 1 (top level)
public
getLevel() : int
Tags
Return values
intgetLink()
Returns an URL to the album, including the current page number
public
getLink([string $page = NULL ][, string $path = null ]) : string
Parameters
- $page : string = NULL
-
if not null, apppend as page #
- $path : string = null
-
Default null, optionally pass a path constant like WEBPATH or FULLWEBPATH
Return values
stringgetLocation()
Returns the place data of an album
public
getLocation([mixed $locale = NULL ]) : string
Parameters
- $locale : mixed = NULL
Return values
stringgetName()
Returns the folder on the filesystem
public
getName() : string
Tags
Return values
stringgetNextAlbum()
Returns the album following the current album
public
getNextAlbum() : object
Return values
objectgetNumAlbumPages()
Gets the number of album pages
public
getNumAlbumPages([string $type = 'total' ]) : int|float
Parameters
- $type : string = 'total'
-
'total" total pages rounded, "full" number of pages that exactly match the per page value, "plain" number of pages as float value
Tags
Return values
int|floatgetNumAlbums()
Returns the count of direct child subalbums
public
getNumAlbums() : int
Return values
intgetNumAllAlbums()
Returns the count of all subalbums of all sublevels Note that dynamic albums are not counted
public
getNumAllAlbums() : mixed
Tags
getNumAllImages()
Returns the number of images in this album and subalbums of all levels Note that dynamic albums are not counted.
public
getNumAllImages() : mixed
Tags
getNumImagePages()
Gets the number of image pages
public
getNumImagePages([type $type = 'total' ]) : int|float
Parameters
- $type : type = 'total'
Tags
Return values
int|floatgetNumImages()
Returns the number of images in this album (not counting its subalbums)
public
getNumImages() : int
Return values
intgetOwner()
Gets the owner of the album respectively of a parent album if not set specifically
public
getOwner([bool $fullname = false ]) : string
Parameters
- $fullname : bool = false
-
Set to true to get the full name (if the owner is a vaild user of the site and has the full name defined)
Tags
Return values
stringgetParent()
Returns The parent Album of this Album. NULL if this is a top-level album.
public
getParent() : object|null
Return values
object|nullgetParentID()
Returns the partent id
public
getParentID() : string
Return values
stringgetParents()
Gets an array of parent album objects
public
getParents() : array<string|int, mixed>
Tags
Return values
array<string|int, mixed>getPassword()
Gets the password if set
public
getPassword() : null
Placeholder for all child classes. Needs to be properly overriden there if password functionality is available
Tags
Return values
nullgetPasswordHint()
Returns the password hint
public
getPasswordHint([mixed $locale = NULL ]) : string
Parameters
- $locale : mixed = NULL
Return values
stringgetPrevAlbum()
Returns the album prior to the current album
public
getPrevAlbum() : object
Return values
objectgetPublishDate()
Returns the publish date
public
getPublishDate() : string
Return values
stringgetSearchEngine()
Returns the search engine for a dynamic album
public
getSearchEngine() : object
Return values
objectgetSearchParams()
Returns the search parameters for a dynamic album
public
getSearchParams() : string
Return values
stringgetShow()
Returns true published
public
getShow() : bool
Tags
Return values
boolgetSortDirection()
Returns either the subalbum sort direction or the image sort direction of the album
public
getSortDirection([string $what = 'image' ]) : string
Parameters
- $what : string = 'image'
-
'image_' if you want the image direction, 'album' if you want it for the album
Return values
stringgetSortOrder()
Returns the sort order
public
getSortOrder() : string
Return values
stringgetSortType()
Returns the sort type of the album images Will return a parent sort type if the sort type for this album is empty
public
getSortType([mixed $what = 'image' ]) : string
Parameters
- $what : mixed = 'image'
Return values
stringgetTags()
Returns the tag data
public
getTags() : string
Return values
stringgetThumb()
Gets the thumbnail URL for the album thumbnail image as returned by $this->getAlbumThumbImage();
public
getThumb() : string
Return values
stringgetTitle()
Returns the title
public
getTitle([mixed $locale = NULL ]) : string
Parameters
- $locale : mixed = NULL
Return values
stringgetTotalPages()
Gets the number of total pages of albums and images
public
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
Tags
Return values
intgetUpdatedDate()
Date at which the album last discovered an image
public
getUpdatedDate() : mixed
getUrAlbum()
Returns the oldest ancestor of an alubm;
public
getUrAlbum() : object
Tags
Return values
objectgetUrParent()
Returns the oldest ancestor of an album. Returns the object of the album itself if there is no urparent
public
getUrParent() : object
Tags
Return values
objectgetUser()
Returns the guest user
public
getUser() : string
Return values
stringgetWatermark()
returns the album watermark
public
getWatermark() : string
Return values
stringgetWatermarkThumb()
Returns the album watermark thumb
public
getWatermarkThumb() : bool
Return values
boolhasExpiration()
Returns true if the item will be automatically unpublished by a not yet reached future expire date
public
hasExpiration() : bool
Tags
Return values
boolhasExpired()
Returns true if the items has been unpublished after reaching the set expire date.
public
hasExpired() : bool
Tags
Return values
boolhasExpireDate()
Returns true if the item has a proper expire date set no matter if it has expired already or will expire in the future
public
hasExpireDate() : bool
Tags
Return values
boolhasFutureDate()
Returns the future date (publishdate for gallery, date for Zenpage items) if set to the future only
public
hasFutureDate() : string
Tags
Return values
string —| null
hasInactiveExpiration()
Returns true if a future expiredate is set but the item is unpublished
public
hasInactiveExpiration() : bool
Tags
Return values
boolhasInactivePublishSchedule()
Returns true if the item has a future date but is not published
public
hasInactivePublishSchedule() : bool
Tags
Return values
boolhasPublishSchedule()
Returns true if the item will be automatically published by a future date set
public
hasPublishSchedule() : bool
Tags
Return values
boolhasTag()
Checks if an object has a tag assigned.
public
hasTag(string $checktag) : bool
Parameters
- $checktag : string
-
tag to check for
Return values
boolinstantiate()
}
public
instantiate( $tablename, $unique_set[, $cache_by = NULL ][, $use_cache = true ][, $is_transient = false ][, $allowCreate = true ]) : bool
Prime instantiator for Zenphoto objects
Parameters
- $tablename :
-
The name of the database table
- $unique_set :
-
An array of unique fields
- $cache_by : = NULL
- $use_cache : = true
- $is_transient : = false
-
Set true to prevent database insertion
- $allowCreate : = true
-
Set true to allow a new object to be made.
Return values
bool —will be true if the unique_set does not already exist
isAlbumClass()
Returns true if the object is a zenphoto 'album'
public
static isAlbumClass([object $album = NULL ]) : bool
Parameters
- $album : object = NULL
Tags
Return values
boolisDynamic()
Returns true if the album is "dynamic"
public
isDynamic() : bool
Return values
boolisMyItem()
Checks basic access rights of an object
public
isMyItem([bit $action = LIST_RIGHTS ]) : mixed
Parameters
- $action : bit = LIST_RIGHTS
-
User rights level, default LIST_RIGHTS
isProtected()
Checks if the item is password protected. Checks if the password has been entered *
public
isProtected() : bool
Tags
Return values
boolisProtectedByParent()
Check if the item is not protected itself but protection is inherited by a parent. Checks if the password has been entered.
public
isProtectedByParent() : bool
Tags
Return values
boolisPublic()
Returns true if this object is published and does not inherit any unpublish status by a parent
public
isPublic() : bool
Child classes with any hierachic structure need to override and extend this method to cover inheritance.
Tags
Return values
boolisPublished()
Returns true if the item itself is published
public
isPublished([bool $use_dbvalue = false ]) : bool
Parameters
- $use_dbvalue : bool = false
-
Set to true to use the actual db value stored and not the possibly temporary modified value (e.g. if in scheduled publishing or expiration)
Tags
Return values
boolisUnpublishedByParent()
Returns true if itself published but unpublished status is inheretited by a parent
public
isUnpublishedByParent() : bool
Tags
Return values
boolisValidMoveCopyDestination()
Checks is the destination is not a subfolder of the current folder itself
public
isValidMoveCopyDestination(string $destination) : bool
Parameters
- $destination : string
-
album name to move or copy to
Tags
Return values
boolisVisible()
Checks if the current item is visible (= listed) to the current visitor via rights, publish status or protection status
public
isVisible([bit $action = LIST_RIGHTS ]) : bool
Convenience wrapper for various methods.
Parameters
- $action : bit = LIST_RIGHTS
-
User rights level, default LIST_RIGHTS
Tags
Return values
boolmove()
Move this album to the location specified by $newfolder, copying all metadata, subalbums, and subalbums' metadata with it.
public
move( $newfolder) : int
Parameters
- $newfolder :
-
string the folder to move to, including the name of the current folder (possibly renamed).
Return values
int —0 on success and error indicator on failure.
moveCacheFolder()
Moves the cache folder of the album
public
moveCacheFolder(string $newfolder) : bool
Parameters
- $newfolder : string
-
New folder path name
Tags
Return values
boolnewAlbum()
Wrapper instantiation function for albums. Do not instantiate directly
public
static newAlbum(string $folder8[, bool $cache = true ][, bool $quiet = false ]) : Album
Parameters
- $folder8 : string
-
the name of the folder (inernal character set)
- $cache : bool = true
-
true if the album should be fetched from the cache
- $quiet : bool = false
-
true to supress error messages
Tags
Return values
AlbumpreLoad()
Simply creates objects of all the images and sub-albums in this album to load accurate values into the database.
public
preLoad() : mixed
remove()
Delete the entire album PERMANENTLY. Be careful! This is unrecoverable.
public
remove() : bool
Returns true if successful
Return values
boolremoveCacheFolder()
Removes the cache folder of the album including all contents
public
removeCacheFolder() : mixed
Tags
rename()
Rename this album folder. Alias for move($newfoldername);
public
rename(string $newfolder) : bool
Parameters
- $newfolder : string
-
the new folder name of this album (including subalbum paths)
Return values
bool —true on success or false on failure.
renameCacheFolder()
Renames the cache folder of the album Alias of moveCacheFolder();
public
renameCacheFolder(string $newfolder) : bool
Parameters
- $newfolder : string
-
New folder path name
Tags
Return values
boolsave()
Save the updates made to this object since the last update. Returns true if successful, false if not.
public
save([bool $checkupdates = false ]) : mixed
Parameters
- $checkupdates : bool = false
-
Default false. If true the internal $updates property is checked for actual changes so unnecessary saving is skipped. Applies to already existing objects only.
set()
Set a variable in this object. Does not persist to the database until save() is called. So, IMPORTANT: Call save() after set() to persist.
public
set(mixed $var, mixed $value) : mixed
If the requested variable is not in the database, sets it in temp storage, which won't be persisted to the database.
Parameters
- $var : mixed
- $value : mixed
setAlbumTheme()
Sets the theme of the album
public
setAlbumTheme(string $theme) : mixed
Parameters
- $theme : string
setCodeblock()
set the codeblocks as an serialized array
public
setCodeblock(mixed $cb) : mixed
Parameters
- $cb : mixed
setCommentsAllowed()
Sets the comments allowed flag
public
setCommentsAllowed(bool $commentson) : mixed
Parameters
- $commentson : bool
-
true if they are allowed
setCustomData()
Sets the custom data field
public
setCustomData(string $val) : mixed
Parameters
- $val : string
-
the value to be put in custom_data
setDateTime()
Stores the date
public
setDateTime(string $datetime) : mixed
Parameters
- $datetime : string
-
formatted date
setDesc()
Stores the description
public
setDesc(string $desc) : mixed
Parameters
- $desc : string
-
description text
setExpireDate()
sets the expire date
public
setExpireDate(mixed $ed) : mixed
Parameters
- $ed : mixed
setLastChange()
stores the current date in the format 'Y-m-d H:i:s' as the last change date
public
setLastChange() : mixed
setLastchangeUser()
stores the last change user
public
setLastchangeUser(mixed $a) : mixed
Parameters
- $a : mixed
Tags
setLocation()
Stores the album place
public
setLocation(string $place) : mixed
Parameters
- $place : string
-
text for the place field
setOwner()
public
setOwner(mixed $owner) : mixed
Parameters
- $owner : mixed
setParentID()
Sets the ParentID field
public
setParentID( $v) : mixed
Parameters
setPassword()
Sets the encrypted password
public
setPassword(string $pwd) : mixed
Parameters
- $pwd : string
-
the cleartext password
setPasswordHint()
Sets the password hint
public
setPasswordHint(string $hint) : mixed
Parameters
- $hint : string
-
the hint text
setPublishDate()
sets the publish date
public
setPublishDate(mixed $ed) : mixed
Parameters
- $ed : mixed
setPublished()
Stores the published value
public
setPublished(bool $published) : mixed
Parameters
- $published : bool
-
True if the item is published
Tags
setSearchParams()
Sets the search parameters of a dynamic album
public
setSearchParams(string $params) : mixed
Parameters
- $params : string
-
The search string to produce the dynamic album
setShow()
Stores the published value
public
setShow(bool $show) : mixed
Parameters
- $show : bool
-
True if the album is published
Tags
setSortDirection()
sets sort directions for the album
public
setSortDirection(bool $val[, string $what = 'image' ]) : mixed
Parameters
- $val : bool
-
the direction
- $what : string = 'image'
-
'image_sortdirection' if you want the image direction, 'album_sortdirection' if you want it for the album
setSortOrder()
Stores the sort order
public
setSortOrder(string $sortorder) : mixed
Parameters
- $sortorder : string
-
image sort order
setSortType()
Stores the sort type for the album
public
setSortType(string $sorttype[, string $what = 'image' ]) : mixed
Parameters
- $sorttype : string
-
the album sort type
- $what : string = 'image'
-
'Description'image' or 'album'
setTags()
Stores tag information
public
setTags(string $tags) : mixed
Parameters
- $tags : string
-
the tag list
setThumb()
Stores the thumbnail path for an album thumg
public
setThumb(string $filename) : mixed
Parameters
- $filename : string
-
thumbnail path
setTitle()
Stores the title
public
setTitle(string $title) : mixed
Parameters
- $title : string
-
the title
setUpdatedDate()
public
setUpdatedDate([mixed $date = null ]) : mixed
Parameters
- $date : mixed = null
setUpdatedDateParents()
Sets the current date to all parent albums of this album recursively
public
setUpdatedDateParents() : mixed
Tags
setUser()
Sets the guest user
public
setUser(string $user) : mixed
Parameters
- $user : string
setWatermark()
Sets the album watermark
public
setWatermark(string $wm) : mixed
Parameters
- $wm : string
setWatermarkThumb()
Sets the custom watermark usage
public
setWatermarkThumb( $wm) : mixed
Parameters
_albumCheck()
album validity check
protected
_albumCheck(mixed $folder8, mixed $folderFS, mixed $quiet) : bool
Parameters
- $folder8 : mixed
- $folderFS : mixed
- $quiet : mixed
Return values
bool_getAlbums()
Guts of fetching the subalbums
protected
_getAlbums() : array<string|int, mixed>
Return values
array<string|int, mixed>_move()
common album move code
protected
_move(type $newfolder) : int
Parameters
- $newfolder : type
Return values
intloadFileNames()
Load all of the filenames that are found in this Albums directory on disk.
protected
loadFileNames([ $dirs = false ]) : array<string|int, mixed>
Returns an array with all the names.
Parameters
Return values
array<string|int, mixed>setDefaults()
Sets default values for a new album
protected
setDefaults() : bool
Return values
boolsortImageArray()
sortImageArray will sort an array of Images based on the given key. The key must be one of (filename, title, sort_order) at the moment.
protected
sortImageArray(array<string|int, mixed> $images, string $sorttype, string $sortdirection[, bool $mine = NULL ]) : array<string|int, mixed>
Parameters
- $images : array<string|int, mixed>
-
The array of filenames to be sorted.
- $sorttype : string
-
optional sort type
- $sortdirection : string
-
optional sort direction
- $mine : bool = NULL
-
set to true/false to override ownership clause
Return values
array<string|int, mixed>succeed()
protected
succeed(mixed $dest) : mixed
Parameters
- $dest : mixed
updateParent()
changes the parent of an album for move/copy
protected
updateParent(string $newfolder) : mixed
Parameters
- $newfolder : string
-
The folder name of the new parent
addToCache()
add the entry to the cache
private
addToCache( $entry) : mixed
Parameters
getFromCache()
check the cache for presence of the entry and return it if found
private
getFromCache() : mixed
load()
Load the data array from the database, using the unique id set to get the unique record.
private
load(bool $allowCreate) : false
Parameters
- $allowCreate : bool
-
set to true to enable new object creation.
Return values
false —if the record already exists, true if a new record was created.