Topic: [Solved] Confused about BBCode that parses with function calls...

Alright, I'm trying to write an extension that adds a BBCode that will function like this:

[book]ISBN#[/book]

And will parse the tag into some information pulled from ISBNDB about the book. I have a function that takes an ISBN# and returns a string with all the markup for what the tag should be replaced with, however, I'm not sure how to implement it.

In parser.php on line 713, we see something like:

$replace[] = 'handle_img_tag(\'$1$3\', true)';

This to me looks like a function call to the "handle_img_tag()" method. However, in my manifest.xml, if I do something similar like:

$replace[] = 'getBookInfoByISBN(\'$1\')';

I just get that output as a string, not as the actual result of the function call... (the function is definitely there, I require_once the file it's in in an earlier hook).

Any ideas on how to make a BBCode replace with the return value of a method as opposed to some static string?

Re: [Solved] Confused about BBCode that parses with function calls...

Doop, it turns out you have to use the 'e' flag on the pattern string!