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

Class: Gallery

Source Location: /class-gallery.php

Class Gallery

Property Summary
mixed   $albumdir  
mixed   $albums  
mixed   $data  
mixed   $lastalbumsort  
mixed   $theme  
mixed   $themes  
mixed   $unprotected_pages  

[ Top ]
Method Summary
Gallery   __construct()   Creates an instance of a gallery
void   checkforGuest()   Checks if guest is loggedin for the album
void   clearCache()   Cleans out the cache folder
void   commentClean()  
void   countHit()   counts visits to the object
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.
void   get()  
Album   getAlbum()   Returns the a specific album in the array indicated by index.
string   getAlbumDir()   Returns the main albums directory
void   getAlbumPublish()  
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
void   getAlbumUseImagedate()   Option to update album date from date of new images
array   getCodeblock()   Returns the codeblocks as an serialized array
string   getCurrentTheme()   Returns the foldername of the current theme.
string   getDesc()   Returns the gallery description
void   getGallerySession()   Option of for gallery sessions
int   getHitcounter()   Returns the hitcount
void   getImagePublish()  
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 Ideally one should call garbageCollect() before to make sure the database is current.
void   getPassword()   Returns the hashed password for guest gallery access
string   getPasswordHint()   Returns the hind associated with the gallery password
void   getPersistentArchive()   Option of caching Album ZIP files
void   getSecondLevelThumbs()   Option to show subalbum images in the thumbnail selector
void   getSecurity()   Option to allow only registered users view the site
void   getSortDirection()  
void   getSortType()  
array   getThemes()   Populates the theme array and returns it. The theme array contains information about all the currently available themes.
void   getThumbSelectImages()   Option to show images in the thumbnail selector
string   getTitle()   Returns the gallery title
void   getUser()  
void   getUserLogonField()   Option to expose the user field on logon forms
void   getWebsiteTitle()   Title to be used for the home (not Zenphoto gallery) WEBsite
void   getWebsiteURL()   The URL of the home (not Zenphoto gallery) WEBsite
void   isProtected()   returns true if there is any protection on the gallery
void   isUnprotectedPage()   Tests if a page is excluded from password protection
void   save()  
void   set()  
void   setAlbumPublish()  
void   setAlbumUseImagedate()  
void   setCodeblock()   set the codeblocks as an serialized array
void   setCurrentTheme()   Sets the current theme
void   setGallerySession()  
void   setImagePublish()  
void   setPassword()  
void   setPasswordHint()  
void   setPersistentArchive()  
void   setSecondLevelThumbs()  
void   setSecurity()  
void   setSortDirection()  
void   setSortType()  
void   setThumbSelectImages()  
void   setUnprotectedPage()  
void   setUser()  
void   setUserLogonField()  
void   setWebsiteTitle()  
void   setWebsiteURL()  
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 11]

[ Top ]
mixed   $albums = NULL [line 12]
API Tags:
Access:  protected


[ Top ]
mixed   $data = array() [line 16]
API Tags:
Access:  protected


[ Top ]
mixed   $lastalbumsort = NULL [line 15]
API Tags:
Access:  protected


[ Top ]
mixed   $theme [line 13]
API Tags:
Access:  protected


[ Top ]
mixed   $themes [line 14]
API Tags:
Access:  protected


[ Top ]
mixed   $unprotected_pages = array() [line 17]
API Tags:
Access:  protected


[ Top ]
Methods
Constructor __construct  [line 24]

  Gallery __construct( )

Creates an instance of a gallery



[ Top ]
checkforGuest  [line 924]

  void checkforGuest( [ &$hint = NULL], [ &$show = NULL], unknown_type $hint, unknown_type $show  )

Checks if guest is loggedin for the album

Parameters:
unknown_type   $hint: 
unknown_type   $show: 
   &$hint: 
   &$show: 


[ Top ]
clearCache  [line 648]

  void clearCache( [string $cachefolder = NULL]  )

Cleans out the cache folder

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


[ Top ]
commentClean  [line 594]

  void commentClean( $table  )

Parameters:
   $table: 


[ Top ]
countHit  [line 770]

  void countHit( )

counts visits to the object



[ Top ]
garbageCollect  [line 351]

  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 ]
get  [line 944]

  void get( $field  )

Parameters:
   $field: 


[ Top ]
getAlbum  [line 194]

  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 94]

  string getAlbumDir( )

Returns the main albums directory



[ Top ]
getAlbumPublish  [line 887]

  void getAlbumPublish( )



[ Top ]
getAlbums  [line 135]

  array getAlbums( [int $page = 0], [string $sorttype = null], [string $direction = null], [bool $care = true], [bool $mine = 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
bool   $care:  set to false if the order of the albums does not matter
bool   $mine:  set true/false to override ownership


[ Top ]
getAlbumSortKey  [line 102]

  string getAlbumSortKey( [string $sorttype = null]  )

Returns the DB field corresponding to the album sort type desired

Parameters:
string   $sorttype:  the desired sort


[ Top ]
getAlbumUseImagedate  [line 818]

  void getAlbumUseImagedate( )

Option to update album date from date of new images



[ Top ]
getCodeblock  [line 906]

  array getCodeblock( )

Returns the codeblocks as an serialized array



[ Top ]
getCurrentTheme  [line 264]

  string getCurrentTheme( )

Returns the foldername of the current theme.

if no theme is set, returns "default".



[ Top ]
getDesc  [line 51]

  string getDesc( )

Returns the gallery description



[ Top ]
getGallerySession  [line 858]

  void getGallerySession( )

Option of for gallery sessions



[ Top ]
getHitcounter  [line 763]

  int getHitcounter( )

Returns the hitcount



[ Top ]
getImagePublish  [line 894]

  void getImagePublish( )



[ Top ]
getNumAlbums  [line 210]

  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 332]

  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 295]

  int getNumImages( [bool $publishedOnly = false]  )

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

