Contents

BBCodeLibrary::DoFont( $bbcode,  $action,  $name,  $default,  $params,  $content )

Description

Source

File: bp-forums/admin/parser.php

function DoFont($bbcode, $action, $name, $default, $params, $content) {
$fonts = explode(",", $default);
$result = "";
$special_fonts = Array(
'serif' => 'serif',
'sans-serif' => 'sans-serif',
'sans serif' => 'sans-serif',
'sansserif' => 'sans-serif',
'sans' => 'sans-serif',
'cursive' => 'cursive',
'fantasy' => 'fantasy',
'monospace' => 'monospace',
'mono' => 'monospace',
);
foreach ($fonts as $font) {
$font = trim($font);
if (isset($special_fonts[$font])) {
if (strlen($result) > 0) $result .= ",";
$result .= $special_fonts[$font];
}
else if (strlen($font) > 0) {
if (strlen($result) > 0) $result .= ",";
$result .= "'$font'";
}
}
return "<span style=\"font-family:$result\">$content</span>";
}

Questions?

We're always happy to help with code or other questions you might have! Search our developer docs, contact support, or connect with our sales team.