ZenphotoCMS 1.6.3

AlbumBase extends MediaObject
in package

Album Base 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()  : mixed
Class instantiator
__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 the item is password protected and if the password has been entered
checkforGuest()  : mixed
Checks if guest is loggedin for the album
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 folder name(s) as freshly discovered albums from the file system may not have a proper sortorder set
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()  : mixed
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 access to the album
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 album is published and also all of its parents.
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
_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

$manage_rights

public mixed $manage_rights = \MANAGE_ALL_ALBUM_RIGHTS

$manage_some_rights

public mixed $manage_some_rights = \ALBUM_RIGHTS

$firstpageimages_oneimagepage

protected mixed $firstpageimages_oneimagepage = \null

Methods

__construct()

Class instantiator

public __construct(mixed $folder8[, mixed $cache = true ]) : mixed
Parameters
$folder8 : mixed
$cache : mixed = true

__toString()

"Magic" function to return a string identifying the object when it is treated as a string

public __toString() : string
Return values
string

addComment()

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
object

albumSubRights()

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
see
save()
since
1.5.2
Return values
bool

checkForGuest()

Checks if the item is password protected and if the password has been entered

public checkForGuest([ &$hint = NULL ][,  &$show = NULL ]) : mixed
Parameters
$hint : = NULL
$show : = NULL

checkforGuest()

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

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
bool

checkScheduledPublishing()

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
since
1.5.7
  • Code moved from the deprecated checKPublishDates() function
Return values
int

clearCache()

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
since
1.5.8
since
1.6:

Method was made static

global

array $_zp_object_cache

clearCacheFolder()

Removes cache image files from this album's folder but not any subalbums or their cache files

public clearCacheFolder() : mixed
Tags
since
1.6.1

clearObjectCache()

Shortcut to clear the cache of the current object class only

public clearObjectCache() : mixed
Tags
since
1.6

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
since
1.6.1
Return values
bool

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
string

getAlbumsPerPage()

Gets the albums per page value

public getAlbumsPerPage() : int
Tags
since
1.6
Return values
int

getAlbumTheme()

Returns the theme for the album

public getAlbumTheme() : string
Return values
string

getAlbumThumbImage()

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
Image

getCacheFolder()

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
since
1.6.1
Return values
string

getCodeblock()

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
int

getComments()

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
bool

getCustomData()

returns the custom data field

public getCustomData([mixed $locale = NULL ]) : string
Parameters
$locale : mixed = NULL
Return values
string

getData()

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
int

getDesc()

Returns the description

public getDesc([mixed $locale = NULL ]) : string
Parameters
$locale : mixed = NULL
Return values
string

getExpireDate()

Returns the expired date if available,

public getExpireDate() : string
Tags
since
1.6.1

Added as placeholder for general class compatibility. Child classes need to override properly

Return values
string

getFileName()

Returns the folder on the filesystem

public getFileName() : string
Tags
deprecated
2.0

– Use getName() instead

Return values
string

getFirstPageImages()

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
since
1.6
Return values
int

getFolder()

Returns the folder on the filesystem

public getFolder() : string
Tags
deprecated
2.0

– Use getName() instead

Return values
string

getGalleryPage()

Returns the page number in the gallery or the parent album of this album

public getGalleryPage() : int
Return values
int

getHitcounter()

Returns the hitcount

public getHitcounter() : int
Return values
int

getImage()

Returns an image from the album based on the index passed.

public getImage(int $index) : int
Parameters
$index : int
Return values
int

getImages()

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([string $page = 0 ][, int $firstPageCount = 0 ][, string $sorttype = null ][, string $sortdirection = null ][, bool $care = true ][, bool $mine = NULL ]) : array<string|int, mixed>
Parameters
$page : string = 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
string

getImagesPerPage()

Gets the images per page value

public getImagesPerPage() : mixed
Tags
since
1.6

getLastChange()

Returns the last change user

public getLastChange() : string
Return values
string

getLastChangeUser()

Returns the last change user

public getLastChangeUser() : string
Tags
since
1.5.2
Return values
string

getLevel()

Gets the level based on the folder name(s) as freshly discovered albums from the file system may not have a proper sortorder set

public getLevel() : int
Tags
since
1.6.1
Return values
int

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
string

getLocation()

Returns the place data of an album

public getLocation([mixed $locale = NULL ]) : string
Parameters
$locale : mixed = NULL
Return values
string

getName()

Returns the folder on the filesystem

public getName() : string
Tags
since
1.6
Return values
string

getNextAlbum()

Returns the album following the current album

public getNextAlbum() : object
Return values
object

getNumAlbumPages()

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
since
1.6
Return values
int|float

getNumAlbums()

Returns the count of direct child subalbums

public getNumAlbums() : int
Return values
int

getNumAllAlbums()

Returns the count of all subalbums of all sublevels Note that dynamic albums are not counted

public getNumAllAlbums() : mixed
Tags
since
1.5.2

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
since
1.5.2

getNumImagePages()

Gets the number of image pages

public getNumImagePages([type $type = 'total' ]) : int|float
Parameters
$type : type = 'total'
Tags
since
1.6
Return values
int|float

getNumImages()

Returns the number of images in this album (not counting its subalbums)

public getNumImages() : int
Return values
int

getOwner()

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
global

obj $_zp_authority

Return values
string

getParent()

Returns The parent Album of this Album. NULL if this is a top-level album.

public getParent() : object|null
Return values
object|null

getParents()

Gets an array of parent album objects

public getParents() : array<string|int, mixed>
Tags
since
1.5.5
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
since
1.6.1

