[ class tree: classes ] [ index: classes ] [ all elements ]

Class: Album

Source Location: /class-album.php

Class Album

Inherited Properties, Constants, and Methods
Inherited Properties Inherited Methods Inherited Constants

Inherited From PersistentObject

PersistentObject::$cache_by
PersistentObject::$data
PersistentObject::$id
PersistentObject::$loaded
PersistentObject::$table
PersistentObject::$transient
PersistentObject::$unique_set
PersistentObject::$updates
PersistentObject::$use_cache

Inherited From PersistentObject

PersistentObject::PersistentObject()
PersistentObject::cache()
Caches the current set of objects defined by a variable key $cache_by.
PersistentObject::copy()
Copy this record to another unique set. Checks if the record exists there first, if so returns false. If successful returns true. No changes are made to this object and no other objects are created, just the database entry.
PersistentObject::get()
Get the value of a variable. If $current is false, return the value as of the last save of this object.
PersistentObject::load()
Load the data array from the database, using the unique id set to get the unique record.
PersistentObject::move()
Change one or more values of the unique set assigned to this record.
PersistentObject::remove()
Deletes object from the database
PersistentObject::save()
Save the updates made to this object since the last update. Returns true if successful, false if not.
PersistentObject::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.
PersistentObject::setDefaults()
Sets default values for new objects using the set() method.

[ Top ]
Property Summary
mixed   $albumthumbnail  
mixed   $commentcount  
mixed   $comments  
mixed   $exists  
mixed   $gallery  
mixed   $images  
mixed   $index  
mixed   $lastimagesort  
mixed   $lastsubalbumsort  
mixed   $localpath  
mixed   $name  
mixed   $parent  
mixed   $parentalbum  
mixed   $searchengine  
mixed   $sidecars  
mixed   $subalbums  
mixed   $themeoverride  

[ Top ]
Method Summary
Album   Album()   Constructor for albums
object   addComment()   Adds comments to the album assumes data is coming straight from GET or POST
int   copyAlbum()   Copy this album to the location specified by $newfolder, copying all metadata, subalbums, and subalbums' metadata with it.
bool   deleteAlbum()   Delete the entire album PERMANENTLY. Be careful! This is unrecoverable.
void   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.
int   getAlbumID()   Returns the id of this album in the db
string   getAlbumLink()   Returns an URL to the album, including the current page number
array   getAlbums()   Returns all folder names for all the subdirectories.
string   getAlbumSortKey()   Returns the DB key associated with the subalbum sort type
string   getAlbumSortType()   Returns the sort type for subalbums in this album.
string   getAlbumTheme()   Returns the theme for the album
string   getAlbumThumb()   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.
int   getCommentCount()   Returns the count of comments in the album. Ignores comments in moderation
array   getComments()   Returns an array of comments for this album
bool   getCommentsAllowed()   Returns true of comments are allowed
string   getCustomData()   returns the custom data field
int   getDateTime()   Returns the unformatted date of the album
string   getDesc()   Returns the album description
string   getFolder()   Returns the folder on the filesystem
int   getGalleryPage()   Returns the page number in the gallery of this album
int   getImage()   Returns an image from the album based on the index passed.
array   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.
string   getImageSortKey()   Returns the DB key associated with the image sort type
string   getLocation()   Returns the place data of an album
object   getNextAlbum()   Returns the album following the current album
int   getNumAlbums()   Returns the count of subalbums
int   getNumImages()   Returns the number of images in this album (not counting its subalbums)
object   getParent()   Returns The parent Album of this Album. NULL if this is a top-level album.
string   getPassword()   Returns the album password
string   getPasswordHint()   Returns the password hint for the album
object   getPrevAlbum()   Returns the album prior to the current album
object   getSearchEngine()   Returns the search engine for a dynamic album
string   getSearchParams()   Returns the search parameters for a dynamic album
bool   getShow()   Returns true if the album is published
string   getSortDirection()   Returns either the subalbum sort direction or the image sort direction of the album
string   getSortOrder()   Returns the image sort order for this album
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
string   getTags()   Returns the tag data of an album
string   getTitle()   Returns the album title
string   getUser()   Returns the album guest user
bool   isDynamic()   Returns true if the album is "dynamic"
array   loadFileNames()   Load all of the filenames that are found in this Albums directory on disk.
int   moveAlbum()   Move this album to the location specified by $newfolder, copying all metadata, subalbums, and subalbums' metadata with it.
void   preLoad()   Simply creates objects of all the images and sub-albums in this album to load accurate values into the database.
boolean   renameAlbum()   Rename this album folder. Alias for moveAlbum($newfoldername);
bool   replicateDBRow()   Replicates the database data for copied albums.
string   replicateSQL()   returns the SQL to insert a row like $subrow into $table
void   setAlbumTheme()   Sets the theme of the album
void   setAlbumThumb()   Stores the thumbnail path for an album thumg
void   setCommentsAllowed()   Stores the value for comments allwed
void   setCustomData()   Sets the custom data field
void   setDateTime()   Stores the album date
bool   setDefaults()   Sets default values for a new album
void   setDesc()   Stores the album description
void   setLocation()   Stores the album place
void   setPassword()   Sets the encrypted album password
void   setPasswordHint()   Sets the album password hint
void   setSearchParams()   Sets the search parameters of a dynamic album
void   setShow()   Stores the published value for the album
void   setSortDirection()   sets sort directions for the album
void   setSortOrder()   Stores the image sort order for this album
void   setSortType()   Stores the sort type for the album
void   setSubalbumSortType()   Stores the subalbum sort type for this abum
void   setTags()   Stores tag information of an album
void   setTitle()   Stores the album title
void   setUser()   Sets the album guest user
array   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.
void   updateParent()   changes the parent of an album for move/copy

