Class ShashinAlbum

Description

Instantiate this class and use its methods to manipulate Picasa albums in Shashin. Also has a static population method, getAlbums() and a static method for generating markup, getAlbumMarkup().

  • author: Michael Toppa

Located in /ShashinAlbum.php (line 23)


	
			
Variable Summary
 mixed $data
 mixed $ref_data
Method Summary
 static string getAlbumListMarkup (array $match)
 static mixed getAlbums ([string|array $keywords = '*'], [string|array $conditions = null], [string $other = null])
 static string getAlbumThumbsMarkup (array $match)
 static mixed getUsers ()
 static array setUserAlbums (string $user_name, [array $local_data = null], [boolean $sync_only = true])
 static array _getOrderedAlbums (array $match)
 static string _getTableMarkup (array $albums, array $match)
 ShashinAlbum ShashinAlbum ()
 boolean|array deleteAlbum ()
 array getAlbum ([array $album_identifier = null], [array $album_data = null])
 string getAlbumMarkup (array $match)
 array getAlbumPhotos ([string $order_by = 'photo_id'], [integer $limit = null], [boolean $include_deleted = false])
 array setAlbum (string $user_name, array $album_identifier, [array $local_data = null])
 array setAlbumLocal (array $data)
 array setAlbumPhotos ()
 string _getAlbumLink ([boolean $force_picasa = false])
 string _getAlbumThumbTag ([boolean $force_picasa = false])
 string _getDivMarkup (array $match)
Variables
mixed $data (line 25)
mixed $ref_data (line 24)
Methods
static getAlbumListMarkup (line 683)

Returns xhtml markup for displaying album thumbnails paired with the album description, and optional other data to display. Will instead call ShashinPhoto::getAlbumPhotosMarkup() if there is an album key in the $_REQUEST.

string getAlbumListMarkup (array $match)
  • array $match: see details in Shashin::parseContent()
static getAlbums (line 528)

Retrieves data for multiple albums from the shashin_album table.

mixed getAlbums ([string|array $keywords = '*'], [string|array $conditions = null], [string $other = null])
  • string|array $keywords: the fields to return
  • string|array $conditions: (optional) array of key-values pairs, or a string containing its own WHERE clause
  • string $other: (optional) any additional conditions for the query (GROUP BY, etc.)
static getAlbumThumbsMarkup (line 646)

Returns xhtml markup for displaying album thumbnails in a table. Will instead call ShashinPhoto::getAlbumPhotosMarkup() if there is an album key in the $_REQUEST.

string getAlbumThumbsMarkup (array $match)
  • array $match: see details in Shashin::parseContent()
static getUsers (line 754)

Get all the user_names in the album table.

mixed getUsers ()
static setUserAlbums (line 549)

Inserts or updates all albums for a Picasa user.

array setUserAlbums (string $user_name, [array $local_data = null], [boolean $sync_only = true])
  • string $user_name: (required) the Picasa user_name of the album's owner
  • array $local_data: (optional) A hash of local album data (data not from the Picasa feed)
  • boolean $sync_only: (optional) whether to sync existing albums when adding new albums (default: false)
static _getOrderedAlbums (line 766)

Returns the requested albums in the desired order.

array _getOrderedAlbums (array $match)
  • array $match: see detailed list in Shashin::parseContent()
static _getTableMarkup (line 879)

Generates an xhtml table containing thumbnails of the the passed in albums. Note that $albums is an array of arrays of album data, not ShashinAlbum objects.

string _getTableMarkup (array $albums, array $match)
  • array $albums: array of arrays containing album data
  • array $match: see detailed list in Shashin::parseContent()
Constructor ShashinAlbum (line 34)

The constructor sets $this->ref_data, which is used for creating the shashin_album table, for mapping Picasa RSS feed params to table field names, and for generating form input fields.

ShashinAlbum ShashinAlbum ()
deleteAlbum (line 231)

Deletes an album and all its photos from Shashin. Works only if getAlbum() was successfully called first.

boolean|array deleteAlbum ()
getAlbum (line 109)

Populates a ShashinAlbum object based on an album identifier (can be a Picasa ID, album name, or Shashin key) or a passed-in array of album data.

array getAlbum ([array $album_identifier = null], [array $album_data = null])
  • array $album_identifier: (optional) a key-value pair (e.g. 'album_id' => 37)
  • array $album_data: (optional) a complete array of album data
getAlbumMarkup (line 445)

DEPRECATED - use getAlbumThumbsMarkup instead.

Translates the "salbum" Shashin tag into xhtml displaying the thumbnail for the album cover. Picasa thumbnail size is fixed at 160x160.

string getAlbumMarkup (array $match)
  • array $match: see detailed list in Shashin::parseContent()
getAlbumPhotos (line 262)

Retrieves all photos in the shashin_photo table for an album. Must call getAlbum() first.

array getAlbumPhotos ([string $order_by = 'photo_id'], [integer $limit = null], [boolean $include_deleted = false])
  • string $order_by: (optional) column name(s) to order by (default: photo_id)
  • integer $limit: (optional) a max number of records to return (default: null)
  • boolean $include_deleted: (optional) whether to include photos flagged as deleted (default: false)
setAlbum (line 156)

Inserts or updates a Picasa album in Shashin.

Reads the user's Picasa feed of all albums and retieves data for the specified album. Does not insert/update album photos. On success, calls getAlbum() to (re)populate the album object.

array setAlbum (string $user_name, array $album_identifier, [array $local_data = null])
  • string $user_name: The Picasa user_name of the album's owner
  • array $album_identifier: A key-value pair (e.g. 'album_id' => 37)
  • array $local_data: (optional) A hash of local album data (data not from the Picasa feed)
setAlbumLocal (line 420)

Updates local album data (i.e. data that doesn't come from the Picasa RSS feed).

  • return: 0: true on success, false on failure; 1: message; 2: true if SQL error
  • access: public
  • usedby: Shashin::getAdminMenu()
array setAlbumLocal (array $data)
  • array $data: A hash of album data (keys are column names)
setAlbumPhotos (line 312)

Inserts or updates photos for a Picasa album. Must successfully call getAlbum() or setAlbum() first.

Reads the Picasa photo feed for a given album. Calls getAlbumPhotos() to copmpare new data to old data. New photos are inserted, and old photos are updated as needed (can be flagged as deleted or moved to another album). On success, calls getAlbumPhotos() to refresh the data in memory.

array setAlbumPhotos ()
_getAlbumLink (line 488)

Generates a link to an album's photo, either at Picasa or locally, depending on the option shashin_album_photos_url. The link includes an opening anchor tag but not a closing one.

string _getAlbumLink ([boolean $force_picasa = false])
  • boolean $force_picasa: (optional): force the album link to point to Picasa (default: false)
_getAlbumThumbTag (line 470)

Generates the xhtml markup for an album thumbnail, with an appropriate link for accessing the album photos

string _getAlbumThumbTag ([boolean $force_picasa = false])
  • boolean $force_picasa: (optional): force the album link to point to Picasa (default: false)
_getDivMarkup (line 818)

Generates the xhtml div for displaying an album thumbnail.

string _getDivMarkup (array $match)
  • array $match: see detailed list in Shashin::parseContent()

Documentation generated on Wed, 01 Jul 2009 07:48:18 -0400 by phpDocumentor 1.4.2