Topic: Custom UBB Tag
I have a simple UBB tag I'm attempting to implement, but it's been less than successful.
Added my simple tag here:
$pattern = array('#\[b\](.*?)\[/b\]#s',
'#\[i\](.*?)\[/i\]#s',
'#\[u\](.*?)\[/u\]#s',
'#\[url\]([^\[<]*?)\[/url\]#e',
'#\[url=([^\[<]*?)\](.*?)\[/url\]#e',
'#\[email\]([^\[<]*?)\[/email\]#',
'#\[email=([^\[<]*?)\](.*?)\[/email\]#',
'#\[color=([a-zA-Z]*|\#?[0-9a-fA-F]{6})](.*?)\[/color\]#s',
'#\[nilbog\](.*?)\[/nilbog\]#s');
And my preg_replace here, which is a call to function do_nilbog:
$replace = array('<strong>$1</strong>',
'<em>$1</em>',
'<span class="bbu">$1</span>',
'handle_url_tag(\'$1\')',
'handle_url_tag(\'$1\', \'$2\')',
'<a href="mailto:$1">$1</a>',
'<a href="mailto:$1">$2</a>',
'<span style="color: $1">$2</span>',
'do_nilbog(\'$1\')');
Now, my PHP is a little fuzzy, but can I call a function within a string literal? I see it being done here with handle_url_rag, but in my case, it's not calling the function, only (and expected) the variable is being used.