Exemplo n.º 1
0
function listtag($listoptions, $text, $tagname)
{
    require_once libfile('function/post');
    $text = preg_replace('/<li>((.(?!<\\/li))*)(?=<\\/?ol|<\\/?ul|<li|\\[list|\\[\\/list)/siU', '<li>\\1</li>', $text) . (isopera() ? '</li>' : NULL);
    $text = recursion('li', $text, 'litag');
    if ($tagname == 'ol') {
        $listtype = fetchoptionvalue('type=', $listoptions) ? fetchoptionvalue('type=', $listoptions) : 1;
        if (in_array($listtype, array('1', 'a', 'A'))) {
            $opentag = '[list=' . $listtype . ']';
        }
    } else {
        $opentag = '[list]';
    }
    return $text ? $opentag . recursion($tagname, $text, 'listtag') . '[/list]' : FALSE;
}
Exemplo n.º 2
0
function fonttag($fontoptions, $text)
{
    $tags = array('font' => 'face=', 'size' => 'size=', 'color' => 'color=');
    $prependtags = $appendtags = '';
    foreach ($tags as $bbcode => $locate) {
        $optionvalue = fetchoptionvalue($locate, $fontoptions);
        if ($optionvalue) {
            $prependtags .= "[{$bbcode}={$optionvalue}]";
            $appendtags = "[/{$bbcode}]{$appendtags}";
        }
    }
    parsestyle($fontoptions, $prependtags, $appendtags);
    return $prependtags . recursion('font', $text, 'fonttag') . $appendtags;
}