Added for general class compatibility

Return values
null

getPasswordHint()

Returns the password hint

public getPasswordHint([mixed $locale = NULL ]) : string
Parameters
$locale : mixed = NULL
Return values
string

getPrevAlbum()

Returns the album prior to the current album

public getPrevAlbum() : object
Return values
object

getPublishDate()

Returns the publish date

public getPublishDate() : string
Return values
string

getSearchEngine()

Returns the search engine for a dynamic album

public getSearchEngine() : object
Return values
object

getSearchParams()

Returns the search parameters for a dynamic album

public getSearchParams() : string
Return values
string

getShow()

Returns true published

public getShow() : bool
Tags
deprecated
2.0

– Use isPublished() instead

Return values
bool

getSortDirection()

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
string

getSortOrder()

Returns the sort order

public getSortOrder() : string
Return values
string

getSortType()

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
string

getTags()

Returns the tag data

public getTags() : string
Return values
string

getThumb()

Gets the thumbnail URL for the album thumbnail image as returned by $this->getAlbumThumbImage();

public getThumb() : string
Return values
string

getTitle()

Returns the title

public getTitle([mixed $locale = NULL ]) : string
Parameters
$locale : mixed = NULL
Return values
string

getTotalPages()

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
since
1.6
Return values
int

getUpdatedDate()

Date at which the album last discovered an image

public getUpdatedDate() : mixed

getUrAlbum()

Returns the oldest ancestor of an alubm;

public getUrAlbum() : object
Tags
deprecated
2.0

Use getUrParent() instead

since
1.6
Return values
object

getUrParent()

Returns the oldest ancestor of an album. Returns the object of the album itself if there is no urparent

public getUrParent() : object
Tags
since
1.6.1

Replaces getUrAlbum() to align all classes

Return values
object

getUser()

Returns the guest user

public getUser() : string
Return values
string

getWatermark()

returns the album watermark

public getWatermark() : string
Return values
string

getWatermarkThumb()

Returns the album watermark thumb

public getWatermarkThumb() : bool
Return values
bool

hasExpiration()

Returns true if the item will be automatically unpublished by a not yet reached future expire date

public hasExpiration() : bool
Tags
since
1.5.7
Return values
bool

hasExpired()

Returns true if the items has been unpublished after reaching the set expire date.

public hasExpired() : bool
Tags
since
1.5.7
Return values
bool

hasExpireDate()

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
since
1.5.7
Return values
bool

hasFutureDate()

Returns the future date (publishdate for gallery, date for Zenpage items) if set to the future only

public hasFutureDate() : string
Tags
since
1.5.7
Return values
string

| null

hasInactiveExpiration()

Returns true if a future expiredate is set but the item is unpublished

public hasInactiveExpiration() : bool
Tags
since
1.5.7
Return values
bool

hasInactivePublishSchedule()

Returns true if the item has a future date but is not published

public hasInactivePublishSchedule() : bool
Tags
since
1.5.7
Return values
bool

hasPublishSchedule()

Returns true if the item will be automatically published by a future date set

public hasPublishSchedule() : bool
Tags
since
1.5.7
Return values
bool

hasTag()

Checks if an object has a tag assigned.

public hasTag(string $checktag) : bool
Parameters
$checktag : string

tag to check for

Return values
bool

instantiate()

}

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
since
1.6
  • Moved to AlbumBase class as static method
Return values
bool

isDynamic()

Returns true if the album is "dynamic"

public isDynamic() : bool
Return values
bool

isMyItem()

checks access to the album

public isMyItem([bit $action = LIST_RIGHTS ]) : mixed
Parameters
$action : bit = LIST_RIGHTS

User rights level, default LIST_RIGHTS

returns true of access is allowed

isProtected()

Checks if the item is password protected. Checks if the password has been entered *

public isProtected() : bool
Tags
since
1.6.1

Moved to themeObject class as central definition to avoid a lot same override methods

Return values
bool

isProtectedByParent()

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
since
1.6.1
Return values
bool

isPublic()

Returns true if this album is published and also all of its parents.

public isPublic() : bool
Tags
since
1.5.5
Return values
bool

isPublished()

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
since
1.5.8

For a check including inheritance use isPublic()

Return values
bool

isUnpublishedByParent()

Returns true if itself published but unpublished status is inheretited by a parent

public isUnpublishedByParent() : bool
Tags
since
1.6.1
Return values
bool

isValidMoveCopyDestination()

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
since
1.5.5
Return values
bool

isVisible()

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
since
1.6.1
see
isPublic()
see
isProtectedByParent()
see
isMyItem()
Return values
bool

move()

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
since
1.6.1
Return values
bool

newAlbum()

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
since
1.6
  • Moved to AlbumBase class as static method
Return values
Album

preLoad()

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
bool

removeCacheFolder()

Removes the cache folder of the album including all contents

public removeCacheFolder() : mixed
Tags
since
1.6.1

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
since
1.6.1
Return values
bool

save()

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
since
1.5.2

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
$v :

id of the parent

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
since
1.5.8

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
deprecated
2.0

– Use setPublished() instead

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
since
1.5.5

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
$wm :

_move()

common album move code

protected _move(type $newfolder) : int
Parameters
$newfolder : type
Return values
int

loadFileNames()

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
$dirs : = false

Whether or not to return directories ONLY with the file array.

Return values
array<string|int, mixed>

setDefaults()

Sets default values for a new album

protected setDefaults() : bool
Return values
bool

sortImageArray()

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
$entry :

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.


        
On this page

Search results