Name: [pawn] BBCode
Version: 2.0 RC3
Description;
Pawno scripting language Bulletin Board code.
Wiki: hxxp:wiki.sa-mp.com/wiki/PAWN_tutorial [nonactive]
Example: [pawnz]new Array[128];[/pawnz]
Код:
array(
'tag' => 'pawn',
'type' => 'unparsed_content',
'content' => '<div class="codeheader">' . $txt['pawn'] . ':</div><div class="code">' . ($context['browser']['is_gecko'] ? '<pre style="margin-top: 0; display: inline;">$1</pre>' : '$1') . '</div>',
'validate' => create_function('&$tag, &$data, $disabled', '
global $context;
if (!isset($disabled[\'pawn\']))
{
$data = str_replace(
array(
\'public\',
\'return\',
\'sizeof\',
\'switch\',
\'true\',
\'false\',
\'if\',
\'new\',
\'else\',
\'for(\',
\'while\',
\'(\',
\')\',
\'[\',
\']\',
\'{\',
\'}\',
\''\'
),
array(
\'<span style="color: blue;">public</span>\',
\'<span style="color: blue;">return</span>\',
\'<span style="color: blue;">sizeof</span>\',
\'<span style="color: blue;">switch</span>\',
\'<span style="color: blue;">true</span>\',
\'<span style="color: blue;">false</span>\',
\'<span style="color: blue;">if</span>\',
\'<span style="color: blue;">new</span>\',
\'<span style="color: blue;">else</span>\',
\'<span style="color: blue;">for</span>(\',
\'<span style="color: blue;">while</span>\',
\'<span style="color: red;">(</span>\',
\'<span style="color: red;">)</span>\',
\'<span style="color: red;">[</span>\',
\'<span style="color: red;">]</span>\',
\'<span style="color: red;">{</span>\',
\'<span style="color: red;">}</span>\',
\'|||\'
), $data);
$data = preg_replace(
array(
\'~#(.+?)\<br \/>~is\',
\'~\/\/(.+?)\<br \/\>~i\',
\'~\/\*(.+?)\*\/~i\'
),
array(
\'<span style="color: blue;">#$1<br /></span>\',
\'<span style="color: green;">//$1<br /></span>\',
\'<span style="color: green;">/*$1*/</span>\'
), $data);
$data = str_replace(\'|||\', \''\', $data);
// Older browsers are annoying, aren\'t they?
if ($context[\'browser\'][\'is_ie4\'] || $context[\'browser\'][\'is_ie5\'] || $context[\'browser\'][\'is_ie5.5\'])
$data = str_replace("\t", "<pre style=\"display: inline;\">\t</pre>", $data);
elseif (!$context[\'browser\'][\'is_gecko\'])
$data = str_replace("\t", "<span style=\"white-space: pre;\">\t</span>", $data);
}'),
'block_level' => true,
),
Permissions: Default bbcode permissions.
Feature Set: No need for advanced admin panels and so so. It's enought with ready bbcode and pawn button in New Post/topic page.