PDA

View Full Version : Prevent BBCodes from Parsing in Signatures


Psyduck
07-13-2010, 03:21 PM
Hi everyone!

As I did not receive any answer in the German forums, I now try my luck here :p

As the title says, I want to prevent an own BBCode from getting parsed in signatures, or that it will get parsed in another way.
For example we have a BBCode, which creates a Box containing some information, but this box is too huge to be used in signatures. So instead of displaying this box, the BBCode should get parsed to a simple text link in signatures, or at least it should not get parsed at all.

The problem now is, that I do not know, how to differentiate between normal post parsing, and signature parsing.

My current plugin code is mostly the default code for own BBCodes via plugin:
// Plugin-Hook: bbcode_fetch_tags
$tag_list['no_option']['test'] = array(
'callback' => 'handle_external',
'external_callback' => 'handleBBCodeCallback_test',
'strip_empty' => true,
'disable_smilies' => true,
'stop_parse' => true
);
if (!function_exists('handleBBCodeCallback_test')) {
function handleBBCodeCallback_test(&$parser, $value, $option) {
if (true /* What to put in here? */) {
// Parse the BBCode as Box with all information
return '<div class="someClass">Some more Code</div>';
} else {
// Parse the BBCode as simple Text Link
return '<a href="example.com">Text Link</a>';
}
}
}
I already looked into the vB files (especially on the [video]-BBCode, as it is not parsed in signatures, exactly what I want for my codes), but was not able to find the correct condition.

Can you help me with this problem? In the end, only the condition within the callback is missing (if my current way is correct).


Thanks,
Psyduck