Miscellaneous BBCode elements

version 1
package wikindx4\core\display
author Mark Grimshaw

 Methods

BBCODE class

__construct() 

Decode [list].

bbencode_list(string $message) : string

..[/list] and [list=xx]...[/list]

This has been shamelessly pinched from PHP Bulletin Board code with a little debugging.... Nathan Codding - Jan. 12, 2001. Performs [list][/list] and [list=?][/list] bbencoding on the given string, and returns the results. Any unmatched "[list]" or "[/list]" token will just be left alone. This works fine with both having more than one list in a message, and with nested lists. Since that is not a regular language, this is actually a PDA and uses a stack. Great fun.

Note: This function assumes the first character of $message is a space, which is added by bbencode().

Parameters

$message

string

Returns

string

replace [x].

codeToHtml(string $string) : string

..[/x] BBcode with HTML code

Used for display back from DB table

Parameters

$string

string

Returns

string

Strip all BBCode tags

stripBBCode(string $string) : string

Parameters

$string

string

Returns

string

Callback function for [code].

codeCallback(array $matches) : string

..[/code] which cannot have other BBCode within it

Parameters

$matches

array

Returns

string

Callback function for [img=width*height].

imgCallback(array $matches) : string

..[/img] to check display limitations

Parameters

$matches

array

Returns

string

 Properties

 

$imgHeightLimit 
 

$imgWidthLimit 
 

$session