Class ShashinPhoto

Description

For manipulating and displaying Picasa photos in Shashin.

  • author: Michael Toppa

Located in /ShashinPhoto.php (line 21)


	
			
Variable Summary
 mixed $data
 mixed $ref_data
Method Summary
 static string getAlbumPhotosMarkup (array $match)
 static string getNewestMarkup (array $match)
 static array getPhotos ([string|array $keywords = 'sp.*'], [string|array $conditions = null], [string $other = null])
 static string getRandomMarkup (array $match)
 static string getThumbsMarkup (array $match)
 static string _getTableMarkup (array $photos, array $match, [string $desc = null])
 static int _setMaxPicasaSize (int $theme_max, int $cols)
 ShashinPhoto ShashinPhoto ()
 array getPhoto ([array $photo_identifier = null], [array $photo_data = null])
 string getPhotoMarkup (array $match, [boolean $admin = false])
 array setPhotoLocal (array $data)
 string _getDivMarkup (array $match, [boolean $thumb = false], [integer $group = null], [boolean $controller = false], [ $admin = false])
 boolean _isVideo ()
 boolean _setDimensions (int $max)
Variables
mixed $data (line 23)
mixed $ref_data (line 22)
Methods
static getAlbumPhotosMarkup (line 348)

Static method that display thumbnails for photos in an album. Can be invoked by the salbumphotos tag, or with $_REQUEST['shashin_album_key'] when an album cover thumbnail is clicked.

string getAlbumPhotosMarkup (array $match)
  • array $match: see details in Shashin::parseContent()
static getNewestMarkup (line 282)

Translates the "snewest" Shashin tag into xhtml displaying a table of thumbnails of your newest photos (by upload date). If album keys are not provided, then it will pick from among all photos.

string getNewestMarkup (array $match)
  • array $match: see details in Shashin::parseContent()
static getPhotos (line 201)

A static method for retrieving an arbitrary set of photos.

array getPhotos ([string|array $keywords = 'sp.*'], [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 getRandomMarkup (line 250)

Translates the "srandom" Shashin tag into xhtml displaying a table of random photos. If album keys are not provided, then it will pick from among all photos.

Note that if an album has include_in_random=n, no photos from it will be displayed, even if the photos in it have include_in_random=y.

string getRandomMarkup (array $match)
  • array $match: see details in Shashin::parseContent()
static getThumbsMarkup (line 311)

Static method that translates the "sthumbs" Shashin tag into an xhtml table displaying the specified thumbnails, each with a hyperlink to the photo (either in Highslide or at Picasa).

string getThumbsMarkup (array $match)
  • array $match: see details in Shashin::parseContent()
static _getTableMarkup (line 481)

Generates an xhtml table containing the passed in photos. Note that $photos is an array of arrays of photo data, not ShashinPhoto objects.

string _getTableMarkup (array $photos, array $match, [string $desc = null])
  • array $photos: array of arrays containing photo data
  • array $match: data for customizing the markup
  • string $desc: an optional album description to display (as a table caption)
static _setMaxPicasaSize (line 444)

Finds the maximum possible Picasa image size for a given number of thumbnail columns. Assumes 10px of padding/margin per image.

NOTE: The calculation will be incorrect for pictures with a portrait orientation

  • return: The largest possible allowed Picasa size
  • access: private
int _setMaxPicasaSize (int $theme_max, int $cols)
  • int $theme_max: The content width of the theme, minus padding
  • int $cols: The number of columns of thumbnails
Constructor ShashinPhoto (line 33)

The constructor sets $this->ref_data, which maps Picasa photo properties to ShashinPhoto object properties. It's also used for creating the shashin_photo table and for generating form input fields.

ShashinPhoto ShashinPhoto ()
getPhoto (line 140)

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

array getPhoto ([array $photo_identifier = null], [array $photo_data = null])
  • array $photo_identifier: a key-value pair (e.g. 'photo_id' => 37)
  • array $photo_data: a complete array of photo data
getPhotoMarkup (line 217)

Translates the "simage" Shashin tag into xhtml displaying the specified photo, with a hyperlink to the photo (either in Highslide or at Picasa).

string getPhotoMarkup (array $match, [boolean $admin = false])
  • array $match: see detailed list in Shashin::parseContent()
  • boolean $admin: whether we are displaying thumbnails on the admin page
setPhotoLocal (line 176)

Updates local photo 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 setPhotoLocal (array $data)
  • array $data: A hash of photo data (keys are column names)
_getDivMarkup (line 628)

Generates the xhtml div for displaying an image.

string _getDivMarkup (array $match, [boolean $thumb = false], [integer $group = null], [boolean $controller = false], [ $admin = false])
  • array $match: see detailed list in ShashinPhoto::getPhotoMarkup()
  • boolean $thumb: if true the shashin_thumb_padding class will be applied
  • integer $group: a group ID number for Highslide
  • boolean $controller: whether the image display has a Highslide controller
  • $admin
_isVideo (line 855)

Test to see whether we're dealing with a picture or a video

  • access: private
boolean _isVideo ()
_setDimensions (line 574)

Calculates the height or width for an image, based on $max. See See http://code.google.com/apis/picasaweb/reference.html for an explanation of the supported image sizes.

$max is your desired maximum image dimension. It will be applied to the width of the image if it has a landscape orientation, or to the height if it has a portrait orientation (that's how Picasa works). The dimensions are added to $this->data as user_width, user_height, and user_max

boolean _setDimensions (int $max)
  • int $max: the maximum desired image dimension (could be width or height)

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