Overview

Packages

  • admin
  • classes
    • media
  • CodeIgniter
    • Libraries
  • core
  • functions
  • JSMin
  • None
  • OpenID
  • PHP
  • PHPMailer
  • plugins
    • admin
    • development
    • feed
    • mail
    • media
    • misc
    • seo
    • spam
    • uploader
    • users
    • zenpage
    • zenphoto
      • news
  • Services
    • JSON

Classes

  • Album
  • AlbumBase
  • Comment
  • dynamicAlbum
  • feed
  • Gallery
  • Image
  • MediaObject
  • PersistentObject
  • SearchEngine
  • ThemeObject
  • Transientimage
  • Zenphoto_Administrator
  • Zenphoto_Authority

Functions

  • isAlbumClass
  • isImageClass
  • newAlbum
  • newImage
  • search_quote
  • Overview
  • Package
  • Class
  • Tree
  • Deprecated

Class Gallery

Package: classes
Located at class-gallery.php
Methods summary
public Gallery
# __construct( )

Creates an instance of a gallery

Creates an instance of a gallery

Returns

Gallery
public string
# getTitle( $locale = NULL )

Returns the gallery title

Returns the gallery title

Returns

string
public string
# getBareTitle( string $locale = NULL )

Returns a tag stripped title

Returns a tag stripped title

Parameters

$locale

Returns

string
public
# setTitle( $title )
public string
# getDesc( $locale = NULL )

Returns the gallery description

Returns the gallery description

Returns

string
public
# setDesc( string $desc )

Sets the gallery description

Sets the gallery description

Parameters

$desc
public
# getPassword( )

Returns the hashed password for guest gallery access

Returns the hashed password for guest gallery access

public
# setPassword( $value )
public string
# getPasswordHint( $locale = NULL )

Returns the hind associated with the gallery password

Returns the hind associated with the gallery password

Returns

string
public
# setPasswordHint( $value )
public
# getUser( )
public
# setUser( $value )
public string
# getAlbumDir( )

Returns the main albums directory

Returns the main albums directory

Returns

string
public string
# getAlbumSortKey( string $sorttype = null )

Returns the DB field corresponding to the album sort type desired

Returns the DB field corresponding to the album sort type desired

Parameters

$sorttype
the desired sort

Returns

string
public
# getSortDirection( )
public
# setSortDirection( $value )
public
# getSortType( )
public
# setSortType( $value )
public array
# getAlbums( integer $page = 0, string $sorttype = null, string $direction = null, boolean $care = true, boolean $mine = NULL )

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

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

$page
An option parameter that can be used to return a slice of the array.
$sorttype
the kind of sort desired
$direction
set to a direction to override the default option
$care
set to false if the order of the albums does not matter
$mine
set true/false to override ownership

Returns

array
public Album
# getAlbum( integer $index )

Returns the a specific album in the array indicated by index. Takes care of bounds checking, no need to check input.

Returns the a specific album in the array indicated by index. Takes care of bounds checking, no need to check input.

Parameters

$index
the index of the album sought

Returns

Album
public integer
# getNumAlbums( boolean $db = false, boolean $publishedOnly = false )

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

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

Parameters

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

Returns

integer
public array
# getThemes( )

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

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

Returns

array
public string
# getCurrentTheme( )

Returns the foldername of the current theme. if no theme is set, picks the "first" theme.

Returns the foldername of the current theme. if no theme is set, picks the "first" theme.

Returns

string
public
# setCurrentTheme( string $theme )

Sets the current theme

Sets the current theme

Parameters

$theme
name of the current theme
public integer
# getNumImages( integer $what = 0 )

Returns the number of images in the gallery

Returns the number of images in the gallery

Parameters

$what

0: all images from the database 1: published images from the database 2: "viewable" images via the object model

Returns

integer
public array
# getNumComments( boolean $moderated = false )

Returns the count of comments

Returns the count of comments

Parameters

$moderated
set true if you want to see moderated comments

Returns

array
public boolean
# garbageCollect( boolean $cascade = true, boolean $complete = false, integer $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.

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

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