[ Top ]
Properties
mixed   $albumthumbnail = NULL [line 26]

[ Top ]
mixed   $commentcount [line 21]

[ Top ]
mixed   $comments [line 20]

[ Top ]
mixed   $exists = true [line 13]

[ Top ]
mixed   $gallery [line 18]

[ Top ]
mixed   $images = null [line 14]

[ Top ]
mixed   $index [line 22]

[ Top ]
mixed   $lastimagesort = NULL [line 24]

[ Top ]
mixed   $lastsubalbumsort = NULL [line 25]

[ Top ]
mixed   $localpath [line 12]

[ Top ]
mixed   $name [line 11]

[ Top ]
mixed   $parent = null [line 16]

[ Top ]
mixed   $parentalbum = null [line 17]

[ Top ]
mixed   $searchengine [line 19]

[ Top ]
mixed   $sidecars = array() [line 27]

[ Top ]
mixed   $subalbums = null [line 15]

[ Top ]
mixed   $themeoverride [line 23]

[ Top ]
Methods
Constructor Album  [line 37]

  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


[ Top ]
addComment  [line 1321]

  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


[ Top ]
copyAlbum  [line 1047]

  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.


[ Top ]
deleteAlbum  [line 872]

  bool deleteAlbum( )

Delete the entire album PERMANENTLY. Be careful! This is unrecoverable.

Returns true if successful



[ Top ]
garbageCollect  [line 1138]

  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


[ Top ]
getAlbumID  [line 145]

  int getAlbumID( )

Returns the id of this album in the db



[ Top ]
getAlbumLink  [line 789]

  string getAlbumLink( )

Returns an URL to the album, including the current page number



[ Top ]
getAlbums  [line 477]

  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


[ Top ]
getAlbumSortKey  [line 447]

  string getAlbumSortKey( [string $sorttype = null]  )

Returns the DB key associated with the subalbum sort type

Parameters:
string   $sorttype:  subalbum sort type


[ Top ]
getAlbumSortType  [line 396]

  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.



[ Top ]
getAlbumTheme  [line 1413]

  string getAlbumTheme( )

Returns the theme for the album



[ Top ]
getAlbumThumb  [line 772]

  string getAlbumThumb( )

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



[ Top ]
getAlbumThumbImage  [line 668]

  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.



[ Top ]
getCommentCount  [line 1331]

  int getCommentCount( )

Returns the count of comments in the album. Ignores comments in moderation



[ Top ]
getComments  [line 1286]

  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


[ Top ]
getCommentsAllowed  [line 1123]

  bool getCommentsAllowed( )

Returns true of comments are allowed



[ Top ]
getCustomData  [line 1348]

  string getCustomData( )

returns the custom data field



[ Top ]
getDateTime  [line 281]

  int getDateTime( )

Returns the unformatted date of the album



[ Top ]
getDesc  [line 242]

  string getDesc( )

Returns the album description



[ Top ]
getFolder  [line 138]

  string getFolder( )

Returns the folder on the filesystem



[ Top ]
getGalleryPage  [line 842]

  int getGalleryPage( )

Returns the page number in the gallery of this album



[ Top ]
getImage  [line 648]

  int getImage( int $index  )

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

Parameters:
int   $index: 


[ Top ]
getImages  [line 525]

  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: 


[ Top ]
getImageSortKey  [line 436]

  string getImageSortKey( [string $sorttype = null]  )

Returns the DB key associated with the image sort type

Parameters:
string   $sorttype:  the sort type


[ Top ]
getLocation  [line 304]

  string getLocation( )

Returns the place data of an album



[ Top ]
getNextAlbum  [line 806]

  object getNextAlbum( )

Returns the album following the current album



[ Top ]
getNumAlbums  [line 508]

  int getNumAlbums( )

Returns the count of subalbums



[ Top ]
getNumImages  [line 635]

  int getNumImages( )

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



[ Top ]
getParent  [line 152]

  object getParent( )

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



[ Top ]
getPassword  [line 187]

  string getPassword( )

Returns the album password



[ Top ]
getPasswordHint  [line 208]

  string getPasswordHint( )

Returns the password hint for the album



[ Top ]
getPrevAlbum  [line 824]

  object getPrevAlbum( )

Returns the album prior to the current album



