Stud.IP  2.4 Revision 48548
 All Data Structures Namespaces Files Functions Variables Groups Pages
Smiley Class Reference
Collaboration diagram for Smiley:
Collaboration graph

Public Member Functions

 getFilename ($name=null)
 getURL ($name=null)
 getImageTag ($tooltip=null)
 img ($name, $tooltip=null, $width=null, $height=null)
 store ()
 rename ($new_name)
 delete ()

Static Public Member Functions

static getById ($id)
static getByIds ($ids)
static getByName ($name)
static getByShort ($short)
static Remove ($id)
static getGrouped ($group= 'all', $mode=self::FETCH_ALL)
static getFirstUsedCharacter ()
static getUsedCharacters ()
static getShort ()
static getStatistics ()
static getUsage ()
static updateUsage ()
static refresh ($smiley_file=null)

Data Fields

const FETCH_ALL = 0
const FETCH_ID = 1
 $id = null
 $name = ''
 $width = 0
 $height = 0
 $short = ''
 $count = 0
 $short_count = 0
 $fav_count = 0
 $mkdate = null
 $chdate = null

Member Function Documentation

delete ( )

Deletes the smiley.

Here is the call graph for this function:

static getById (   $id)
static

Returns the smiley object with the given id. If no such object is available, an empty object is returned.

Parameters
int$idId of the smiley to load
Returns
Smiley Smiley object

Here is the call graph for this function:

Here is the caller graph for this function:

static getByIds (   $ids)
static

Returns a collection smiley objects with the given ids.

Parameters
mixed$idsIds of the smileys to load, also accepts an atomic id
Returns
Array Array of Smiley objects

Here is the call graph for this function:

Here is the caller graph for this function:

static getByName (   $name)
static

Returns the smiley object with the given name. If no such object is available, an empty object is returned

Parameters
String$nameName of the smiley to load
Returns
Smiley Smiley object

Here is the call graph for this function:

Here is the caller graph for this function:

static getByShort (   $short)
static

Returns the smiley object with the given short notation. If no such object is available, an empty object is returned

Parameters
String$shortShort notation of the smiley to load
Returns
Smiley Smiley object

Here is the call graph for this function:

Here is the caller graph for this function:

getFilename (   $name = null)

Returns the absolute filename of a smiley.

Parameters
mixed$nameSmiley name, defaults to current smiley's name
Returns
String Absolute filename

Here is the caller graph for this function:

static getFirstUsedCharacter ( )
static

Returns an ordered unique list of the first characters of all smileys.

Returns
Array Ordered list of all first characters

Here is the call graph for this function:

Here is the caller graph for this function:

static getGrouped (   $group = 'all',
  $mode = self::FETCH_ALL 
)
static

Loads a given group from the database.

Parameters
String$groupGroup to load, defaults to 'all'
int$modeFetch mode
  • FETCH_ALL to return actual Smiley objects
  • FETCH_ID to return the group's items' ids
Returns
Array Either the objects or the ids of the group's items

Here is the call graph for this function:

Here is the caller graph for this function:

getImageTag (   $tooltip = null)

Returns the HTML image tag of the smiley

Parameters
mixed$tooltipTooltip to display for this smiley, defaults to smiley's name
Returns
String HTML image tag
See Also
Smiley::img

Here is the call graph for this function:

static getShort ( )
static

Returns a list of all available short notations.

Returns
Array Associative list with short notation as key and smiley name as value

Here is the call graph for this function:

Here is the caller graph for this function:

static getStatistics ( )
static

Returns some statistics about the smiley database.

Returns
Array 4 numbers: available, used, occurences and last change

Here is the call graph for this function:

Here is the caller graph for this function:

getURL (   $name = null)

Returns the url of a smiley.

Parameters
mixed$nameSmiley name, defaults to current smiley's name
Returns
String URL

Here is the caller graph for this function:

static getUsage ( )
static

Searches the database for occurences of smileys and returns a list of how often each smiley was used. If smiley favorites are activated, the list will include the number how often a smiley was favored.

Returns
Array Associative array with smiley name as key and according usage numbers as value

Here is the call graph for this function:

Here is the caller graph for this function:

static getUsedCharacters ( )
static

Returns an associative list of the first characters of all smileys and their according quantity.

Returns
Array Associative list with character as key and quantity as value

Here is the call graph for this function:

Here is the caller graph for this function:

img (   $name,
  $tooltip = null,
  $width = null,
  $height = null 
)

Returns the HTML image tag of any smiley.

Parameters
String$nameName of the smiley
mixed$tooltipTooltip to display for this smiley, defaults to smiley's name
mixed$widthWidth of the smiley
mixed$heightHeight of the smiley
Returns
String HTML image tag

Here is the call graph for this function:

Here is the caller graph for this function:

static refresh (   $smiley_file = null)
static

Synchronizes the smileys' file system or an atomic file with the database. The smiley directory is scanned for new, changed or missing files. Any difference will change the database's record.

This method is also used for uploading new smileys. Provide an absolute filename of a smiley and it will either be imported into the database or the database will be adjusted to the current file's dimensions.

Parameters
mixed$smiley_fileIf no filename is provided, the whole file system is refreshed
Returns
Array Numbers: inserted, updated, removed (, favorites adjusted)

Here is the call graph for this function:

Here is the caller graph for this function:

static Remove (   $id)
static

Removes a smiley or a collection of smileys from the database.

Parameters
mixed$idId(s) to delete, accepts either an atomic id or an array of ids

Here is the call graph for this function:

Here is the caller graph for this function:

rename (   $new_name)

Renames the smiley to the given new name.

Parameters
String$new_nameNew name of the smiley
Returns
bool true if smiley was renamed successfully, false otherwise

Here is the call graph for this function:

store ( )

Stores the current smiley to database.

Here is the call graph for this function:

Here is the caller graph for this function:

static updateUsage ( )
static

Refreshes the database with current usage numbers.

Returns
int Number of changed objects

Here is the call graph for this function:

Here is the caller graph for this function:

Field Documentation

$chdate = null
$count = 0
$fav_count = 0
$height = 0
$id = null
$mkdate = null
$name = ''
$short = ''
$short_count = 0
$width = 0
const FETCH_ALL = 0
const FETCH_ID = 1

The documentation for this class was generated from the following file: