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

Class: Gallery

Source Location: /class-gallery.php

Class Gallery

Property Summary
mixed   $albumdir  
mixed   $albums  
mixed   $lastalbumsort  
mixed   $options  
mixed   $theme  
mixed   $themes  

[ Top ]
Method Summary
Gallery   Gallery()   Creates an instance of a gallery
void   clearCache()   Cleans out the cache folder
bool   garbageCollect()   For every album in the gallery, look for its file. Delete from the database if the file does not exist. Do the same for images. Clean up comments that have been left orphaned.
Album   getAlbum()   Returns the a specific album in the array indicated by index.
string   getAlbumDir()   Returns the main albums directory
array   getAlbums()   Get Albums will create our $albums array with a fully populated set of Album names in the correct order.
string   getAlbumSortKey()   Returns the DB field corresponding to the album sort type desired
string   getCurrentTheme()   Returns the foldername of the current theme.
string   getDesc()   Returns the gallery description
int   getNumAlbums()   Returns the total number of TOPLEVEL albums in the gallery (does not include sub-albums)
array   getNumComments()   Returns the count of comments
int   getNumImages()   Returns the number of images from a database SELECT count(*) Ideally one should call garbageCollect() before to make sure the database is current.
md5   getPassword()   Returns the hashed password for guest gallery access
string   getPasswordHint()   Returns the hind associated with the gallery password
void   getSortDirection()  
array   getThemes()   Populates the theme array and returns it. The theme array contains information about all the currently available themes.
string   getTitle()   Returns the gallery title
void   getUser()  
array   loadAlbumNames()   Load all of the albums names that are found in the Albums directory on disk.
void   setCurrentTheme()   Sets the current theme
int   sizeOfCache()   Returns the size in bytes of the cache folder. WARNING: VERY SLOW.
int   sizeOfImages()   Returns the size in bytes of the albums folder. WARNING: VERY SLOW.
array   sortAlbumArray()   Sort the album array based on either according to the sort key.

[ Top ]
Properties
mixed   $albumdir = NULL [line 12]

[ Top ]
mixed   $albums = NULL [line 13]

[ Top ]
mixed   $lastalbumsort = NULL [line 17]

[ Top ]
mixed   $options = NULL [line 14]

[ Top ]
mixed   $theme [line 15]

[ Top ]
mixed   $themes [line 16]

[ Top ]
Methods
Constructor Gallery  [line 24]

  Gallery Gallery( )

Creates an instance of a gallery



[ Top ]
clearCache  [line 609]

  void clearCache( [string $cachefolder = NULL]  )

Cleans out the cache folder

Parameters:
string   $cachefolder:  the sub-folder to clean


[ Top ]
garbageCollect  [line 334]

  bool garbageCollect( [bool $cascade = true], [bool $complete = false], [int $restart = '']  )

For every album in the gallery, look for its file. Delete from the database if the file does not exist. Do the same for images. Clean up comments that have been left orphaned.

Returns true if the operation was interrupted because it was taking too long

Parameters:
bool   $cascade:  garbage collect every image and album in the gallery.
bool   $complete:  garbage collect every image and album in the *database* - completely cleans the database.
int   $restart:  Image ID to restart scan from


[ Top ]
getAlbum  [line 174]

  Album getAlbum( int $index  )

Returns the a specific album in the array indicated by index.

Takes care of bounds checking, no need to check input.

Parameters:
int   $index:  the index of the album sought


[ Top ]
getAlbumDir  [line 85]

  string getAlbumDir( )

Returns the main albums directory



[ Top ]
getAlbums  [line 115]

  array getAlbums( [int $page = 0], [string $sorttype = null], [string $direction = null], [bool $care = true]  )

Get Albums will create our $albums array with a fully populated set of Album names in the correct order.

Returns an array of albums (a pages worth if $page is not zero)

Parameters:
int   $page:  An option parameter that can be used to return a slice of the array.
string   $sorttype:  the kind of sort desired
string   $direction:  set to a direction to override the default option
bool   $care:  set to false if the order of the albums does not matter


[ Top ]
getAlbumSortKey  [line 93]

  string getAlbumSortKey( [string $sorttype = null]  )

Returns the DB field corresponding to the album sort type desired

Parameters:
string   $sorttype:  the desired sort


[ Top ]
getCurrentTheme  [line 245]

  string getCurrentTheme( )

Returns the foldername of the current theme.

if no theme is set, returns "default".



[ Top ]
getDesc  [line 54]

  string getDesc( )

Returns the gallery description



[ Top ]
getNumAlbums  [line 190]

  int getNumAlbums( [bool $db = false], [bool $publishedOnly = false]  )

Returns the total number of TOPLEVEL albums in the gallery (does not include sub-albums)

Parameters:
bool   $db:  whether or not to use the database (includes ALL detected albums) or the directories
bool   $publishedOnly:  set to true to exclude un-published albums


[ Top ]
getNumComments  [line 314]

  array getNumComments( [bool $moderated = false]  )

Returns the count of comments

Parameters:
bool   $moderated:  set true if you want to see moderated comments


[ Top ]
getNumImages  [line 276]

  int getNumImages( [ $publishedOnly = false]  )

Returns the number of images from a database SELECT count(*) Ideally one should call garbageCollect() before to make sure the database is current.

Parameters:
   $publishedOnly: 


[ Top ]
getPassword  [line 63]

  md5 getPassword( )

Returns the hashed password for guest gallery access



[ Top ]
getPasswordHint  [line 72]

  string getPasswordHint( )

Returns the hind associated with the gallery password



[ Top ]
getSortDirection  [line 98]

  void getSortDirection( )



[ Top ]
getThemes  [line 212]

  array getThemes( )

Populates the theme array and returns it. The theme array contains information about all the currently available themes.



[ Top ]
getTitle  [line 45]

  string getTitle( )

Returns the gallery title



[ Top ]
getUser  [line 76]

  void getUser( )



[ Top ]
loadAlbumNames  [line 142]

  array loadAlbumNames( )

Load all of the albums names that are found in the Albums directory on disk.

Returns an array containing this list.



[ Top ]
setCurrentTheme  [line 265]

  void setCurrentTheme( string $theme  )

Sets the current theme

Parameters:
string   $theme:  the name of the current theme


[ Top ]
sizeOfCache  [line 580]

  int sizeOfCache( )

Returns the size in bytes of the cache folder. WARNING: VERY SLOW.



[ Top ]
sizeOfImages  [line 594]

  int sizeOfImages( )

Returns the size in bytes of the albums folder. WARNING: VERY SLOW.



[ Top ]
sortAlbumArray  [line 646]

  array sortAlbumArray( $parentalbum, array $albums, [string $sortkey = '`sort_order`'], [ $sortdirection = NULL]  )

Sort the album array based on either according to the sort key.

Default is to sort on the `sort_order` field.

Returns an array with the albums in the desired sort order

Parameters:
array   $albums:  array of album names
string   $sortkey:  the sorting scheme
   $parentalbum: 
   $sortdirection: 

Information Tags:
Author:  Todd Papaioannou (lucky@luckyspin.org)
Since:  1.0.0

[ Top ]

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