Ejemplo n.º 1
0
function parse_gwbbcode($text, $build_name = false, $ignore_includes = false)
{
    $hooks = '';
    //For PvXwiki,
    //If a build name is provided, assign it to all builds
    if (!empty($build_name)) {
        $text = preg_replace('#(\\[build[^\\]]*?) name="[^\\]"]+"#isS', "\\1", $text);
        //Remove all build names
        $text = preg_replace('#(\\[build )#isS', "\\1name=\"{$build_name}\" ", $text);
        //Add build names
    }
    //Make sure header hook was included
    if (!defined('GWBBCODE_HEADER_HOOK')) {
        define('GWBBCODE_HEADER_HOOK', true);
        $hooks .= str_replace('{gwbbcode_root_path}', GWBBCODE_ROOT, file_get_contents(GWBB_DYNAMIC_HEADER));
    }
    //Make sure body hook was included
    if (!defined('GWBBCODE_BODY_HOOK')) {
        define('GWBBCODE_BODY_HOOK', true);
        $hooks .= file_get_contents(GWBB_DYNAMIC_BODY);
    }
    $hooks = preg_replace('/[\\r\\n]/', '', $hooks);
    return $hooks . gwbbcodize($text);
}
Ejemplo n.º 2
0
function parse_gwbbcode($t, $n)
{
    global $art_titel;
    $art_titel = $n;
    return gwbbcodize($t);
}