Actually my code is a little bit off, since I just wrote it from memory. I've looked back at my code, and I've found an even easier way to do this. Here is a full working example.
1. Create a custom SQL bbcode, fill in any dummy text in the replacement HTML box (it won't be used). This will cause the bbcode to show up on misc,php?do=bbcode
2. Create a plugin on
bbcode_create: The trick is adding 'sql' to the list of unparsed tags (the last line).
PHP Code:
if (!function_exists ('handle_sql_bbcode_tag'))
{
function handle_sql_bbcode_tag (&$theobj, &$value, &$option)
{
// format the HTML output for an SQL tag here
return "<div style='border:1px solid red;padding:10px;'>$value</div>";
}
}
$this->tag_list['no_option']['sql'] = array ();
$this->tag_list['no_option']['sql']['callback'] = 'handle_external';
$this->tag_list['no_option']['sql']['external_callback'] = 'handle_sql_bbcode_tag';
$this->unparsed_tags[] = 'sql';