Creates an instance of a gallery
void clearCache(
[string
$cachefolder = NULL]
)
|
|
Cleans out the cache folder
Parameters:
|
string |
$cachefolder: |
the sub-folder to clean |
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 |
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 |
Returns the main albums directory
array getAlbums(
[int
$page = 0], [string
$sorttype = null], [string
$direction = null]
)
|
|
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 |
string getCurrentTheme(
)
|
|
Returns the foldername of the current theme.
if no theme is set, returns "default".
string getGallerySortKey(
[string
$sorttype = null]
)
|
|
Returns the DB field corresponding to the sort type desired
Parameters:
|
string |
$sorttype: |
the desired sort |
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 unpublished albums |
array getNumComments(
[bool
$moderated = false]
)
|
|
Returns the count of comments
Parameters:
|
bool |
$moderated: |
set true if you want to see moderated comments |
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:
Populates the theme array and returns it. The theme array contains information about all the currently available themes.
Load all of the albums names that are found in the Albums directory on disk.
Returns an array containing this list.
void setCurrentTheme(
string
$theme
)
|
|
Sets the current theme
Parameters:
|
string |
$theme: |
the name of the current theme |
Returns the size in bytes of the cache folder. WARNING: VERY SLOW.
Returns the size in bytes of the albums folder. WARNING: VERY SLOW.