Returns

boolean
public
# commentClean( $table )
public static
# clearCache( string $cachefolder = NULL )

Cleans out the cache folder

Cleans out the cache folder

Parameters

$cachefolder
the sub-folder to clean
public array
# sortAlbumArray( array $parentalbum, string $albums, string $sortkey = '`sort_order`', boolean $sortdirection = NULL, $mine = NULL )

Sort the album array based on either according to the sort key. Default is to sort on the sort_order field.

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

$parentalbum
$albums array of album names
$albums
$sortkey the sorting scheme
$sortkey
$sortdirection
$sortdirection
$mine set true/false to override ownership
$mine

Returns

array

Author

Todd Papaioannou (lucky@luckyspin.org)

Since

1.0.0
public integer
# getHitcounter( )

Returns the hitcount

Returns the hitcount

Returns

integer
public
# countHit( )

counts visits to the object

counts visits to the object

public
# getWebsiteTitle( $locale = NULL )

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

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

public
# setWebsiteTitle( $value )
public
# getWebsiteURL( )

The URL of the home (not Zenphoto gallery) WEBsite

The URL of the home (not Zenphoto gallery) WEBsite

public
# setWebsiteURL( $value )
public
# getSecurity( )

Option to allow only registered users view the site

Option to allow only registered users view the site

public
# setSecurity( $value )
public
# getUserLogonField( )

Option to expose the user field on logon forms

Option to expose the user field on logon forms

public
# setUserLogonField( $value )
public
# getAlbumUseImagedate( )

Option to update album date from date of new images

Option to update album date from date of new images

public
# setAlbumUseImagedate( $value )
public
# getThumbSelectImages( )

Option to show images in the thumbnail selector

Option to show images in the thumbnail selector

public
# setThumbSelectImages( $value )
public
# getSecondLevelThumbs( )

Option to show subalbum images in the thumbnail selector

Option to show subalbum images in the thumbnail selector

public
# setSecondLevelThumbs( $value )
public
# getGallerySession( )

Option of for gallery sessions

Option of for gallery sessions

public
# setGallerySession( $value )
public
# isUnprotectedPage( $page )

Tests if a page is excluded from password protection

Parameters

$page
public
# setUnprotectedPage( $page, $on )
public
# getAlbumPublish( )
public
# setAlbumPublish( $v )
public
# getImagePublish( )
public
# setImagePublish( $v )
public array
# getCodeblock( )

Returns the codeblocks as an serialized array

Returns the codeblocks as an serialized array

Returns

array
public
# setCodeblock( $cb )

set the codeblocks as an serialized array

set the codeblocks as an serialized array

public
# checkforGuest( unknown_type & $hint = NULL, unknown_type & $show = NULL )

Checks if guest is loggedin for the album

Checks if guest is loggedin for the album

Parameters

$hint
$show
public
# isProtected( )

returns true if there is any protection on the gallery

public
# get( $field )
public
# set( $field, $value )
public
# save( )
public string
# __toString( )

"Magic" function to return a string identifying the object when it is treated as a string

Returns

string
public static
# addImageHandler( type $suffix, type $objectName )

registers object handlers for image varients

registers object handlers for image varients

Parameters

$suffix
$objectName
public static boolean
# validImage( string $filename )

Returns true if the file is an image

Returns true if the file is an image

Parameters

$filename
the name of the target

Returns

boolean
public static boolean
# validImageAlt( string $filename )

Returns true if the file is handled by an image handler plugin object

Returns true if the file is handled by an image handler plugin object

Parameters

$filename

Returns

boolean
public static
# addAlbumHandler( type $suffix, type $objectName )

registers object handlers for album varients

registers object handlers for album varients

Parameters

$suffix
$objectName
Properties summary
public $albumdir
# NULL
public string $table
# 'gallery'
protected $albums
# NULL
protected $theme
#
protected $themes
#
protected $lastalbumsort
# NULL
protected array $data
# array()
protected array $unprotected_pages
# array()
Zenphoto doc API documentation generated by ApiGen