abbreviate (line 297)
Truncates a string to a given number of characters, adding an ellipsis if necessary.
string
abbreviate
(string $value, [integer $length = 40])
-
string
$value: a string
-
integer
$length: the number of characters
div (line 116)
Returns a <div> tag.
string
div
(string $class, string $text)
-
string
$class: the class
-
string
$text: the text
frame (line 143)
Returns a <frame> tag.
string
frame
(string $src, string $name, string $scrolling, [string $class = NULL])
-
string
$src: the path to the source file
-
string
$name: the name of the frame
-
string
$scrolling: whether scrolling is allowed, 'yes'|'no'|'auto'
-
string
$class: the class
frameset (line 128)
Returns a <frameset> tag.
string
frameset
(string $dimension, string $sizes, array $frames)
-
string
$dimension: either 'rows' or 'cols'
-
string
$sizes: the size in pixels of the frames, e.g. '30,*,10'
-
array
$frames: the frames or framesets
head (line 21)
Prints a <head> tag with title, generator, author, and stylesheet attributes.
void
head
(string $title, [string $styles = 'styles.css'])
-
string
$title: the title of the page
-
string
$styles: the name of the stylesheet
hyperlink (line 72)
Returns a <a> hyperlink tag.
string
hyperlink
(string $path, string $text, [string $stuff = ''])
-
string
$path: the path to the destination file
-
string
$text: the text or image to be linked
-
string
$stuff: extra attributes to be included in the tag
iframe (line 158)
Returns an <iframe> inline frame tag.
string
iframe
(string $src, string $name, integer $width, integer $height, [string $scrolling = FALSE])
-
string
$src: the path to the source file
-
string
$name: the name of the frame
-
integer
$width: the width in pixels
-
integer
$height: the height in pixels
-
string
$scrolling: whether scrolling is allowed, 'yes'|'no'|'auto'
img (line 101)
Returns an <img> image tag.
string
img
(string $path, string $alt, [integer $width = 0], [integer $height = 0], [string $stuff = ''])
-
string
$path: the path to the image file
-
string
$alt: the alternate text
-
integer
$width: the width in pixels
-
integer
$height: the height in pixels
-
string
$stuff: extra attributes to be included in the tag
load_time (line 330)
Returns the time it took to load the page in seconds and milliseconds.
Set $start_time to microtime() when beginning to load the page, then call load_time($start_time) after loading the page.
float
load_time
(string $start_time)
-
string
$start_time: the start time from calling microtime()
local_format (line 252)
Returns the number formatted in the local format with the specified number of decimal places.
string
local_format
(double $number, [integer $places = 0])
-
double
$number: a number
-
integer
$places: the number of decimal places
path_with_args (line 193)
Composes a GET URL from a path, arguments, and optionally an anchor.
For example, if $string is 'file.php' and $args are { 'artist' => 'pink_floyd', 'album' => 'pulse' }, will return 'file.php?artist=pink_floyd&artist=pulse'
string
path_with_args
(string $path, array $args, [string $anchor = ''])
-
string
$path: the path to the file
-
array
$args: a keyed array
-
string
$anchor: an anchor to append to the end, e.g. '#selected'
popup (line 176)
Returns an <a> hyperlink that will open a popup window.
This method is preferable to creating popups with JavaScript functions, as these are blocked by many browsers.
string
popup
(string $path, string $windowname, integer $width, integer $height, string $text, [string $stuff = ''])
-
string
$path: the path to the destination file
-
string
$windowname: the name of the popup window
-
integer
$width: the width of the window in pixels
-
integer
$height: the height of the window in pixels
-
string
$text: the text or image to be linked
-
string
$stuff: extra attributes to be included in the tag
quicktime_player (line 346)
Returns the code for a QuickTime player plugin.
string
quicktime_player
(string $source, integer $width, bool $autoplay)
-
string
$source: the path to the audio file
-
integer
$width: the width in pixels
-
bool
$autoplay: whether the player should start automatically
rating (line 281)
Returns a formatted rating.
string
rating
(integer $stars)
-
integer
$stars: the rating number, between 0 and 100
scramble_email (line 365)
Converts an email address into HTML entities to make it more difficult for spambots to harvest.
string
scramble_email
(string $string)
-
string
$string: the email address
size_format (line 262)
Returns a formatted size.
string
size_format
(double $size)
-
double
$size: the size in kilobytes
songs_plural (line 317)
Returns the word 'song' or 'songs' depending upon whether $count is plural.
string
songs_plural
(integer $count)
-
integer
$count: the number of songs
td (line 42)
Returns a <td> table cell tag.
string
td
(string $class, string $content, [integer $width = NULL], [integer $height = NULL], [integer $colspan = 1], [integer $rowspan = 1], [string $stuff = ''])
-
string
$class: the class
-
string
$content: the content that should be included inside the tag
-
integer
$width: the width in pixels
-
integer
$height: the height in pixels
-
integer
$colspan: the number of columns
-
integer
$rowspan: the number of rows
-
string
$stuff: extra attributes to be included in the tag
time_format (line 211)
Returns the total time in days, hours, minutes and seconds.
string
time_format
(integer $time)
-
integer
$time: the the time in seconds
time_format_simple (line 232)
Returns the total time in days, hours or minutes.
string
time_format_simple
(integer $time)
-
integer
$time: the the time in seconds
tr (line 58)
Returns a <tr> table row tag.
string
tr
(array $rows)
-
array
$rows: an array of <td> tags