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

Procedural File: viewer_size_image.php

Source Location: /zp-extensions/viewer_size_image.php

Page Details

Provides a means where visitors can select the size of the image on the image page.

The default size and list of allowed sizes may be set in the plugin options or passed as a parameter to the support functions.

The user selects a size to view from a radio button list. This size is then saved in a cookie and used as the default for future image viewing.

Sizes as used for the default size and the allowed size list are strings with the The form is $s=<i>size</i> or $h=<i>heigh</i>; $w=<i>width</i>;.... See printCustomSizedImage() for information about how these values are used.

If $s is present, the plugin will use printCustomSizedImage() to display the image. Otherwise both $w and $h must be present. Then printCustomSizedImageMaxSpace() is used for displaying the image.

You must place calls on printUserSizeSelector() and printUserSizeImage() at appropriate places in your theme's image.php script to activate these features.

Author:  Stephen Billard (sbillard)
Classes
Class Description
viewer_size_image_options Plugin option handling class
Functions
getViewerImageSize  [line 229]

returns the current values for the image size or its height & width

This information comes form (in order of priority)

  1. The posting of a radio button selection
  2. A cookie stored from #1
  3. The default (either as passed, or from the plugin option.)
The function is used internally, so the above priority determines the image sizing.

Parameters:
string   $default:  the default (initial) value for the image sizing
int   $size:  The size of the image (Width and Height are NULL)
int   $width:  The width of the image (size is null)
int   $height:  The height of the image (size is null)
   &$size: 
   &$width: 
   &$height: 


void getViewerImageSize( string $default, &$size, &$width, &$height, int $size, int $width, int $height  )

[ Top ]
printUserSizeImage  [line 274]

prints the image according to the size chosen

Parameters:
string   $alt:  alt text for the img src Tag
string   $default:  the default (initial) value for the image sizing
string   $class:  if not empty will be used as the image class tag
string   $id:  if not empty will be used as the image id tag


void printUserSizeImage( string $alt, [string $default = NULL], [string $class = NULL], [string $id = NULL]  )

[ Top ]
printUserSizeSelector  [line 83]

prints the radio button image size selection list

Parameters:
string   $text:  text to introduce the radio button list
string   $default:  the default (initial) for the image sizing
array   $usersizes:  an array of sizes which may be choosen.


void printUserSizeSelector( [string $text = ''], [string $default = NULL], [array $usersizes = NULL]  )

[ Top ]


Documentation generated on Sat, 05 Jan 2013 15:51:29 +0100 by phpDocumentor 1.4.3