Unofficial SMF API Documentation

./Sources/Subs-Editor.php

bbc_to_html

function bbc_to_html(string $text, bool $compat_mode = false): string

As of SMF 2.1, this is unused. But it is available if any mod wants to use it.

Convert only the BBC that can be edited in HTML mode for the (old) editor.

Type Parameter Description
string $text The text with bbcode in it
bool $compat_mode Whether to actually convert the text

html_to_bbc

function html_to_bbc(string $text): string

Converts HTML to BBC As of SMF 2.1, only used by ManageBoards.php (and possibly mods)

Type Parameter Description
string $text Text containing HTML

fetchTagAttributes

function fetchTagAttributes(string $text): array

Returns an array of attributes associated with a tag.

Type Parameter Description
string $text A tag

legalise_bbc

function legalise_bbc(string $text): string

Attempt to clean up illegal BBC caused by browsers like Opera which don’t obey the rules

Type Parameter Description
string $text Text

getMessageIcons

function getMessageIcons(int $board_id): array

Retrieves a list of message icons.

Type Parameter Description
int $board_id The ID of the board
Integration hooks
integrate_load_message_icons

create_control_richedit

function create_control_richedit(array $editorOptions): void

Creates a box that can be used for richedit stuff like BBC, Smileys etc.

Type Parameter Description
array $editorOptions Various options for the editor
Integration hooks
integrate_bbc_buttons
integrate_sceditor_options

create_control_verification

function create_control_verification(array &$verificationOptions, bool $do_test = false): bool|array

Create a anti-bot verification control?

Type Parameter Description
array \&$verificationOptions Options for the verification control
bool $do_test Whether to check to see if the user entered the code correctly
Integration hooks
integrate_create_control_verification_pre
integrate_create_control_verification_test
integrate_create_control_verification_refresh
integrate_create_control_verification_post

AutoSuggestHandler

function AutoSuggestHandler(bool $checkRegistered = null): void|bool

This keeps track of all registered handling functions for auto suggest functionality and passes execution to them.

Type Parameter Description
bool $checkRegistered If set to something other than null, checks whether the callback function is registered
Integration hooks
integrate_autosuggest

AutoSuggest_Search_Member

function AutoSuggest_Search_Member(): array

Search for a member - by real_name or member_name by default.

AutoSuggest_Search_MemberGroups

function AutoSuggest_Search_MemberGroups(): array

Search for a membergroup by name

AutoSuggest_Search_SMFVersions

function AutoSuggest_Search_SMFVersions(): array

Provides a list of possible SMF versions to use in emulation

Suggest an edit to this page on GitHub