Album Album(
object
&$gallery, string
$folder8, [bool
$cache = true]
)
|
|
Constructor for albums
Parameters:
|
object |
&$gallery: |
The parent gallery |
|
string |
$folder8: |
folder name (UTF8) of the album |
|
bool |
$cache: |
load from cache if present |
object addComment(
string
$name, string
$email, string
$website, string
$comment, string
$code, string
$code_ok, string
$ip, bool
$private, bool
$anon
)
|
|
Adds comments to the album assumes data is coming straight from GET or POST
Returns a comment object
Parameters:
|
string |
$name: |
Comment author name |
|
string |
$email: |
Comment author email |
|
string |
$website: |
Comment author website |
|
string |
$comment: |
body of the comment |
|
string |
$code: |
CAPTCHA code entered |
|
string |
$code_ok: |
CAPTCHA md5 expected |
|
string |
$ip: |
the IP address of the comment poster |
|
bool |
$private: |
set to true if the comment is for the admin only |
|
bool |
$anon: |
set to true if the poster wishes to remain anonymous |
int copyAlbum(
$newfolder
$newfolder
)
|
|
Copy this album to the location specified by $newfolder, copying all metadata, subalbums, and subalbums' metadata with it.
Parameters:
|
$newfolder |
$newfolder: |
string the folder to copy to, including the name of the current folder (possibly renamed). |
API Tags:
| Return: | 0 on success and error indicator on failure. |
Delete the entire album PERMANENTLY. Be careful! This is unrecoverable.
Returns true if successful
void garbageCollect(
[bool
$deep = false]
)
|
|
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.
Parameters:
|
bool |
$deep: |
set to true for a thorough cleansing |
Returns the id of this album in the db
Returns an URL to the album, including the current page number
array getAlbums(
[string
$page = 0], [string
$sorttype = null], [string
$sortdirection = null], [bool
$care = true]
)
|
|
Returns all folder names for all the subdirectories.
Parameters:
|
string |
$page: |
Which page of subalbums to display. |
|
string |
$sorttype: |
The sort strategy |
|
string |
$sortdirection: |
The direction of the sort |
|
bool |
$care: |
set to false if the order does not matter |
string getAlbumSortKey(
[string
$sorttype = null]
)
|
|
Returns the DB key associated with the subalbum sort type
Parameters:
|
string |
$sorttype: |
subalbum sort type |
string getAlbumSortType(
)
|
|
Returns the sort type for subalbums in this album.
Will return a parent sort type if the sort type for this album is empty.
Returns the theme for the album
Gets the thumbnail URL for the album thumbnail image as returned by $this->getAlbumThumbImage();
Image 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.
Returns the count of comments in the album. Ignores comments in moderation
array getComments(
[bool
$moderated = false], [bool
$private = false], [bool
$desc = false]
)
|
|
Returns an array of comments for this album
Parameters:
|
bool |
$moderated: |
if false, ignores comments marked for moderation |
|
bool |
$private: |
if false ignores private comments |
|
bool |
$desc: |
set to true for descending order |
bool getCommentsAllowed(
)
|
|
Returns true of comments are allowed
returns the custom data field
Returns the unformatted date of the album
Returns the album description
Returns the folder on the filesystem
Returns the page number in the gallery of this album
int getImage(
int
$index
)
|
|
Returns an image from the album based on the index passed.
Parameters:
array getImages(
[string
$page = 0], [int
$firstPageCount = 0], [string
$sorttype = null], [string
$sortdirection = null], [
$care = true]
)
|
|
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.
Parameters:
|
string |
$page: |
Which page of images should be returned. If zero, all images are returned. |
|
int |
$firstPageCount: |
count of images that go on the album/image transition page |
|
string |
$sorttype: |
optional sort type |
|
string |
$sortdirection: |
optional sort direction |
|
|
$care: |
|
string getImageSortKey(
[string
$sorttype = null]
)
|
|
Returns the DB key associated with the image sort type
Parameters:
|
string |
$sorttype: |
the sort type |
Returns the place data of an album
Returns the album following the current album
Returns the count of subalbums
Returns the number of images in this album (not counting its subalbums)
Returns The parent Album of this Album. NULL if this is a top-level album.
Returns the album password
string getPasswordHint(
)
|
|
Returns the password hint for the album
Returns the album prior to the current album
object getSearchEngine(
)
|
|
Returns the search engine for a dynamic album
string getSearchParams(
[bool
$processed = false]
)
|
|
Returns the search parameters for a dynamic album
Parameters:
|
bool |
$processed: |
set false to process the parms |
Returns true if the album is published
string getSortDirection(
string
$what
)
|
|
Returns either the subalbum sort direction or the image sort direction of the album
Parameters:
|
string |
$what: |
'image_sortdirection' if you want the image direction, 'album_sortdirection' if you want it for the album |
Returns the image sort order for this album
Returns the sort type of the album images Will return a parent sort type if the sort type for this album is empty
Returns the tag data of an album
Returns the album guest user
Returns true if the album is "dynamic"
array loadFileNames(
[$dirs
$dirs = false]
)
|
|
Load all of the filenames that are found in this Albums directory on disk.
Returns an array with all the names.
Parameters:
|
$dirs |
$dirs: |
Whether or not to return directories ONLY with the file array. |
int moveAlbum(
$newfolder
$newfolder
)
|
|
Move this album to the location specified by $newfolder, copying all metadata, subalbums, and subalbums' metadata with it.
Parameters:
|
$newfolder |
$newfolder: |
string the folder to move to, including the name of the current folder (possibly renamed). |
API Tags:
| Return: | 0 on success and error indicator on failure. |
Simply creates objects of all the images and sub-albums in this album to load accurate values into the database.
boolean renameAlbum(
$newfolder
$newfolder
)
|
|
Rename this album folder. Alias for moveAlbum($newfoldername);
Parameters:
|
$newfolder |
$newfolder: |
the new folder name of this album (including subalbum paths) |
API Tags:
| Return: | true on success or false on failure. |
bool replicateDBRow(
array
$subrow, string
$oldfolder, string
$newfolder, bool
$owner_row
)
|
|
Replicates the database data for copied albums.
Returns the success of the replication.
Parameters:
|
array |
$subrow: |
the Row of data |
|
string |
$oldfolder: |
the folder name of the old album |
|
string |
$newfolder: |
the folder name of the new album |
|
bool |
$owner_row: |
set to true if this is the owner album (and we have to change the parent ID) |
string replicateSQL(
string
$subrow, string
$table
)
|
|
returns the SQL to insert a row like $subrow into $table
Parameters:
|
string |
$subrow: |
|
|
string |
$table: |
|
void setAlbumTheme(
string
$theme
)
|
|
Sets the theme of the album
Parameters:
void setAlbumThumb(
string
$filename
)
|
|
Stores the thumbnail path for an album thumg
Parameters:
|
string |
$filename: |
thumbnail path |
void setCommentsAllowed(
bool
$commentson
)
|
|
Stores the value for comments allwed
Parameters:
|
bool |
$commentson: |
true if comments are enabled |
void setCustomData(
string
$val
)
|
|
Sets the custom data field
Parameters:
|
string |
$val: |
the value to be put in custom_data |
void setDateTime(
string
$datetime
)
|
|
Stores the album date
Parameters:
|
string |
$datetime: |
formatted date |
void setDesc(
string
$desc
)
|
|
Stores the album description
Parameters:
|
string |
$desc: |
description text |
void setLocation(
string
$place
)
|
|
Stores the album place
Parameters:
|
string |
$place: |
text for the place field |
void setPassword(
string
$pwd
)
|
|
Sets the encrypted album password
Parameters:
|
string |
$pwd: |
the cleartext password |
void setPasswordHint(
string
$hint
)
|
|
Sets the album password hint
Parameters:
|
string |
$hint: |
the hint text |
void setSearchParams(
string
$params
)
|
|
Sets the search parameters of a dynamic album
Parameters:
|
string |
$params: |
The search string to produce the dynamic album |
void setShow(
bool
$show
)
|
|
Stores the published value for the album
Parameters:
|
bool |
$show: |
True if the album is published |
void setSortDirection(
string
$what, string
$val
)
|
|
sets sort directions for the album
Parameters:
|
string |
$what: |
'image_sortdirection' if you want the image direction, 'album_sortdirection' if you want it for the album |
|
string |
$val: |
the direction |
void setSortOrder(
string
$sortorder
)
|
|
Stores the image sort order for this album
Parameters:
|
string |
$sortorder: |
image sort order |
void setSortType(
string
$sorttype
)
|
|
Stores the sort type for the album
Parameters:
|
string |
$sorttype: |
the album sort type |
void setSubalbumSortType(
string
$sorttype
)
|
|
Stores the subalbum sort type for this abum
Parameters:
|
string |
$sorttype: |
the subalbum sort type |
void setTags(
string
$tags
)
|
|
Stores tag information of an album
Parameters:
|
string |
$tags: |
the tag list |
void setTitle(
string
$title
)
|
|
Stores the album title
Parameters:
void setUser(
string
$user
)
|
|
Sets the album guest user
Parameters:
array sortImageArray(
array
$images, string
$sorttype, string
$sortdirection
)
|
|
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.
Parameters:
|
array |
$images: |
The array of filenames to be sorted. |
|
string |
$sorttype: |
optional sort type |
|
string |
$sortdirection: |
optional sort direction |
void updateParent(
string
$newfolder
)
|
|
changes the parent of an album for move/copy
Parameters:
|
string |
$newfolder: |
The folder name of the new parent |