Parameters:
bool   $publishedOnly:  set to true to count only published images.


[ Top ]
getPassword  [line 59]

  void getPassword( )

Returns the hashed password for guest gallery access



[ Top ]
getPasswordHint  [line 75]

  string getPasswordHint( )

Returns the hind associated with the gallery password



[ Top ]
getPersistentArchive  [line 848]

  void getPersistentArchive( )

Option of caching Album ZIP files



[ Top ]
getSecondLevelThumbs  [line 838]

  void getSecondLevelThumbs( )

Option to show subalbum images in the thumbnail selector



[ Top ]
getSecurity  [line 798]

  void getSecurity( )

Option to allow only registered users view the site



[ Top ]
getSortDirection  [line 107]

  void getSortDirection( )



[ Top ]
getSortType  [line 113]

  void getSortType( )



[ Top ]
getThemes  [line 231]

  array getThemes( )

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



[ Top ]
getThumbSelectImages  [line 828]

  void getThumbSelectImages( )

Option to show images in the thumbnail selector



[ Top ]
getTitle  [line 42]

  string getTitle( )

Returns the gallery title



[ Top ]
getUser  [line 82]

  void getUser( )



[ Top ]
getUserLogonField  [line 808]

  void getUserLogonField( )

Option to expose the user field on logon forms



[ Top ]
getWebsiteTitle  [line 778]

  void getWebsiteTitle( )

Title to be used for the home (not Zenphoto gallery) WEBsite



[ Top ]
getWebsiteURL  [line 788]

  void getWebsiteURL( )

The URL of the home (not Zenphoto gallery) WEBsite



[ Top ]
isProtected  [line 940]

  void isProtected( )

returns true if there is any protection on the gallery



[ Top ]
isUnprotectedPage  [line 871]

  void isUnprotectedPage( $page $page  )

Tests if a page is excluded from password protection

Parameters:
$page   $page: 


[ Top ]
save  [line 955]

  void save( )



[ Top ]
set  [line 951]

  void set( $field, $value  )

Parameters:
   $field: 
   $value: 


[ Top ]
setAlbumPublish  [line 890]

  void setAlbumPublish( $v  )

Parameters:
   $v: 


[ Top ]
setAlbumUseImagedate  [line 821]

  void setAlbumUseImagedate( $value  )

Parameters:
   $value: 


[ Top ]
setCodeblock  [line 914]

  void setCodeblock( $cb  )

set the codeblocks as an serialized array

Parameters:
   $cb: 


[ Top ]
setCurrentTheme  [line 284]

  void setCurrentTheme( string $theme  )

Sets the current theme

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


[ Top ]
setGallerySession  [line 861]

  void setGallerySession( $value  )

Parameters:
   $value: 


[ Top ]
setImagePublish  [line 897]

  void setImagePublish( $v  )

Parameters:
   $v: 


[ Top ]
setPassword  [line 66]

  void setPassword( $value  )

Parameters:
   $value: 


[ Top ]
setPasswordHint  [line 78]

  void setPasswordHint( $value  )

Parameters:
   $value: 


[ Top ]
setPersistentArchive  [line 851]

  void setPersistentArchive( $value  )

Parameters:
   $value: 


[ Top ]
setSecondLevelThumbs  [line 841]

  void setSecondLevelThumbs( $value  )

Parameters:
   $value: 


[ Top ]
setSecurity  [line 801]

  void setSecurity( $value  )

Parameters:
   $value: 


[ Top ]
setSortDirection  [line 110]

  void setSortDirection( $value  )

Parameters:
   $value: 


[ Top ]
setSortType  [line 117]

  void setSortType( $value  )

Parameters:
   $value: 


[ Top ]
setThumbSelectImages  [line 831]

  void setThumbSelectImages( $value  )

Parameters:
   $value: 


[ Top ]
setUnprotectedPage  [line 874]

  void setUnprotectedPage( $page, $on  )

Parameters:
   $page: 
   $on: 


[ Top ]
setUser  [line 85]

  void setUser( $value  )

Parameters:
   $value: 


[ Top ]
setUserLogonField  [line 811]

  void setUserLogonField( $value  )

Parameters:
   $value: 


[ Top ]
setWebsiteTitle  [line 781]

  void setWebsiteTitle( $value  )

Parameters:
   $value: 


[ Top ]
setWebsiteURL  [line 791]

  void setWebsiteURL( $value  )

Parameters:
   $value: 


[ Top ]
sizeOfCache  [line 619]

  int sizeOfCache( )

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



[ Top ]
sizeOfImages  [line 633]

  int sizeOfImages( )

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



[ Top ]
sortAlbumArray  [line 689]

  array sortAlbumArray( $parentalbum, array $albums, [string $sortkey = '`sort_order`'], [string $sortdirection = NULL], [bool $mine = 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
string   $sortdirection: 
bool   $mine:  set true/false to override ownership
   $parentalbum: 

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

[ Top ]

Documentation generated on Tue, 20 Dec 2011 16:06:46 +0100 by phpDocumentor 1.4.3