[ Top ]
getSearchEngine  [line 1398]

  object getSearchEngine( )

Returns the search engine for a dynamic album



[ Top ]
getSearchParams  [line 1375]

  string getSearchParams( [bool $processed = false]  )

Returns the search parameters for a dynamic album

Parameters:
bool   $processed:  set false to process the parms


[ Top ]
getShow  [line 458]

  bool getShow( )

Returns true if the album is published



[ Top ]
getSortDirection  [line 324]

  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


[ Top ]
getSortOrder  [line 421]

  string getSortOrder( )

Returns the image sort order for this album



[ Top ]
getSortType  [line 369]

  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



[ Top ]
getTags  [line 259]

  string getTags( )

Returns the tag data of an album



[ Top ]
getTitle  [line 225]

  string getTitle( )

Returns the album title



[ Top ]
getUser  [line 173]

  string getUser( )

Returns the album guest user



[ Top ]
isDynamic  [line 1364]

  bool isDynamic( )

Returns true if the album is "dynamic"



[ Top ]
loadFileNames  [line 1228]

  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.


[ Top ]
moveAlbum  [line 910]

  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.


[ Top ]
preLoad  [line 1210]

  void preLoad( )

Simply creates objects of all the images and sub-albums in this album to load accurate values into the database.



[ Top ]
renameAlbum  [line 972]

  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.


[ Top ]
replicateDBRow  [line 1020]

  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)


[ Top ]
replicateSQL  [line 983]

  string replicateSQL( string $subrow, string $table  )

returns the SQL to insert a row like $subrow into $table

Parameters:
string   $subrow: 
string   $table: 


[ Top ]
setAlbumTheme  [line 1421]

  void setAlbumTheme( string $theme  )

Sets the theme of the album

Parameters:
string   $theme: 


[ Top ]
setAlbumThumb  [line 782]

  void setAlbumThumb( string $filename  )

Stores the thumbnail path for an album thumg

Parameters:
string   $filename:  thumbnail path


[ Top ]
setCommentsAllowed  [line 1130]

  void setCommentsAllowed( bool $commentson  )

Stores the value for comments allwed

Parameters:
bool   $commentson:  true if comments are enabled


[ Top ]
setCustomData  [line 1357]

  void setCustomData( string $val  )

Sets the custom data field

Parameters:
string   $val:  the value to be put in custom_data


[ Top ]
setDateTime  [line 288]

  void setDateTime( string $datetime  )

Stores the album date

Parameters:
string   $datetime:  formatted date


[ Top ]
setDefaults  [line 118]

  bool setDefaults( )

Sets default values for a new album



Redefinition of:
PersistentObject::setDefaults()
Sets default values for new objects using the set() method.

[ Top ]
setDesc  [line 251]

  void setDesc( string $desc  )

Stores the album description

Parameters:
string   $desc:  description text


[ Top ]
setLocation  [line 313]

  void setLocation( string $place  )

Stores the album place

Parameters:
string   $place:  text for the place field


[ Top ]
setPassword  [line 194]

  void setPassword( string $pwd  )

Sets the encrypted album password

Parameters:
string   $pwd:  the cleartext password


[ Top ]
setPasswordHint  [line 217]

  void setPasswordHint( string $hint  )

Sets the album password hint

Parameters:
string   $hint:  the hint text


[ Top ]
setSearchParams  [line 1389]

  void setSearchParams( string $params  )

Sets the search parameters of a dynamic album

Parameters:
string   $params:  The search string to produce the dynamic album


[ Top ]
setShow  [line 465]

  void setShow( bool $show  )

Stores the published value for the album

Parameters:
bool   $show:  True if the album is published


[ Top ]
setSortDirection  [line 354]

  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


[ Top ]
setSortOrder  [line 428]

  void setSortOrder( string $sortorder  )

Stores the image sort order for this album

Parameters:
string   $sortorder:  image sort order


[ Top ]
setSortType  [line 387]

  void setSortType( string $sorttype  )

Stores the sort type for the album

Parameters:
string   $sorttype:  the album sort type


[ Top ]
setSubalbumSortType  [line 414]

  void setSubalbumSortType( string $sorttype  )

Stores the subalbum sort type for this abum

Parameters:
string   $sorttype:  the subalbum sort type


[ Top ]
setTags  [line 268]

  void setTags( string $tags  )

Stores tag information of an album

Parameters:
string   $tags:  the tag list


[ Top ]
setTitle  [line 234]

  void setTitle( string $title  )

Stores the album title

Parameters:
string   $title:  the title


[ Top ]
setUser  [line 180]

  void setUser( string $user  )

Sets the album guest user

Parameters:
string   $user: 


[ Top ]
sortImageArray  [line 573]

  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


[ Top ]
updateParent  [line 853]

  void updateParent( string $newfolder  )

changes the parent of an album for move/copy

Parameters:
string   $newfolder:  The folder name of the new parent


[ Top ]

Documentation generated on Mon, 09 Aug 2010 17:23:42 +0200 by phpDocumentor 1.4.1